From 83c93aca2e1120312ba3213fd0267cead46e01cd Mon Sep 17 00:00:00 2001 From: Victor Petukhov Date: Fri, 22 Jan 2021 17:57:57 +0300 Subject: [PATCH 001/212] Build type enhancement properly, by taking into account both bounds of the original flexible type ^KT-44420 Fixed --- ...irOldFrontendDiagnosticsTestGenerated.java | 6 ++++ .../buildFlexibleEnhancement.kt | 35 +++++++++++++++++++ .../typeQualifierDefault/springNullable.kt | 2 +- .../test/runners/DiagnosticTestGenerated.java | 6 ++++ .../java/typeEnhancement/typeEnhancement.kt | 22 ++++++++---- 5 files changed, 64 insertions(+), 7 deletions(-) create mode 100644 compiler/testData/diagnostics/tests/platformTypes/typeEnhancement/buildFlexibleEnhancement.kt diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java index a6b54dd2470..e5c111460fc 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java @@ -20852,6 +20852,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/platformTypes/typeEnhancement"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Test + @TestMetadata("buildFlexibleEnhancement.kt") + public void testBuildFlexibleEnhancement() throws Exception { + runTest("compiler/testData/diagnostics/tests/platformTypes/typeEnhancement/buildFlexibleEnhancement.kt"); + } + @Test @TestMetadata("overriddenExtensions.kt") public void testOverriddenExtensions() throws Exception { diff --git a/compiler/testData/diagnostics/tests/platformTypes/typeEnhancement/buildFlexibleEnhancement.kt b/compiler/testData/diagnostics/tests/platformTypes/typeEnhancement/buildFlexibleEnhancement.kt new file mode 100644 index 00000000000..f63626243ce --- /dev/null +++ b/compiler/testData/diagnostics/tests/platformTypes/typeEnhancement/buildFlexibleEnhancement.kt @@ -0,0 +1,35 @@ +// FIR_IDENTICAL +// FULL_JDK +// WITH_RUNTIME +// WITH_REFLECT + +// FILE: NonNullApi.java + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ElementType.TYPE, ElementType.PACKAGE}) +@javax.annotation.Nonnull +@javax.annotation.meta.TypeQualifierDefault({ElementType.METHOD, ElementType.PARAMETER}) +@Documented +@Retention(RetentionPolicy.RUNTIME) +public @interface NonNullApi { } + +// FILE: Foo.java + +import java.util.Collection; + +@NonNullApi +public class Foo { + public Foo(Collection c) {} +} + +// FILE: main.kt + +fun test() { + val collection: Collection = listOf(1, 2, 3) + Foo(collection) +} diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullable.kt b/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullable.kt index 4d5c7f9d1f5..be45feea974 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullable.kt +++ b/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/typeQualifierDefault/springNullable.kt @@ -77,7 +77,7 @@ fun main(a: A) { a.field?.length a.field.length - ?")!>a.baz().get(0) + ?")!>a.baz().get(0) a.baz()!!.get(0).get(0) a.baz()!!.get(0)?.get(0) } diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java index cc0bb43c59b..06d706e40c3 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java @@ -20858,6 +20858,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/platformTypes/typeEnhancement"), Pattern.compile("^(.*)\\.kts?$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Test + @TestMetadata("buildFlexibleEnhancement.kt") + public void testBuildFlexibleEnhancement() throws Exception { + runTest("compiler/testData/diagnostics/tests/platformTypes/typeEnhancement/buildFlexibleEnhancement.kt"); + } + @Test @TestMetadata("overriddenExtensions.kt") public void testOverriddenExtensions() throws Exception { diff --git a/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/typeEnhancement/typeEnhancement.kt b/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/typeEnhancement/typeEnhancement.kt index 359a900e96b..5b8a942dc02 100644 --- a/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/typeEnhancement/typeEnhancement.kt +++ b/core/descriptors.jvm/src/org/jetbrains/kotlin/load/java/typeEnhancement/typeEnhancement.kt @@ -58,6 +58,15 @@ class JavaTypeEnhancement(private val javaResolverSettings: JavaResolverSettings // For flexible types, both bounds are indexed in the same way: `(A..C)` gives `0 - (A..C), 1 - B and D`. fun KotlinType.enhance(qualifiers: (Int) -> JavaTypeQualifiers) = unwrap().enhancePossiblyFlexible(qualifiers, 0).typeIfChanged + private fun buildEnhancementByFlexibleTypeBounds(lowerBound: KotlinType, upperBound: KotlinType): KotlinType? { + val upperEnhancement = upperBound.getEnhancement() + val lowerEnhancement = lowerBound.getEnhancement() ?: upperEnhancement ?: return null + + if (upperEnhancement == null) return lowerEnhancement + + return KotlinTypeFactory.flexibleType(lowerEnhancement.lowerIfFlexible(), upperEnhancement.upperIfFlexible()) + } + private fun UnwrappedType.enhancePossiblyFlexible(qualifiers: (Int) -> JavaTypeQualifiers, index: Int): Result { if (isError) return Result(this, 1, false) return when (this) { @@ -72,12 +81,13 @@ class JavaTypeEnhancement(private val javaResolverSettings: JavaResolverSettings } val wereChanges = lowerResult.wereChanges || upperResult.wereChanges - val enhancement = lowerResult.type.getEnhancement() ?: upperResult.type.getEnhancement() - val type = if (!wereChanges) this@enhancePossiblyFlexible - else when { - this is RawTypeImpl -> RawTypeImpl(lowerResult.type, upperResult.type) - else -> KotlinTypeFactory.flexibleType(lowerResult.type, upperResult.type) - }.wrapEnhancement(enhancement) + val enhancement = buildEnhancementByFlexibleTypeBounds(lowerResult.type, upperResult.type) + val type = if (wereChanges) { + when (this) { + is RawTypeImpl -> RawTypeImpl(lowerResult.type, upperResult.type) + else -> KotlinTypeFactory.flexibleType(lowerResult.type, upperResult.type) + }.wrapEnhancement(enhancement) + } else this@enhancePossiblyFlexible Result( type, From 8bd78064be4f2bfb671e5e0c6c04b216ff55e16a Mon Sep 17 00:00:00 2001 From: Victor Petukhov Date: Fri, 22 Jan 2021 15:47:48 +0300 Subject: [PATCH 002/212] Do substitution of a type enhancement, not only lower and upper bounds ^KT-44439 Fixed --- ...irOldFrontendDiagnosticsTestGenerated.java | 6 ++ .../components/NewTypeSubstitutor.kt | 18 +++++- .../substitutionOfTypeEnhancement.kt | 55 +++++++++++++++++++ .../substitutionOfTypeEnhancement.txt | 39 +++++++++++++ .../test/runners/DiagnosticTestGenerated.java | 6 ++ 5 files changed, 123 insertions(+), 1 deletion(-) create mode 100644 compiler/testData/diagnostics/tests/inference/substitutions/substitutionOfTypeEnhancement.kt create mode 100644 compiler/testData/diagnostics/tests/inference/substitutions/substitutionOfTypeEnhancement.txt diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java index e5c111460fc..acf3ec4799e 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java @@ -14189,6 +14189,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti public void testSubstitutionIntoInnerClass() throws Exception { runTest("compiler/testData/diagnostics/tests/inference/substitutions/substitutionIntoInnerClass.kt"); } + + @Test + @TestMetadata("substitutionOfTypeEnhancement.kt") + public void testSubstitutionOfTypeEnhancement() throws Exception { + runTest("compiler/testData/diagnostics/tests/inference/substitutions/substitutionOfTypeEnhancement.kt"); + } } @Nested diff --git a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/inference/components/NewTypeSubstitutor.kt b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/inference/components/NewTypeSubstitutor.kt index f637d19717a..9a7aed50205 100644 --- a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/inference/components/NewTypeSubstitutor.kt +++ b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/inference/components/NewTypeSubstitutor.kt @@ -32,6 +32,19 @@ interface NewTypeSubstitutor : TypeSubstitutorMarker { return null } + private fun substituteTypeEnhancement( + enhancementType: KotlinType, + keepAnnotation: Boolean, + runCapturedChecks: Boolean + ) = when (val type = enhancementType.unwrap()) { + is SimpleType -> substitute(type, keepAnnotation, runCapturedChecks) ?: enhancementType + is FlexibleType -> { + val substitutedLowerBound = substitute(type.lowerBound, keepAnnotation, runCapturedChecks) ?: type.lowerBound + val substitutedUpperBound = substitute(type.upperBound, keepAnnotation, runCapturedChecks) ?: type.upperBound + KotlinTypeFactory.flexibleType(substitutedLowerBound.lowerIfFlexible(), substitutedUpperBound.upperIfFlexible()) + } + } + private fun substitute(type: UnwrappedType, keepAnnotation: Boolean, runCapturedChecks: Boolean): UnwrappedType? = when (type) { is SimpleType -> substitute(type, keepAnnotation, runCapturedChecks) @@ -40,6 +53,9 @@ interface NewTypeSubstitutor : TypeSubstitutorMarker { } else { val lowerBound = substitute(type.lowerBound, keepAnnotation, runCapturedChecks) val upperBound = substitute(type.upperBound, keepAnnotation, runCapturedChecks) + val enhancement = + if (type is TypeWithEnhancement) substituteTypeEnhancement(type, keepAnnotation, runCapturedChecks) else null + if (lowerBound == null && upperBound == null) { null } else { @@ -47,7 +63,7 @@ interface NewTypeSubstitutor : TypeSubstitutorMarker { KotlinTypeFactory.flexibleType( lowerBound?.lowerIfFlexible() ?: type.lowerBound, upperBound?.upperIfFlexible() ?: type.upperBound - ).inheritEnhancement(type) + ).wrapEnhancement(enhancement) } } } diff --git a/compiler/testData/diagnostics/tests/inference/substitutions/substitutionOfTypeEnhancement.kt b/compiler/testData/diagnostics/tests/inference/substitutions/substitutionOfTypeEnhancement.kt new file mode 100644 index 00000000000..4119a190bc8 --- /dev/null +++ b/compiler/testData/diagnostics/tests/inference/substitutions/substitutionOfTypeEnhancement.kt @@ -0,0 +1,55 @@ +// FIR_IDENTICAL +// FULL_JDK +// WITH_RUNTIME +// WITH_REFLECT + +// FILE: NonNullApi.java + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ElementType.TYPE, ElementType.PACKAGE}) +@javax.annotation.Nonnull +@javax.annotation.meta.TypeQualifierDefault({ElementType.METHOD, ElementType.PARAMETER}) +@Documented +@Retention(RetentionPolicy.RUNTIME) +public @interface NonNullApi { } + +// FILE: Task2.java + +public class Task2 implements Task { + void foo() {} +} + +// FILE: Test.java + +public class Test { + void register(Class var2, Foo var3) throws IllegalAccessException, InstantiationException { + var3.execute(var2.newInstance()); + } +} + +// FILE: Foo.java + +@NonNullApi +public interface Foo { + void execute(T t); +} + +// FILE: Task.java + +public interface Task {} + +// FILE: main.kt + +fun main() { + Test().register(Task2::class.java) { // before the fix, type parameter's type leaked here (type of `it` is `T`) + it.foo() + it.apply { + foo() + } + } +} diff --git a/compiler/testData/diagnostics/tests/inference/substitutions/substitutionOfTypeEnhancement.txt b/compiler/testData/diagnostics/tests/inference/substitutions/substitutionOfTypeEnhancement.txt new file mode 100644 index 00000000000..ff32d607d69 --- /dev/null +++ b/compiler/testData/diagnostics/tests/inference/substitutions/substitutionOfTypeEnhancement.txt @@ -0,0 +1,39 @@ +package + +public fun main(): kotlin.Unit + +@NonNullApi public interface Foo { + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public abstract fun execute(/*0*/ t: T!): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS, AnnotationTarget.FILE}) @javax.annotation.Nonnull /* annotation class not found */ @javax.annotation.meta.TypeQualifierDefault(value = {ElementType.METHOD, ElementType.PARAMETER}) /* annotation class not found */ @kotlin.annotation.MustBeDocumented @kotlin.annotation.Retention(value = AnnotationRetention.RUNTIME) public final annotation class NonNullApi : kotlin.Annotation { + public constructor NonNullApi() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public interface Task { + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public open class Task2 : Task { + public constructor Task2() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public/*package*/ open fun foo(): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public open class Test { + public constructor Test() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public/*package*/ open fun register(/*0*/ var2: java.lang.Class!, /*1*/ var3: Foo!): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java index 06d706e40c3..74f5057f586 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java @@ -14195,6 +14195,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { public void testSubstitutionIntoInnerClass() throws Exception { runTest("compiler/testData/diagnostics/tests/inference/substitutions/substitutionIntoInnerClass.kt"); } + + @Test + @TestMetadata("substitutionOfTypeEnhancement.kt") + public void testSubstitutionOfTypeEnhancement() throws Exception { + runTest("compiler/testData/diagnostics/tests/inference/substitutions/substitutionOfTypeEnhancement.kt"); + } } @Nested From fdf0934adea69cb511928106e2391080861956c5 Mon Sep 17 00:00:00 2001 From: Victor Petukhov Date: Mon, 25 Jan 2021 12:16:13 +0300 Subject: [PATCH 003/212] Don't generate txt dump for `buildFlexibleEnhancement.kt` diagnostic test --- .../platformTypes/typeEnhancement/buildFlexibleEnhancement.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/testData/diagnostics/tests/platformTypes/typeEnhancement/buildFlexibleEnhancement.kt b/compiler/testData/diagnostics/tests/platformTypes/typeEnhancement/buildFlexibleEnhancement.kt index f63626243ce..e095336093f 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/typeEnhancement/buildFlexibleEnhancement.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/typeEnhancement/buildFlexibleEnhancement.kt @@ -2,6 +2,7 @@ // FULL_JDK // WITH_RUNTIME // WITH_REFLECT +// SKIP_TXT // FILE: NonNullApi.java From 3a3d2ee3e9d62b00e38e6fe818e7fbaa86691f12 Mon Sep 17 00:00:00 2001 From: "Denis.Zharkov" Date: Fri, 22 Jan 2021 11:44:30 +0300 Subject: [PATCH 004/212] FIR2IR: Fix mapping for intersection overrides of deserialized properties --- .../fir/backend/Fir2IrDeclarationStorage.kt | 2 +- ...mpileKotlinAgainstKotlinTestGenerated.java | 5 +++ .../org/jetbrains/kotlin/fir/ClassMembers.kt | 1 + .../box/specialBuiltins/explicitSuperCall.kt | 1 - .../intersectionOverrideProperies.kt | 39 +++++++++++++++++++ .../ir/irText/firProblems/MultiList.fir.txt | 4 +- ...mpileKotlinAgainstKotlinTestGenerated.java | 5 +++ ...mpileKotlinAgainstKotlinTestGenerated.java | 5 +++ .../ir/JvmIrAgainstOldBoxTestGenerated.java | 5 +++ .../ir/JvmOldAgainstIrBoxTestGenerated.java | 5 +++ 10 files changed, 68 insertions(+), 4 deletions(-) create mode 100644 compiler/testData/compileKotlinAgainstKotlin/intersectionOverrideProperies.kt diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt index ddbe46d2c9b..9e58d54636d 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt @@ -1065,7 +1065,7 @@ class Fir2IrDeclarationStorage( val irProperty = fir.convertWithOffsets { startOffset, endOffset -> symbolTable.declareProperty(signature, { symbol }) { val isFakeOverride = - fir.isSubstitutionOverride && + fir.isSubstitutionOrIntersectionOverride && firPropertySymbol.dispatchReceiverClassOrNull() != firPropertySymbol.originalForSubstitutionOverride?.dispatchReceiverClassOrNull() Fir2IrLazyProperty( diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/FirCompileKotlinAgainstKotlinTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/FirCompileKotlinAgainstKotlinTestGenerated.java index 0de6b68c39a..4a3ba048705 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/FirCompileKotlinAgainstKotlinTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/FirCompileKotlinAgainstKotlinTestGenerated.java @@ -210,6 +210,11 @@ public class FirCompileKotlinAgainstKotlinTestGenerated extends AbstractFirCompi runTest("compiler/testData/compileKotlinAgainstKotlin/internalWithOtherModuleName.kt"); } + @TestMetadata("intersectionOverrideProperies.kt") + public void testIntersectionOverrideProperies() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/intersectionOverrideProperies.kt"); + } + @TestMetadata("jvmField.kt") public void testJvmField() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/jvmField.kt"); diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/ClassMembers.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/ClassMembers.kt index 8fe3915a9e2..70886469e9b 100644 --- a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/ClassMembers.kt +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/ClassMembers.kt @@ -32,6 +32,7 @@ var FirCallableDeclaration<*>.containingClassAttr: ConeClassLikeLookupTag? by Fi val FirCallableDeclaration<*>.isIntersectionOverride get() = origin == FirDeclarationOrigin.IntersectionOverride val FirCallableDeclaration<*>.isSubstitutionOverride get() = origin == FirDeclarationOrigin.SubstitutionOverride +val FirCallableDeclaration<*>.isSubstitutionOrIntersectionOverride get() = isSubstitutionOverride || isIntersectionOverride inline val > D.originalForSubstitutionOverride: D? get() = if (isSubstitutionOverride) originalForSubstitutionOverrideAttr else null diff --git a/compiler/testData/codegen/box/specialBuiltins/explicitSuperCall.kt b/compiler/testData/codegen/box/specialBuiltins/explicitSuperCall.kt index f9f912f3ab6..c6741f2d4c8 100644 --- a/compiler/testData/codegen/box/specialBuiltins/explicitSuperCall.kt +++ b/compiler/testData/codegen/box/specialBuiltins/explicitSuperCall.kt @@ -1,6 +1,5 @@ // DONT_TARGET_EXACT_BACKEND: WASM // WASM_MUTE_REASON: STDLIB_COLLECTIONS -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // IGNORE_BACKEND: NATIVE diff --git a/compiler/testData/compileKotlinAgainstKotlin/intersectionOverrideProperies.kt b/compiler/testData/compileKotlinAgainstKotlin/intersectionOverrideProperies.kt new file mode 100644 index 00000000000..33a46830ff2 --- /dev/null +++ b/compiler/testData/compileKotlinAgainstKotlin/intersectionOverrideProperies.kt @@ -0,0 +1,39 @@ +// TARGET_BACKEND: JVM +// FILE: A.kt +package a + +interface IrSymbol { + val owner: Any +} + +interface IrFunction +interface IrSimpleFunction : IrFunction { + val name: String +} + +interface IrFunctionSymbol : IrSymbol { + override val owner: IrFunction +} + +interface IrBindableSymbol : IrSymbol { + override val owner: B +} + +interface IrSimpleFunctionSymbol : IrFunctionSymbol, IrBindableSymbol + +// FILE: B.kt +import a.* + +fun foo(x: IrSimpleFunctionSymbol): String { + return x.owner.name +} + +fun box(): String { + return foo(object : IrSimpleFunctionSymbol { + override val owner: IrSimpleFunction + get() = object : IrSimpleFunction { + override val name: String + get() = "OK" + } + }) +} diff --git a/compiler/testData/ir/irText/firProblems/MultiList.fir.txt b/compiler/testData/ir/irText/firProblems/MultiList.fir.txt index 8d210d28fb8..02fffb889eb 100644 --- a/compiler/testData/ir/irText/firProblems/MultiList.fir.txt +++ b/compiler/testData/ir/irText/firProblems/MultiList.fir.txt @@ -261,7 +261,7 @@ FILE fqName: fileName:/MultiList.kt correspondingProperty: PROPERTY FAKE_OVERRIDE name:size visibility:public modality:ABSTRACT [fake_override,val] overridden: public abstract fun (): kotlin.Int declared in kotlin.collections.List - public abstract fun (): kotlin.Int declared in java.util.ArrayList + public abstract fun (): kotlin.Int [fake_override] declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:kotlin.collections.List FUN FAKE_OVERRIDE name:spliterator visibility:public modality:OPEN <> ($this:java.util.Collection) returnType:@[FlexibleNullability] java.util.Spliterator<.Some.SomeList>?> [fake_override] overridden: @@ -471,7 +471,7 @@ FILE fqName: fileName:/MultiList.kt correspondingProperty: PROPERTY FAKE_OVERRIDE name:size visibility:public modality:ABSTRACT [fake_override,val] overridden: public abstract fun (): kotlin.Int declared in kotlin.collections.List - public abstract fun (): kotlin.Int declared in java.util.ArrayList + public abstract fun (): kotlin.Int [fake_override] declared in java.util.ArrayList $this: VALUE_PARAMETER name: type:kotlin.collections.List FUN FAKE_OVERRIDE name:spliterator visibility:public modality:OPEN <> ($this:java.util.Collection) returnType:@[FlexibleNullability] java.util.Spliterator<.Some?> [fake_override] overridden: diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/CompileKotlinAgainstKotlinTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/CompileKotlinAgainstKotlinTestGenerated.java index d9f5dee2663..f32544bc465 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/CompileKotlinAgainstKotlinTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/CompileKotlinAgainstKotlinTestGenerated.java @@ -209,6 +209,11 @@ public class CompileKotlinAgainstKotlinTestGenerated extends AbstractCompileKotl runTest("compiler/testData/compileKotlinAgainstKotlin/internalWithOtherModuleName.kt"); } + @TestMetadata("intersectionOverrideProperies.kt") + public void testIntersectionOverrideProperies() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/intersectionOverrideProperies.kt"); + } + @TestMetadata("jvmField.kt") public void testJvmField() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/jvmField.kt"); diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstKotlinTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstKotlinTestGenerated.java index cd49136a2cb..d06467ecb17 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstKotlinTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstKotlinTestGenerated.java @@ -210,6 +210,11 @@ public class IrCompileKotlinAgainstKotlinTestGenerated extends AbstractIrCompile runTest("compiler/testData/compileKotlinAgainstKotlin/internalWithOtherModuleName.kt"); } + @TestMetadata("intersectionOverrideProperies.kt") + public void testIntersectionOverrideProperies() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/intersectionOverrideProperies.kt"); + } + @TestMetadata("jvmField.kt") public void testJvmField() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/jvmField.kt"); diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmIrAgainstOldBoxTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmIrAgainstOldBoxTestGenerated.java index 1e15624f388..adf66b2a2c9 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmIrAgainstOldBoxTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmIrAgainstOldBoxTestGenerated.java @@ -210,6 +210,11 @@ public class JvmIrAgainstOldBoxTestGenerated extends AbstractJvmIrAgainstOldBoxT runTest("compiler/testData/compileKotlinAgainstKotlin/internalWithOtherModuleName.kt"); } + @TestMetadata("intersectionOverrideProperies.kt") + public void testIntersectionOverrideProperies() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/intersectionOverrideProperies.kt"); + } + @TestMetadata("jvmField.kt") public void testJvmField() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/jvmField.kt"); diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmOldAgainstIrBoxTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmOldAgainstIrBoxTestGenerated.java index e8b8722bf95..3ab0fcfc80a 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmOldAgainstIrBoxTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmOldAgainstIrBoxTestGenerated.java @@ -210,6 +210,11 @@ public class JvmOldAgainstIrBoxTestGenerated extends AbstractJvmOldAgainstIrBoxT runTest("compiler/testData/compileKotlinAgainstKotlin/internalWithOtherModuleName.kt"); } + @TestMetadata("intersectionOverrideProperies.kt") + public void testIntersectionOverrideProperies() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/intersectionOverrideProperies.kt"); + } + @TestMetadata("jvmField.kt") public void testJvmField() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/jvmField.kt"); From 8c30adc301183a0b18e6590ac3b3c5de2850f90f Mon Sep 17 00:00:00 2001 From: "Denis.Zharkov" Date: Fri, 22 Jan 2021 19:34:07 +0300 Subject: [PATCH 005/212] FIR2IR: Unwrap intersection overrides for intersection types --- .../kotlin/fir/backend/ConversionUtils.kt | 14 ++++++- ...mpileKotlinAgainstKotlinTestGenerated.java | 5 +++ .../fakeOverridesForIntersectionTypes.kt | 40 +++++++++++++++++++ ...mpileKotlinAgainstKotlinTestGenerated.java | 5 +++ ...mpileKotlinAgainstKotlinTestGenerated.java | 5 +++ .../ir/JvmIrAgainstOldBoxTestGenerated.java | 5 +++ .../ir/JvmOldAgainstIrBoxTestGenerated.java | 5 +++ 7 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 compiler/testData/compileKotlinAgainstKotlin/fakeOverridesForIntersectionTypes.kt diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt index ed271c778d4..e7ee5d59922 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt @@ -232,7 +232,19 @@ internal tailrec fun FirCallableSymbol<*>.unwrapCallRepresentative(root: FirCall val originalForTypeAlias = fir.originalConstructorIfTypeAlias if (originalForTypeAlias != null) return originalForTypeAlias.symbol.unwrapCallRepresentative(this) } - if (fir.isIntersectionOverride) return this + + if (fir.isIntersectionOverride) { + // We've got IR declarations (fake overrides) for intersection overrides in classes, but not for intersection types + // interface A { fun foo() } + // interface B { fun foo() } + // interface C : A, B // for C.foo we've got an IR fake override + // for {A & B} we don't have such an IR declaration, so we're unwrapping it + if (fir is FirCallableMemberDeclaration && fir.dispatchReceiverType is ConeIntersectionType) { + return fir.baseForIntersectionOverride!!.symbol.unwrapCallRepresentative(this) + } + + return this + } val overriddenSymbol = fir.originalForSubstitutionOverride?.takeIf { it.containingClass() == root.containingClass() diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/FirCompileKotlinAgainstKotlinTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/FirCompileKotlinAgainstKotlinTestGenerated.java index 4a3ba048705..96f03a929c6 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/FirCompileKotlinAgainstKotlinTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/FirCompileKotlinAgainstKotlinTestGenerated.java @@ -150,6 +150,11 @@ public class FirCompileKotlinAgainstKotlinTestGenerated extends AbstractFirCompi runTest("compiler/testData/compileKotlinAgainstKotlin/expectClassActualTypeAlias.kt"); } + @TestMetadata("fakeOverridesForIntersectionTypes.kt") + public void testFakeOverridesForIntersectionTypes() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/fakeOverridesForIntersectionTypes.kt"); + } + @TestMetadata("importCompanion.kt") public void testImportCompanion() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/importCompanion.kt"); diff --git a/compiler/testData/compileKotlinAgainstKotlin/fakeOverridesForIntersectionTypes.kt b/compiler/testData/compileKotlinAgainstKotlin/fakeOverridesForIntersectionTypes.kt new file mode 100644 index 00000000000..c134e2541d6 --- /dev/null +++ b/compiler/testData/compileKotlinAgainstKotlin/fakeOverridesForIntersectionTypes.kt @@ -0,0 +1,40 @@ +// TARGET_BACKEND: JVM +// FILE: A.kt +package a + +interface T { + var x: String +} + +interface A : T { + override var x: String +} + +interface B : T { + override var x: String +} + +class C : A, B { + override var x: String = "" +} + +class D : A, B { + override var x: String = "" +} + +// FILE: B.kt +import a.* + +fun foo(condition: Boolean): String { + val aAndB = if (condition) C() else D() + aAndB.x = "OK" + + return aAndB.x +} + +fun box(): String { + if (foo(true) != "OK") return "fail 1" + if (foo(false) != "OK") return "fail 2" + + return "OK" +} diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/CompileKotlinAgainstKotlinTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/CompileKotlinAgainstKotlinTestGenerated.java index f32544bc465..e940b1e4e08 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/CompileKotlinAgainstKotlinTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/CompileKotlinAgainstKotlinTestGenerated.java @@ -149,6 +149,11 @@ public class CompileKotlinAgainstKotlinTestGenerated extends AbstractCompileKotl runTest("compiler/testData/compileKotlinAgainstKotlin/expectClassActualTypeAlias.kt"); } + @TestMetadata("fakeOverridesForIntersectionTypes.kt") + public void testFakeOverridesForIntersectionTypes() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/fakeOverridesForIntersectionTypes.kt"); + } + @TestMetadata("importCompanion.kt") public void testImportCompanion() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/importCompanion.kt"); diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstKotlinTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstKotlinTestGenerated.java index d06467ecb17..b5eb98e6ded 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstKotlinTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstKotlinTestGenerated.java @@ -150,6 +150,11 @@ public class IrCompileKotlinAgainstKotlinTestGenerated extends AbstractIrCompile runTest("compiler/testData/compileKotlinAgainstKotlin/expectClassActualTypeAlias.kt"); } + @TestMetadata("fakeOverridesForIntersectionTypes.kt") + public void testFakeOverridesForIntersectionTypes() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/fakeOverridesForIntersectionTypes.kt"); + } + @TestMetadata("importCompanion.kt") public void testImportCompanion() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/importCompanion.kt"); diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmIrAgainstOldBoxTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmIrAgainstOldBoxTestGenerated.java index adf66b2a2c9..8c271d82a35 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmIrAgainstOldBoxTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmIrAgainstOldBoxTestGenerated.java @@ -150,6 +150,11 @@ public class JvmIrAgainstOldBoxTestGenerated extends AbstractJvmIrAgainstOldBoxT runTest("compiler/testData/compileKotlinAgainstKotlin/expectClassActualTypeAlias.kt"); } + @TestMetadata("fakeOverridesForIntersectionTypes.kt") + public void testFakeOverridesForIntersectionTypes() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/fakeOverridesForIntersectionTypes.kt"); + } + @TestMetadata("importCompanion.kt") public void testImportCompanion() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/importCompanion.kt"); diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmOldAgainstIrBoxTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmOldAgainstIrBoxTestGenerated.java index 3ab0fcfc80a..372a0b84881 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmOldAgainstIrBoxTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmOldAgainstIrBoxTestGenerated.java @@ -150,6 +150,11 @@ public class JvmOldAgainstIrBoxTestGenerated extends AbstractJvmOldAgainstIrBoxT runTest("compiler/testData/compileKotlinAgainstKotlin/expectClassActualTypeAlias.kt"); } + @TestMetadata("fakeOverridesForIntersectionTypes.kt") + public void testFakeOverridesForIntersectionTypes() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/fakeOverridesForIntersectionTypes.kt"); + } + @TestMetadata("importCompanion.kt") public void testImportCompanion() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/importCompanion.kt"); From 9548caf6ea532d0db8375a1a8c1874b730001aa0 Mon Sep 17 00:00:00 2001 From: "Denis.Zharkov" Date: Mon, 25 Jan 2021 10:52:50 +0300 Subject: [PATCH 006/212] FIR2IR: Use TEST ClassBuilderFactory in for tests It helps with bytecode printing when tests fail --- .../kotlin/test/frontend/fir/Fir2IrResultsConverter.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/Fir2IrResultsConverter.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/Fir2IrResultsConverter.kt index d7fce5c3400..2c82f999c12 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/Fir2IrResultsConverter.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/Fir2IrResultsConverter.kt @@ -64,7 +64,7 @@ class Fir2IrResultsConverter( ) val generationState = GenerationState.Builder( - project, ClassBuilderFactories.BINARIES, + project, ClassBuilderFactories.TEST, container.get(), dummyBindingContext, ktFiles, configuration ).codegenFactory( From f2c1608c2bb6f33ed41dc79b14f7b295cc8ca133 Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Fri, 22 Jan 2021 19:18:34 +0300 Subject: [PATCH 007/212] Update testData --- .../shadowedExtension/extensionOnErrorType.fir.kt | 7 ------- .../shadowedExtension/extensionOnErrorType.kt | 2 ++ .../diagnostics/tests/resolve/CycleInTypeArgs.fir.kt | 3 --- .../testData/diagnostics/tests/resolve/CycleInTypeArgs.kt | 2 ++ compiler/testData/diagnostics/tests/subtyping/kt304.fir.kt | 7 ------- compiler/testData/diagnostics/tests/subtyping/kt304.kt | 2 ++ 6 files changed, 6 insertions(+), 17 deletions(-) delete mode 100644 compiler/testData/diagnostics/tests/redeclarations/shadowedExtension/extensionOnErrorType.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/resolve/CycleInTypeArgs.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/subtyping/kt304.fir.kt diff --git a/compiler/testData/diagnostics/tests/redeclarations/shadowedExtension/extensionOnErrorType.fir.kt b/compiler/testData/diagnostics/tests/redeclarations/shadowedExtension/extensionOnErrorType.fir.kt deleted file mode 100644 index 03781e5adfa..00000000000 --- a/compiler/testData/diagnostics/tests/redeclarations/shadowedExtension/extensionOnErrorType.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -interface G { - fun foo() - val bar: Int -} - -fun G.foo() {} -val G.bar: Int get() = 42 \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/redeclarations/shadowedExtension/extensionOnErrorType.kt b/compiler/testData/diagnostics/tests/redeclarations/shadowedExtension/extensionOnErrorType.kt index 03781e5adfa..79f828acfd1 100644 --- a/compiler/testData/diagnostics/tests/redeclarations/shadowedExtension/extensionOnErrorType.kt +++ b/compiler/testData/diagnostics/tests/redeclarations/shadowedExtension/extensionOnErrorType.kt @@ -1,3 +1,5 @@ +// FIR_IDENTICAL + interface G { fun foo() val bar: Int diff --git a/compiler/testData/diagnostics/tests/resolve/CycleInTypeArgs.fir.kt b/compiler/testData/diagnostics/tests/resolve/CycleInTypeArgs.fir.kt deleted file mode 100644 index d8ef905f937..00000000000 --- a/compiler/testData/diagnostics/tests/resolve/CycleInTypeArgs.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ -class Class1X>>> - -class Class2X>>> \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/CycleInTypeArgs.kt b/compiler/testData/diagnostics/tests/resolve/CycleInTypeArgs.kt index d8ef905f937..7065ae0cf1a 100644 --- a/compiler/testData/diagnostics/tests/resolve/CycleInTypeArgs.kt +++ b/compiler/testData/diagnostics/tests/resolve/CycleInTypeArgs.kt @@ -1,3 +1,5 @@ +// FIR_IDENTICAL + class Class1X>>> class Class2X>>> \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/subtyping/kt304.fir.kt b/compiler/testData/diagnostics/tests/subtyping/kt304.fir.kt deleted file mode 100644 index 95b34f3a56a..00000000000 --- a/compiler/testData/diagnostics/tests/subtyping/kt304.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -//KT-304: Resolve supertype reference to class anyway - -open class Foo() : Bar() { -} - -open class Bar() { -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/subtyping/kt304.kt b/compiler/testData/diagnostics/tests/subtyping/kt304.kt index 95b34f3a56a..f8eb56c0730 100644 --- a/compiler/testData/diagnostics/tests/subtyping/kt304.kt +++ b/compiler/testData/diagnostics/tests/subtyping/kt304.kt @@ -1,3 +1,5 @@ +// FIR_IDENTICAL + //KT-304: Resolve supertype reference to class anyway open class Foo() : Bar() { From f06a5321a62585741c99a69c0a7b84d6e03b0927 Mon Sep 17 00:00:00 2001 From: Victor Petukhov Date: Thu, 21 Jan 2021 14:57:28 +0300 Subject: [PATCH 008/212] Approximate definitely not-null types for type parameter's types if they are already not-null (has not-null upper bounds) ^KT-44440 Fixed --- .../definetelyNotNullForTypeParameter.fir.txt | 2 +- ...irOldFrontendDiagnosticsTestGenerated.java | 6 +++ .../kotlin/fir/types/ConeInferenceContext.kt | 4 ++ .../kotlin/types/AbstractTypeApproximator.kt | 6 +++ .../inference/regressions/kt44440.fir.kt | 21 +++++++++ .../tests/inference/regressions/kt44440.kt | 21 +++++++++ .../tests/inference/regressions/kt44440.txt | 28 ++++++++++++ .../test/runners/DiagnosticTestGenerated.java | 6 +++ .../diagnostics/notLinked/dfa/pos/12.fir.kt | 44 +++++++++---------- .../diagnostics/notLinked/dfa/pos/13.fir.kt | 44 +++++++++---------- .../kotlin/types/model/TypeSystemContext.kt | 2 + .../types/checker/ClassicTypeSystemContext.kt | 5 +++ 12 files changed, 144 insertions(+), 45 deletions(-) create mode 100644 compiler/testData/diagnostics/tests/inference/regressions/kt44440.fir.kt create mode 100644 compiler/testData/diagnostics/tests/inference/regressions/kt44440.kt create mode 100644 compiler/testData/diagnostics/tests/inference/regressions/kt44440.txt diff --git a/compiler/fir/analysis-tests/testData/resolve/arguments/definetelyNotNullForTypeParameter.fir.txt b/compiler/fir/analysis-tests/testData/resolve/arguments/definetelyNotNullForTypeParameter.fir.txt index 465f220857f..4dfaae98256 100644 --- a/compiler/fir/analysis-tests/testData/resolve/arguments/definetelyNotNullForTypeParameter.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/arguments/definetelyNotNullForTypeParameter.fir.txt @@ -7,5 +7,5 @@ FILE: definetelyNotNullForTypeParameter.kt public final fun foo(computable: R|Out|): R|kotlin/Unit| { } public final fun bar(computable: R|Out|): R|kotlin/Unit| { - R|/foo|(R|/id|(R|/computable|)) + R|/foo|(R|/id|(R|/computable|)) } diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java index acf3ec4799e..1fb24221dd3 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java @@ -14002,6 +14002,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti runTest("compiler/testData/diagnostics/tests/inference/regressions/kt4420.kt"); } + @Test + @TestMetadata("kt44440.kt") + public void testKt44440() throws Exception { + runTest("compiler/testData/diagnostics/tests/inference/regressions/kt44440.kt"); + } + @Test @TestMetadata("kt702.kt") public void testKt702() throws Exception { diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/types/ConeInferenceContext.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/types/ConeInferenceContext.kt index 8b24fb9e583..0b16784e182 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/types/ConeInferenceContext.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/types/ConeInferenceContext.kt @@ -360,6 +360,10 @@ interface ConeInferenceContext : TypeSystemInferenceExtensionContext, ConeTypeCo return this is ConeCapturedTypeConstructor } + override fun TypeConstructorMarker.isTypeParameterTypeConstructor(): Boolean { + return this.getTypeParameterClassifier() != null + } + override fun KotlinTypeMarker.removeExactAnnotation(): KotlinTypeMarker { // TODO return this diff --git a/compiler/resolution.common/src/org/jetbrains/kotlin/types/AbstractTypeApproximator.kt b/compiler/resolution.common/src/org/jetbrains/kotlin/types/AbstractTypeApproximator.kt index 1dff6729d95..d4c8f0e3d50 100644 --- a/compiler/resolution.common/src/org/jetbrains/kotlin/types/AbstractTypeApproximator.kt +++ b/compiler/resolution.common/src/org/jetbrains/kotlin/types/AbstractTypeApproximator.kt @@ -338,6 +338,12 @@ abstract class AbstractTypeApproximator(val ctx: TypeSystemInferenceExtensionCon val originalType = type.original() val approximatedOriginalType = if (toSuper) approximateToSuperType(originalType, conf, depth) else approximateToSubType(originalType, conf, depth) + val typeWithErasedNullability = originalType.withNullability(false) + + // Approximate T!! into T if T is already not-null (has not-null upper bounds) + if (originalType.typeConstructor().isTypeParameterTypeConstructor() && !typeWithErasedNullability.isNullableType()) { + return typeWithErasedNullability + } return if (conf.definitelyNotNullType) { approximatedOriginalType?.makeDefinitelyNotNullOrNotNull() diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt44440.fir.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt44440.fir.kt new file mode 100644 index 00000000000..5bfbe210324 --- /dev/null +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt44440.fir.kt @@ -0,0 +1,21 @@ +// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -UNUSED_EXPRESSION + +interface I + +fun consume(x: WrapperFactory>) {} + +fun test(x: I) { + val y = foo(x) + >")!>y + consume(y) +} + +fun foo( + x: CX, + fn1: (CX) -> Unit = {}, + fn2: (CX?) -> Unit = {} +) = WrapperFactory { Wrapper(fn1, fn2) } + +class WrapperFactory(val creator: () -> W) + +class Wrapper(val fn1: (CX2) -> Unit, val fn2: (CX2?) -> Unit) diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt44440.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt44440.kt new file mode 100644 index 00000000000..5bfbe210324 --- /dev/null +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt44440.kt @@ -0,0 +1,21 @@ +// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -UNUSED_EXPRESSION + +interface I + +fun consume(x: WrapperFactory>) {} + +fun test(x: I) { + val y = foo(x) + >")!>y + consume(y) +} + +fun foo( + x: CX, + fn1: (CX) -> Unit = {}, + fn2: (CX?) -> Unit = {} +) = WrapperFactory { Wrapper(fn1, fn2) } + +class WrapperFactory(val creator: () -> W) + +class Wrapper(val fn1: (CX2) -> Unit, val fn2: (CX2?) -> Unit) diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt44440.txt b/compiler/testData/diagnostics/tests/inference/regressions/kt44440.txt new file mode 100644 index 00000000000..807941ea2d3 --- /dev/null +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt44440.txt @@ -0,0 +1,28 @@ +package + +public fun consume(/*0*/ x: WrapperFactory>): kotlin.Unit +public fun foo(/*0*/ x: CX, /*1*/ fn1: (CX) -> kotlin.Unit = ..., /*2*/ fn2: (CX?) -> kotlin.Unit = ...): WrapperFactory> +public fun test(/*0*/ x: I): kotlin.Unit + +public interface I { + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public final class Wrapper { + public constructor Wrapper(/*0*/ fn1: (CX2) -> kotlin.Unit, /*1*/ fn2: (CX2?) -> kotlin.Unit) + public final val fn1: (CX2) -> kotlin.Unit + public final val fn2: (CX2?) -> kotlin.Unit + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public final class WrapperFactory { + public constructor WrapperFactory(/*0*/ creator: () -> W) + public final val creator: () -> W + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java index 74f5057f586..24216caa2a4 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java @@ -14008,6 +14008,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/inference/regressions/kt4420.kt"); } + @Test + @TestMetadata("kt44440.kt") + public void testKt44440() throws Exception { + runTest("compiler/testData/diagnostics/tests/inference/regressions/kt44440.kt"); + } + @Test @TestMetadata("kt702.kt") public void testKt702() throws Exception { diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/12.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/12.fir.kt index d4e97b770a2..12f5812c047 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/12.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/12.fir.kt @@ -464,7 +464,7 @@ fun T?.case_11() { equals(this) itest1() apply { - this + this equals(null) propT propAny @@ -475,29 +475,29 @@ fun T?.case_11() { funNullableT() funNullableAny() itest1() - this.equals(null) - this.propT - this.propAny - this.propNullableT - this.propNullableAny - this.funT() - this.funAny() - this.funNullableT() - this.funNullableAny() - this.itest1() + this.equals(null) + this.propT + this.propAny + this.propNullableT + this.propNullableAny + this.funT() + this.funAny() + this.funNullableT() + this.funNullableAny() + this.itest1() } also { - it - it.itest1() - it.equals(null) - it.propT - it.propAny - it.propNullableT - it.propNullableAny - it.funT() - it.funAny() - it.funNullableT() - it.funNullableAny() + it + it.itest1() + it.equals(null) + it.propT + it.propAny + it.propNullableT + it.propNullableAny + it.funT() + it.funAny() + it.funNullableT() + it.funNullableAny() } } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/13.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/13.fir.kt index 520b79e3e46..c8701c8a687 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/13.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/13.fir.kt @@ -564,7 +564,7 @@ fun case_11(x: T?) { x.funNullableAny() x.itest() x.apply { - this + this equals(null) propT propAny @@ -575,29 +575,29 @@ fun case_11(x: T?) { funNullableT() funNullableAny() itest() - this.equals(null) - this.propT - this.propAny - this.propNullableT - this.propNullableAny - this.funT() - this.funAny() - this.funNullableT() - this.funNullableAny() - this.itest() + this.equals(null) + this.propT + this.propAny + this.propNullableT + this.propNullableAny + this.funT() + this.funAny() + this.funNullableT() + this.funNullableAny() + this.itest() } x.also { - it - it.itest() - it.equals(null) - it.propT - it.propAny - it.propNullableT - it.propNullableAny - it.funT() - it.funAny() - it.funNullableT() - it.funNullableAny() + it + it.itest() + it.equals(null) + it.propT + it.propAny + it.propNullableT + it.propNullableAny + it.funT() + it.funAny() + it.funNullableT() + it.funNullableAny() } } } diff --git a/core/compiler.common/src/org/jetbrains/kotlin/types/model/TypeSystemContext.kt b/core/compiler.common/src/org/jetbrains/kotlin/types/model/TypeSystemContext.kt index 9bb9a8020a7..6c7f40d41b6 100644 --- a/core/compiler.common/src/org/jetbrains/kotlin/types/model/TypeSystemContext.kt +++ b/core/compiler.common/src/org/jetbrains/kotlin/types/model/TypeSystemContext.kt @@ -137,6 +137,8 @@ interface TypeSystemInferenceExtensionContext : TypeSystemContext, TypeSystemBui fun TypeConstructorMarker.isCapturedTypeConstructor(): Boolean + fun TypeConstructorMarker.isTypeParameterTypeConstructor(): Boolean + fun Collection.singleBestRepresentative(): KotlinTypeMarker? fun KotlinTypeMarker.isUnit(): Boolean diff --git a/core/descriptors/src/org/jetbrains/kotlin/types/checker/ClassicTypeSystemContext.kt b/core/descriptors/src/org/jetbrains/kotlin/types/checker/ClassicTypeSystemContext.kt index d424fe9d778..fa3f585b72e 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/types/checker/ClassicTypeSystemContext.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/types/checker/ClassicTypeSystemContext.kt @@ -11,6 +11,7 @@ import org.jetbrains.kotlin.descriptors.* import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor import org.jetbrains.kotlin.descriptors.annotations.Annotations import org.jetbrains.kotlin.descriptors.annotations.BuiltInAnnotationDescriptor +import org.jetbrains.kotlin.descriptors.impl.AbstractTypeParameterDescriptor import org.jetbrains.kotlin.name.FqName import org.jetbrains.kotlin.name.FqNameUnsafe import org.jetbrains.kotlin.name.Name @@ -573,6 +574,10 @@ interface ClassicTypeSystemContext : TypeSystemInferenceExtensionContext, TypeSy return this is NewCapturedTypeConstructor } + override fun TypeConstructorMarker.isTypeParameterTypeConstructor(): Boolean { + return this is AbstractTypeConstructor && this.declarationDescriptor is AbstractTypeParameterDescriptor + } + override fun arrayType(componentType: KotlinTypeMarker): SimpleTypeMarker { require(componentType is KotlinType, this::errorMessage) return builtIns.getArrayType(Variance.INVARIANT, componentType) From a89fe90043a1aad545ecfd18ccb73295be86a94d Mon Sep 17 00:00:00 2001 From: Ilya Goncharov Date: Tue, 19 Jan 2021 14:32:37 +0300 Subject: [PATCH 009/212] [JS IR] Add test on exportable overriden method ^KT-44415 fixed --- .../semantics/IrBoxJsES6TestGenerated.java | 5 ++++ .../ir/semantics/IrBoxJsTestGenerated.java | 5 ++++ .../js/test/semantics/BoxJsTestGenerated.java | 5 ++++ .../testData/box/export/overridenMethod.kt | 27 +++++++++++++++++++ 4 files changed, 42 insertions(+) create mode 100644 js/js.translator/testData/box/export/overridenMethod.kt diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrBoxJsES6TestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrBoxJsES6TestGenerated.java index af044a740bd..766f3af1e52 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrBoxJsES6TestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrBoxJsES6TestGenerated.java @@ -1622,6 +1622,11 @@ public class IrBoxJsES6TestGenerated extends AbstractIrBoxJsES6Test { runTest("js/js.translator/testData/box/export/nonIndetifierModuleName.kt"); } + @TestMetadata("overridenMethod.kt") + public void testOverridenMethod() throws Exception { + runTest("js/js.translator/testData/box/export/overridenMethod.kt"); + } + @TestMetadata("reservedModuleName.kt") public void testReservedModuleName() throws Exception { runTest("js/js.translator/testData/box/export/reservedModuleName.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrBoxJsTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrBoxJsTestGenerated.java index 0a4d53b5d16..0f8ae44fe07 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrBoxJsTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrBoxJsTestGenerated.java @@ -1622,6 +1622,11 @@ public class IrBoxJsTestGenerated extends AbstractIrBoxJsTest { runTest("js/js.translator/testData/box/export/nonIndetifierModuleName.kt"); } + @TestMetadata("overridenMethod.kt") + public void testOverridenMethod() throws Exception { + runTest("js/js.translator/testData/box/export/overridenMethod.kt"); + } + @TestMetadata("reservedModuleName.kt") public void testReservedModuleName() throws Exception { runTest("js/js.translator/testData/box/export/reservedModuleName.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/BoxJsTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/BoxJsTestGenerated.java index 304d497b667..4c672f1dcaa 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/BoxJsTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/BoxJsTestGenerated.java @@ -1627,6 +1627,11 @@ public class BoxJsTestGenerated extends AbstractBoxJsTest { runTest("js/js.translator/testData/box/export/nonIndetifierModuleName.kt"); } + @TestMetadata("overridenMethod.kt") + public void testOverridenMethod() throws Exception { + runTest("js/js.translator/testData/box/export/overridenMethod.kt"); + } + @TestMetadata("reservedModuleName.kt") public void testReservedModuleName() throws Exception { runTest("js/js.translator/testData/box/export/reservedModuleName.kt"); diff --git a/js/js.translator/testData/box/export/overridenMethod.kt b/js/js.translator/testData/box/export/overridenMethod.kt new file mode 100644 index 00000000000..8f9d5e4658b --- /dev/null +++ b/js/js.translator/testData/box/export/overridenMethod.kt @@ -0,0 +1,27 @@ +abstract class Foo1 { + abstract fun ok(): String +} + +@JsExport +class Bar1 : Foo1() { + override fun ok(): String { + return "OK" + } +} + +open class Foo2 { + open fun ok(): String { + return "fail" + } +} + +@JsExport +class Bar2 : Foo2() { + override fun ok(): String { + return "OK" + } +} + +fun box(): String { + return if (Bar1().ok() == "OK" && Bar2().ok() == "OK") "OK" else "fail" +} \ No newline at end of file From 57fdabdacee20e383b1637ac8c5b6d49b521358b Mon Sep 17 00:00:00 2001 From: Ilya Goncharov Date: Tue, 19 Jan 2021 19:04:56 +0300 Subject: [PATCH 010/212] [JS IR] Add BRIDGE origin as ignore for stabitility of names ^KT-44415 fixed --- .../src/org/jetbrains/kotlin/ir/backend/js/utils/misc.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/misc.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/misc.kt index 31524f91039..7fe38e66a0e 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/misc.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/misc.kt @@ -10,12 +10,11 @@ import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET import org.jetbrains.kotlin.ir.backend.js.JsIrBackendContext import org.jetbrains.kotlin.ir.backend.js.JsLoweredDeclarationOrigin import org.jetbrains.kotlin.ir.declarations.* -import org.jetbrains.kotlin.ir.expressions.* +import org.jetbrains.kotlin.ir.expressions.IrExpression import org.jetbrains.kotlin.ir.expressions.impl.IrCallImpl import org.jetbrains.kotlin.ir.expressions.impl.IrVarargImpl import org.jetbrains.kotlin.ir.types.IrType import org.jetbrains.kotlin.ir.types.isNullableAny -import org.jetbrains.kotlin.ir.types.isUnit import org.jetbrains.kotlin.ir.util.isEffectivelyExternal import org.jetbrains.kotlin.ir.util.isTopLevelDeclaration import org.jetbrains.kotlin.ir.util.parentClassOrNull @@ -26,7 +25,8 @@ fun TODO(element: IrElement): Nothing = TODO(element::class.java.simpleName + " fun IrFunction.hasStableJsName(): Boolean { if ( origin == JsLoweredDeclarationOrigin.JS_SHADOWED_EXPORT || - origin == IrDeclarationOrigin.FUNCTION_FOR_DEFAULT_PARAMETER + origin == IrDeclarationOrigin.FUNCTION_FOR_DEFAULT_PARAMETER || + origin == IrDeclarationOrigin.BRIDGE ) { return false } From aa1e23d9b01be41571bcfc0fdbd047d8dd8d0398 Mon Sep 17 00:00:00 2001 From: Ilya Goncharov Date: Wed, 20 Jan 2021 17:58:40 +0300 Subject: [PATCH 011/212] [JS IR] Use origins for bridge with and without stable names ^KT-44415 fixed --- .../kotlin/ir/backend/js/DeclarationOrigins.kt | 3 ++- .../ir/backend/js/export/ExportModelGenerator.kt | 4 ++-- .../kotlin/ir/backend/js/lower/BridgesConstruction.kt | 4 ++-- .../jetbrains/kotlin/ir/backend/js/utils/NameTables.kt | 8 +------- .../org/jetbrains/kotlin/ir/backend/js/utils/misc.kt | 10 +++++++++- 5 files changed, 16 insertions(+), 13 deletions(-) diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/DeclarationOrigins.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/DeclarationOrigins.kt index 9c4114ee4b0..f15d2d938a5 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/DeclarationOrigins.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/DeclarationOrigins.kt @@ -13,7 +13,8 @@ object JsLoweredDeclarationOrigin : IrDeclarationOrigin { object JS_INTRINSICS_STUB : IrDeclarationOriginImpl("JS_INTRINSICS_STUB") object JS_CLOSURE_BOX_CLASS : IrStatementOriginImpl("JS_CLOSURE_BOX_CLASS") object JS_CLOSURE_BOX_CLASS_DECLARATION : IrDeclarationOriginImpl("JS_CLOSURE_BOX_CLASS_DECLARATION") - object BRIDGE_TO_EXTERNAL_FUNCTION : IrDeclarationOriginImpl("BRIDGE_TO_EXTERNAL_FUNCTION") + object BRIDGE_WITH_STABLE_NAME : IrDeclarationOriginImpl("BRIDGE_WITH_STABLE_NAME") + object BRIDGE_WITHOUT_STABLE_NAME : IrDeclarationOriginImpl("BRIDGE_WITHOUT_STABLE_NAME") object OBJECT_GET_INSTANCE_FUNCTION : IrDeclarationOriginImpl("OBJECT_GET_INSTANCE_FUNCTION") object JS_SHADOWED_EXPORT : IrDeclarationOriginImpl("JS_SHADOWED_EXPORT") } diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/export/ExportModelGenerator.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/export/ExportModelGenerator.kt index ef165e3d569..c38d763aa0e 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/export/ExportModelGenerator.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/export/ExportModelGenerator.kt @@ -324,8 +324,8 @@ class ExportModelGenerator(val context: JsIrBackendContext) { return Exportability.Prohibited("Suspend function") if (function.isFakeOverride) return Exportability.NotNeeded - if (function.origin == IrDeclarationOrigin.BRIDGE || - function.origin == JsLoweredDeclarationOrigin.BRIDGE_TO_EXTERNAL_FUNCTION || + if (function.origin == JsLoweredDeclarationOrigin.BRIDGE_WITHOUT_STABLE_NAME || + function.origin == JsLoweredDeclarationOrigin.BRIDGE_WITH_STABLE_NAME || function.origin == IrDeclarationOrigin.FUNCTION_FOR_DEFAULT_PARAMETER || function.origin == JsLoweredDeclarationOrigin.OBJECT_GET_INSTANCE_FUNCTION || function.origin == JsLoweredDeclarationOrigin.JS_SHADOWED_EXPORT diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/BridgesConstruction.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/BridgesConstruction.kt index da3b4300a67..ecf0b310afa 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/BridgesConstruction.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/BridgesConstruction.kt @@ -117,9 +117,9 @@ abstract class BridgesConstruction(val context: JsCommonBackendContext) : Declar val origin = if (bridge.hasStableJsName()) - JsLoweredDeclarationOrigin.BRIDGE_TO_EXTERNAL_FUNCTION + JsLoweredDeclarationOrigin.BRIDGE_WITH_STABLE_NAME else - IrDeclarationOrigin.BRIDGE + JsLoweredDeclarationOrigin.BRIDGE_WITHOUT_STABLE_NAME // TODO: Support offsets for debug info val irFunction = context.irFactory.buildFun { diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/NameTables.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/NameTables.kt index 631068d6826..3bf7300153e 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/NameTables.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/NameTables.kt @@ -5,10 +5,8 @@ package org.jetbrains.kotlin.ir.backend.js.utils -import org.jetbrains.kotlin.backend.common.ir.isMethodOfAny import org.jetbrains.kotlin.backend.common.ir.isTopLevel import org.jetbrains.kotlin.ir.IrElement -import org.jetbrains.kotlin.ir.backend.js.JsLoweredDeclarationOrigin import org.jetbrains.kotlin.ir.backend.js.lower.serialization.ir.JsManglerIr import org.jetbrains.kotlin.ir.declarations.* import org.jetbrains.kotlin.ir.expressions.IrBreak @@ -113,11 +111,7 @@ fun jsFunctionSignature(declaration: IrFunction): Signature { val declarationName = declaration.getJsNameOrKotlinName().asString() - val needsStableName = declaration.origin == JsLoweredDeclarationOrigin.BRIDGE_TO_EXTERNAL_FUNCTION || - declaration.hasStableJsName() || - (declaration as? IrSimpleFunction)?.isMethodOfAny() == true // Handle names for special functions - - if (needsStableName) { + if (declaration.hasStableJsName()) { return StableNameSignature(declarationName) } diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/misc.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/misc.kt index 7fe38e66a0e..010d91cc531 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/misc.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/misc.kt @@ -5,6 +5,7 @@ package org.jetbrains.kotlin.ir.backend.js.utils +import org.jetbrains.kotlin.backend.common.ir.isMethodOfAny import org.jetbrains.kotlin.ir.IrElement import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET import org.jetbrains.kotlin.ir.backend.js.JsIrBackendContext @@ -23,10 +24,17 @@ import org.jetbrains.kotlin.name.Name fun TODO(element: IrElement): Nothing = TODO(element::class.java.simpleName + " is not supported yet here") fun IrFunction.hasStableJsName(): Boolean { + if ( + origin == JsLoweredDeclarationOrigin.BRIDGE_WITH_STABLE_NAME || + (this as? IrSimpleFunction)?.isMethodOfAny() == true // Handle names for special functions + ) { + return true + } + if ( origin == JsLoweredDeclarationOrigin.JS_SHADOWED_EXPORT || origin == IrDeclarationOrigin.FUNCTION_FOR_DEFAULT_PARAMETER || - origin == IrDeclarationOrigin.BRIDGE + origin == JsLoweredDeclarationOrigin.BRIDGE_WITHOUT_STABLE_NAME ) { return false } From 1654dfb3bf4c53bd5f1a4aaad5101e4bdd70f9be Mon Sep 17 00:00:00 2001 From: scaventz Date: Wed, 20 Jan 2021 09:59:25 +0800 Subject: [PATCH 012/212] Upgrade Apache Ant dependency to 1.10.7 --- build.gradle.kts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 3b44f0ece96..7deaf9ab474 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -166,13 +166,12 @@ extra["versions.jansi"] = "1.16" extra["versions.jline"] = "3.3.1" extra["versions.junit"] = "4.12" extra["versions.javaslang"] = "2.0.6" -extra["versions.ant"] = "1.8.2" +extra["versions.ant"] = "1.10.7" extra["versions.android"] = "2.3.1" extra["versions.kotlinx-coroutines-core"] = "1.3.8" extra["versions.kotlinx-coroutines-jdk8"] = "1.3.8" extra["versions.json"] = "20160807" extra["versions.native-platform"] = "0.14" -extra["versions.ant-launcher"] = "1.8.0" extra["versions.robolectric"] = "4.0" extra["versions.org.springframework"] = "4.2.0.RELEASE" extra["versions.jflex"] = "1.7.0" From c111c3395082d93c6831e94e9a7001fbea3e36a6 Mon Sep 17 00:00:00 2001 From: Victor Petukhov Date: Mon, 25 Jan 2021 16:14:25 +0300 Subject: [PATCH 013/212] Fix failing tests after 8bd78064be4f2bfb671e5e0c6c04b216ff55e16a --- .../tests/jsr305/nullabilityWarnings/nullabilityGenerics.kt | 2 +- .../nullability/callExternallyAnnotatedJavaFunction.kt | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/nullabilityGenerics.kt b/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/nullabilityGenerics.kt index eec05644e1f..e56fd38df52 100644 --- a/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/nullabilityGenerics.kt +++ b/compiler/testData/foreignAnnotations/tests/jsr305/nullabilityWarnings/nullabilityGenerics.kt @@ -29,7 +29,7 @@ class X(t: T?) { a.foo(t) val x: T = a.bam() - val y: T = a.baz() + val y: T = a.baz() } } diff --git a/nj2k/testData/inference/nullability/callExternallyAnnotatedJavaFunction.kt b/nj2k/testData/inference/nullability/callExternallyAnnotatedJavaFunction.kt index b7484f11f83..7bc793a4861 100644 --- a/nj2k/testData/inference/nullability/callExternallyAnnotatedJavaFunction.kt +++ b/nj2k/testData/inference/nullability/callExternallyAnnotatedJavaFunction.kt @@ -1,11 +1,10 @@ import java.util.Arrays.asList fun test() { - val x: /*T2@*/List = asList(1/*LIT*/)/*MutableList!!L*/ + val x: /*T2@*/List = asList(1/*LIT*/)/*MutableList*/ val i: /*T3@*/Int = Integer/*LIT*/.valueOf(""/*LIT*/)/*Int!!L*/ } //LOWER <: T0 due to 'PARAMETER' //T1 := T0 due to 'INITIALIZER' -//LOWER <: T2 due to 'INITIALIZER' //LOWER <: T3 due to 'INITIALIZER' From 42f9442728f023ced1512cf5cfe4f8d1305c760b Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Fri, 22 Jan 2021 12:34:56 +0300 Subject: [PATCH 014/212] [Test] Handle any Throwable from test instead of AssertionError --- .../tests/org/jetbrains/kotlin/test/Assertions.kt | 2 +- .../jetbrains/kotlin/test/ExceptionFromTestError.kt | 3 +++ .../tests/org/jetbrains/kotlin/test/TestRunner.kt | 7 ++++--- .../kotlin/test/model/AfterAnalysisChecker.kt | 4 ++-- .../kotlin/test/backend/BlackBoxCodegenSuppressor.kt | 10 +++++----- .../backend/handlers/FirIrDumpIdenticalCheckers.kt | 2 +- .../classic/handlers/FirTestDataConsistencyHandler.kt | 2 +- .../test/frontend/fir/FirFailingTestSuppressor.kt | 2 +- .../test/frontend/fir/handlers/FirIdenticalChecker.kt | 2 +- .../jetbrains/kotlin/test/services/JUnit5Assertions.kt | 2 +- .../org/jetbrains/kotlin/test/util/JUnit4Assertions.kt | 2 +- 11 files changed, 21 insertions(+), 17 deletions(-) diff --git a/compiler/test-infrastructure-utils/tests/org/jetbrains/kotlin/test/Assertions.kt b/compiler/test-infrastructure-utils/tests/org/jetbrains/kotlin/test/Assertions.kt index 28b58934b85..349f47219e6 100644 --- a/compiler/test-infrastructure-utils/tests/org/jetbrains/kotlin/test/Assertions.kt +++ b/compiler/test-infrastructure-utils/tests/org/jetbrains/kotlin/test/Assertions.kt @@ -44,7 +44,7 @@ abstract class Assertions { return collection.joinToString("\n") } - abstract fun assertAll(exceptions: List) + abstract fun assertAll(exceptions: List) abstract fun fail(message: () -> String): Nothing } diff --git a/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/ExceptionFromTestError.kt b/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/ExceptionFromTestError.kt index 91b2f7330b5..5e0a80e446b 100644 --- a/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/ExceptionFromTestError.kt +++ b/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/ExceptionFromTestError.kt @@ -8,4 +8,7 @@ package org.jetbrains.kotlin.test class ExceptionFromTestError(cause: Throwable) : AssertionError(cause) { override val message: String get() = "Exception was thrown" + + override val cause: Throwable + get() = super.cause!! } diff --git a/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/TestRunner.kt b/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/TestRunner.kt index 7a1332471ff..7c60db6d9b8 100644 --- a/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/TestRunner.kt +++ b/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/TestRunner.kt @@ -12,7 +12,7 @@ import org.jetbrains.kotlin.test.services.* import java.io.IOException class TestRunner(private val testConfiguration: TestConfiguration) { - private val failedAssertions = mutableListOf() + private val failedAssertions = mutableListOf() fun runTest(@TestDataFile testDataFileName: String) { try { @@ -79,9 +79,10 @@ class TestRunner(private val testConfiguration: TestConfiguration) { } val filteredFailedAssertions = testConfiguration.afterAnalysisCheckers - .fold>(failedAssertions) { assertions, checker -> + .fold>(failedAssertions) { assertions, checker -> checker.suppressIfNeeded(assertions) } + .map { if (it is ExceptionFromTestError) it.cause else it } services.assertions.assertAll(filteredFailedAssertions) } @@ -134,7 +135,7 @@ class TestRunner(private val testConfiguration: TestConfiguration) { private inline fun withAssertionCatching(insertExceptionInStart: Boolean = false, block: () -> Unit) { try { block() - } catch (e: AssertionError) { + } catch (e: Throwable) { if (insertExceptionInStart) { failedAssertions.add(0, e) } else { diff --git a/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/model/AfterAnalysisChecker.kt b/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/model/AfterAnalysisChecker.kt index 52ec8c4e69d..8cca687e6e5 100644 --- a/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/model/AfterAnalysisChecker.kt +++ b/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/model/AfterAnalysisChecker.kt @@ -12,7 +12,7 @@ abstract class AfterAnalysisChecker(protected val testServices: TestServices) { open val directives: List get() = emptyList() - open fun check(failedAssertions: List) {} + open fun check(failedAssertions: List) {} - open fun suppressIfNeeded(failedAssertions: List): List = failedAssertions + open fun suppressIfNeeded(failedAssertions: List): List = failedAssertions } diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/BlackBoxCodegenSuppressor.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/BlackBoxCodegenSuppressor.kt index 33be898c94d..8f6388c5efd 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/BlackBoxCodegenSuppressor.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/BlackBoxCodegenSuppressor.kt @@ -22,7 +22,7 @@ class BlackBoxCodegenSuppressor(testServices: TestServices) : AfterAnalysisCheck override val directives: List get() = listOf(CodegenTestDirectives) - override fun suppressIfNeeded(failedAssertions: List): List { + override fun suppressIfNeeded(failedAssertions: List): List { val moduleStructure = testServices.moduleStructure val targetBackends = moduleStructure.modules.mapNotNull { it.targetBackend } return when (moduleStructure.modules.map { it.frontendKind }.first()) { @@ -36,8 +36,8 @@ class BlackBoxCodegenSuppressor(testServices: TestServices) : AfterAnalysisCheck moduleStructure: TestModuleStructure, directive: ValueDirective, targetBackends: List, - failedAssertions: List - ): List { + failedAssertions: List + ): List { val ignoredBackends = moduleStructure.allDirectives[directive] if (ignoredBackends.isEmpty()) return failedAssertions val matchedBackend = ignoredBackends.intersect(targetBackends) @@ -52,10 +52,10 @@ class BlackBoxCodegenSuppressor(testServices: TestServices) : AfterAnalysisCheck private fun processAssertions( - failedAssertions: List, + failedAssertions: List, directive: ValueDirective, additionalMessage: String = "" - ): List { + ): List { return if (failedAssertions.isNotEmpty()) emptyList() else { val message = buildString { diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/FirIrDumpIdenticalCheckers.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/FirIrDumpIdenticalCheckers.kt index 23e719d6ca7..89a93d9c695 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/FirIrDumpIdenticalCheckers.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/FirIrDumpIdenticalCheckers.kt @@ -39,7 +39,7 @@ class FirIrDumpIdenticalChecker(testServices: TestServices) : AfterAnalysisCheck } } - override fun check(failedAssertions: List) { + override fun check(failedAssertions: List) { if (failedAssertions.isNotEmpty()) return val testDataFile = testServices.moduleStructure.originalTestDataFiles.first() if (FIR_IDENTICAL in testServices.moduleStructure.allDirectives) { diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/classic/handlers/FirTestDataConsistencyHandler.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/classic/handlers/FirTestDataConsistencyHandler.kt index fc1628bf56a..7c85ad66ac0 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/classic/handlers/FirTestDataConsistencyHandler.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/classic/handlers/FirTestDataConsistencyHandler.kt @@ -21,7 +21,7 @@ class FirTestDataConsistencyHandler(testServices: TestServices) : AfterAnalysisC override val directives: List get() = listOf(FirDiagnosticsDirectives) - override fun check(failedAssertions: List) { + override fun check(failedAssertions: List) { val moduleStructure = testServices.moduleStructure val testData = moduleStructure.originalTestDataFiles.first() if (testData.extension == "kts") return diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/FirFailingTestSuppressor.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/FirFailingTestSuppressor.kt index dc8b4b787f0..1eafe5222a1 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/FirFailingTestSuppressor.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/FirFailingTestSuppressor.kt @@ -11,7 +11,7 @@ import org.jetbrains.kotlin.test.services.TestServices import org.jetbrains.kotlin.test.services.moduleStructure class FirFailingTestSuppressor(testServices: TestServices) : AfterAnalysisChecker(testServices) { - override fun suppressIfNeeded(failedAssertions: List): List { + override fun suppressIfNeeded(failedAssertions: List): List { val testFile = testServices.moduleStructure.originalTestDataFiles.first() val failFile = testFile.parentFile.resolve("${testFile.nameWithoutExtension}.fail") val exceptionFromFir = failedAssertions.firstOrNull { it is ExceptionFromTestError } diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/handlers/FirIdenticalChecker.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/handlers/FirIdenticalChecker.kt index d080ddbef6f..b3008bcdf96 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/handlers/FirIdenticalChecker.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/handlers/FirIdenticalChecker.kt @@ -25,7 +25,7 @@ class FirIdenticalChecker(testServices: TestServices) : AfterAnalysisChecker(tes } } - override fun check(failedAssertions: List) { + override fun check(failedAssertions: List) { if (failedAssertions.isNotEmpty()) return val testDataFile = testServices.moduleStructure.originalTestDataFiles.first() if (testDataFile.isFirTestData) { diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/JUnit5Assertions.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/JUnit5Assertions.kt index 3596f788b2a..2b9b75dc273 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/JUnit5Assertions.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/JUnit5Assertions.kt @@ -51,7 +51,7 @@ object JUnit5Assertions : AssertionsService() { JUnit5PlatformAssertions.assertFalse(value, message?.invoke()) } - override fun assertAll(exceptions: List) { + override fun assertAll(exceptions: List) { exceptions.singleOrNull()?.let { throw it } JUnit5PlatformAssertions.assertAll(exceptions.map { Executable { throw it } }) } diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/test/util/JUnit4Assertions.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/test/util/JUnit4Assertions.kt index 921e830fe6e..ab6845daf1a 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/test/util/JUnit4Assertions.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/test/util/JUnit4Assertions.kt @@ -40,7 +40,7 @@ object JUnit4Assertions : Assertions() { KtUsefulTestCase.assertSameElements(message?.invoke() ?: "", expected, actual) } - override fun assertAll(exceptions: List) { + override fun assertAll(exceptions: List) { exceptions.forEach { throw it } } From 5490689fea4ac02479dbe054239d1aa6f13d97f1 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Fri, 22 Jan 2021 12:52:52 +0300 Subject: [PATCH 015/212] [Test] Add ability to disable specific handler if there was an error from previous one --- .../org/jetbrains/kotlin/test/TestRunner.kt | 28 ++++++++++++++++--- .../kotlin/test/model/AnalysisHandler.kt | 20 ++++++++----- .../backend/handlers/AbstractIrHandler.kt | 5 +++- .../handlers/BinaryArtifactHandlers.kt | 27 ++++++++++++++---- .../test/backend/handlers/DxCheckerHandler.kt | 2 +- .../test/backend/handlers/JvmBoxRunner.kt | 2 +- .../ClassicFrontendAnalysisHandler.kt | 9 ++++-- .../fir/handlers/FirAnalysisHandler.kt | 5 ++-- 8 files changed, 74 insertions(+), 24 deletions(-) diff --git a/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/TestRunner.kt b/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/TestRunner.kt index 7c60db6d9b8..e5f6dba88e4 100644 --- a/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/TestRunner.kt +++ b/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/TestRunner.kt @@ -60,8 +60,14 @@ class TestRunner(private val testConfiguration: TestConfiguration) { } catch (e: Throwable) { failedException = e } + for (handler in testConfiguration.getAllHandlers()) { - withAssertionCatching { handler.processAfterAllModules(failedAssertions.isNotEmpty()) } + withAssertionCatching { + val thereWasAnException = failedException != null || failedAssertions.isNotEmpty() + if (handler.shouldRun(thereWasAnException)) { + handler.processAfterAllModules(thereWasAnException) + } + } } if (testConfiguration.metaInfoHandlerEnabled) { withAssertionCatching(insertExceptionInStart = true) { @@ -103,7 +109,9 @@ class TestRunner(private val testConfiguration: TestConfiguration) { val frontendHandlers: List> = testConfiguration.getHandlers(frontendKind) for (frontendHandler in frontendHandlers) { withAssertionCatching { - frontendHandler.hackyProcess(module, frontendArtifacts) + if (frontendHandler.shouldRun(failedAssertions.isNotEmpty())) { + frontendHandler.hackyProcess(module, frontendArtifacts) + } } } @@ -115,7 +123,11 @@ class TestRunner(private val testConfiguration: TestConfiguration) { val backendHandlers: List> = testConfiguration.getHandlers(backendKind) for (backendHandler in backendHandlers) { - withAssertionCatching { backendHandler.hackyProcess(module, backendInputInfo) } + withAssertionCatching { + if (backendHandler.shouldRun(failedAssertions.isNotEmpty())) { + backendHandler.hackyProcess(module, backendInputInfo) + } + } } for (artifactKind in moduleStructure.getTargetArtifactKinds(module)) { @@ -127,7 +139,11 @@ class TestRunner(private val testConfiguration: TestConfiguration) { val binaryHandlers: List> = testConfiguration.getHandlers(artifactKind) for (binaryHandler in binaryHandlers) { - withAssertionCatching { binaryHandler.hackyProcess(module, binaryArtifact) } + withAssertionCatching { + if (binaryHandler.shouldRun(failedAssertions.isNotEmpty())) { + binaryHandler.hackyProcess(module, binaryArtifact) + } + } } } } @@ -143,6 +159,10 @@ class TestRunner(private val testConfiguration: TestConfiguration) { } } } + + private fun AnalysisHandler<*>.shouldRun(thereWasAnException: Boolean): Boolean { + return !(doNotRunIfThereWerePreviousFailures && thereWasAnException) + } } // ---------------------------------------------------------------------------------------------------------------- diff --git a/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/model/AnalysisHandler.kt b/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/model/AnalysisHandler.kt index cb394e4da06..a9b7a4907da 100644 --- a/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/model/AnalysisHandler.kt +++ b/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/model/AnalysisHandler.kt @@ -11,7 +11,10 @@ import org.jetbrains.kotlin.test.services.ServiceRegistrationData import org.jetbrains.kotlin.test.services.TestServices import org.jetbrains.kotlin.test.services.assertions -abstract class AnalysisHandler>(val testServices: TestServices) { +abstract class AnalysisHandler>( + val testServices: TestServices, + val doNotRunIfThereWerePreviousFailures: Boolean +) { protected val assertions: Assertions get() = testServices.assertions @@ -30,15 +33,18 @@ abstract class AnalysisHandler>(val testServices: TestS abstract class FrontendOutputHandler>( testServices: TestServices, - override val artifactKind: FrontendKind -) : AnalysisHandler(testServices) + override val artifactKind: FrontendKind, + doNotRunIfThereWerePreviousFailures: Boolean +) : AnalysisHandler(testServices, doNotRunIfThereWerePreviousFailures) abstract class BackendInputHandler>( testServices: TestServices, - override val artifactKind: BackendKind -) : AnalysisHandler(testServices) + override val artifactKind: BackendKind, + doNotRunIfThereWerePreviousFailures: Boolean +) : AnalysisHandler(testServices, doNotRunIfThereWerePreviousFailures) abstract class BinaryArtifactHandler>( testServices: TestServices, - override val artifactKind: BinaryKind -) : AnalysisHandler(testServices) + override val artifactKind: BinaryKind, + doNotRunIfThereWerePreviousFailures: Boolean +) : AnalysisHandler(testServices, doNotRunIfThereWerePreviousFailures) diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/AbstractIrHandler.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/AbstractIrHandler.kt index bc259a5f85b..ddfb1a5606d 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/AbstractIrHandler.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/AbstractIrHandler.kt @@ -10,4 +10,7 @@ import org.jetbrains.kotlin.test.model.BackendInputHandler import org.jetbrains.kotlin.test.model.BackendKinds import org.jetbrains.kotlin.test.services.TestServices -abstract class AbstractIrHandler(testServices: TestServices) : BackendInputHandler(testServices, BackendKinds.IrBackend) +abstract class AbstractIrHandler( + testServices: TestServices, + doNotRunIfThereWerePreviousFailures: Boolean = false +) : BackendInputHandler(testServices, BackendKinds.IrBackend, doNotRunIfThereWerePreviousFailures) diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/BinaryArtifactHandlers.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/BinaryArtifactHandlers.kt index 930fd0967c7..2ae59632869 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/BinaryArtifactHandlers.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/BinaryArtifactHandlers.kt @@ -11,13 +11,28 @@ import org.jetbrains.kotlin.test.model.BinaryArtifacts import org.jetbrains.kotlin.test.services.TestServices abstract class JvmBinaryArtifactHandler( - testServices: TestServices -) : BinaryArtifactHandler(testServices, ArtifactKinds.Jvm) + testServices: TestServices, + doNotRunIfThereWerePreviousFailures: Boolean = false +) : BinaryArtifactHandler( + testServices, + ArtifactKinds.Jvm, + doNotRunIfThereWerePreviousFailures +) abstract class JsBinaryArtifactHandler( - testServices: TestServices -) : BinaryArtifactHandler(testServices, ArtifactKinds.Js) + testServices: TestServices, + doNotRunIfThereWerePreviousFailures: Boolean = false +) : BinaryArtifactHandler( + testServices, + ArtifactKinds.Js, + doNotRunIfThereWerePreviousFailures +) abstract class NativeBinaryArtifactHandler( - testServices: TestServices -) : BinaryArtifactHandler(testServices, ArtifactKinds.Native) + testServices: TestServices, + doNotRunIfThereWerePreviousFailures: Boolean = false +) : BinaryArtifactHandler( + testServices, + ArtifactKinds.Native, + doNotRunIfThereWerePreviousFailures +) diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/DxCheckerHandler.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/DxCheckerHandler.kt index be430c376d7..29cc5360493 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/DxCheckerHandler.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/DxCheckerHandler.kt @@ -15,7 +15,7 @@ import org.jetbrains.kotlin.test.model.BinaryArtifacts import org.jetbrains.kotlin.test.model.TestModule import org.jetbrains.kotlin.test.services.TestServices -class DxCheckerHandler(testServices: TestServices) : JvmBinaryArtifactHandler(testServices) { +class DxCheckerHandler(testServices: TestServices) : JvmBinaryArtifactHandler(testServices, doNotRunIfThereWerePreviousFailures = true) { override val directivesContainers: List get() = listOf(CodegenTestDirectives) diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/JvmBoxRunner.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/JvmBoxRunner.kt index 9cbf73360da..241a386ba7a 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/JvmBoxRunner.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/JvmBoxRunner.kt @@ -26,7 +26,7 @@ import org.jetbrains.kotlin.utils.addToStdlib.runIf import java.lang.reflect.Method import java.net.URLClassLoader -class JvmBoxRunner(testServices: TestServices) : JvmBinaryArtifactHandler(testServices) { +class JvmBoxRunner(testServices: TestServices) : JvmBinaryArtifactHandler(testServices, doNotRunIfThereWerePreviousFailures = true) { companion object { private val BOX_IN_SEPARATE_PROCESS_PORT = System.getProperty("kotlin.test.box.in.separate.process.port") } diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/classic/handlers/ClassicFrontendAnalysisHandler.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/classic/handlers/ClassicFrontendAnalysisHandler.kt index 3d2be8420f2..7be2d8574b2 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/classic/handlers/ClassicFrontendAnalysisHandler.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/classic/handlers/ClassicFrontendAnalysisHandler.kt @@ -11,7 +11,12 @@ import org.jetbrains.kotlin.test.model.FrontendOutputHandler import org.jetbrains.kotlin.test.services.TestServices abstract class ClassicFrontendAnalysisHandler( - testServices: TestServices -) : FrontendOutputHandler(testServices, FrontendKinds.ClassicFrontend) + testServices: TestServices, + doNotRunIfThereWerePreviousFailures: Boolean = false +) : FrontendOutputHandler( + testServices, + FrontendKinds.ClassicFrontend, + doNotRunIfThereWerePreviousFailures +) diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/handlers/FirAnalysisHandler.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/handlers/FirAnalysisHandler.kt index a8305f22940..f6026ff0ba8 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/handlers/FirAnalysisHandler.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/handlers/FirAnalysisHandler.kt @@ -12,8 +12,9 @@ import org.jetbrains.kotlin.test.services.TestServices import java.io.File abstract class FirAnalysisHandler( - testServices: TestServices -) : FrontendOutputHandler(testServices, FrontendKinds.FIR) { + testServices: TestServices, + doNotRunIfThereWerePreviousFailures: Boolean = false +) : FrontendOutputHandler(testServices, FrontendKinds.FIR, doNotRunIfThereWerePreviousFailures) { protected val File.nameWithoutFirExtension: String get() = nameWithoutExtension.removeSuffix(".fir") } From 7d4adaba21fac26c634d8b33f5176c9bb0177724 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Fri, 22 Jan 2021 14:25:56 +0300 Subject: [PATCH 016/212] [Test] Add ability to simply declaring mapping between directives and configuration keys --- .../test/services/EnvironmentConfigurator.kt | 57 ++++++++++++++++++- .../services/CompilerConfigurationProvider.kt | 2 +- 2 files changed, 55 insertions(+), 4 deletions(-) diff --git a/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/services/EnvironmentConfigurator.kt b/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/services/EnvironmentConfigurator.kt index 6060c451844..cacb9169004 100644 --- a/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/services/EnvironmentConfigurator.kt +++ b/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/services/EnvironmentConfigurator.kt @@ -8,8 +8,8 @@ package org.jetbrains.kotlin.test.services import com.intellij.mock.MockProject import org.jetbrains.kotlin.config.AnalysisFlag import org.jetbrains.kotlin.config.CompilerConfiguration -import org.jetbrains.kotlin.test.directives.model.DirectivesContainer -import org.jetbrains.kotlin.test.directives.model.RegisteredDirectives +import org.jetbrains.kotlin.config.CompilerConfigurationKey +import org.jetbrains.kotlin.test.directives.model.* import org.jetbrains.kotlin.test.model.TestModule abstract class EnvironmentConfigurator(protected val testServices: TestServices) { @@ -22,9 +22,60 @@ abstract class EnvironmentConfigurator(protected val testServices: TestServices) protected val moduleStructure: TestModuleStructure get() = testServices.moduleStructure - open fun configureCompilerConfiguration(configuration: CompilerConfiguration, module: TestModule, project: MockProject) {} + protected open fun configureCompilerConfiguration(configuration: CompilerConfiguration, module: TestModule, project: MockProject) {} + + fun configureCompileConfigurationWithAdditionalConfigurationKeys( + configuration: CompilerConfiguration, + module: TestModule, + project: MockProject + ) { + configureCompilerConfiguration(configuration, module, project) + val extractor = DirectiveToConfigurationKeyExtractor() + extractor.provideConfigurationKeys() + extractor.configure(configuration, module.directives) + } + + protected open fun DirectiveToConfigurationKeyExtractor.provideConfigurationKeys() {} open fun provideAdditionalAnalysisFlags(directives: RegisteredDirectives): Map, Any?> { return emptyMap() } } + +class DirectiveToConfigurationKeyExtractor { + private val booleanDirectivesMap = mutableMapOf>() + private val invertedBooleanDirectives = mutableSetOf() + private val valueDirectivesMap = mutableMapOf, CompilerConfigurationKey<*>>() + + fun register( + directive: SimpleDirective, + key: CompilerConfigurationKey, + isInverted: Boolean = false + ) { + booleanDirectivesMap[directive] = key + if (isInverted) { + invertedBooleanDirectives += directive + } + } + + fun register( + directive: ValueDirective, + key: CompilerConfigurationKey + ) { + valueDirectivesMap[directive] = key + } + + fun configure(configuration: CompilerConfiguration, registeredDirectives: RegisteredDirectives) { + for ((directive, key) in booleanDirectivesMap) { + if (directive in registeredDirectives) { + val value = directive !in invertedBooleanDirectives + configuration.put(key, value) + } + } + for ((directive, key) in valueDirectivesMap) { + val value = registeredDirectives.singleOrZeroValue(directive) ?: continue + @Suppress("UNCHECKED_CAST") + configuration.put(key as CompilerConfigurationKey, value) + } + } +} diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/CompilerConfigurationProvider.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/CompilerConfigurationProvider.kt index 6276856ba82..929e9d5f860 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/CompilerConfigurationProvider.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/CompilerConfigurationProvider.kt @@ -104,7 +104,7 @@ class CompilerConfigurationProviderImpl( } configuration.languageVersionSettings = module.languageVersionSettings - configurators.forEach { it.configureCompilerConfiguration(configuration, module, project) } + configurators.forEach { it.configureCompileConfigurationWithAdditionalConfigurationKeys(configuration, module, project) } return configuration } From 5c0cfa87bad6109cd863be91f5749a90d7e0714b Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Fri, 22 Jan 2021 14:34:24 +0300 Subject: [PATCH 017/212] [Test] Support some jvm codegen specific configuration directives --- .../codegen/box/assert/alwaysDisable.kt | 4 ++-- .../codegen/box/assert/alwaysEnable.kt | 4 ++-- ...ssertionsEnabledBeforeClassInitializers.kt | 2 +- .../codegen/box/assert/jvm/classAssertions.kt | 2 +- .../assert/jvm/classAssertionsForCompanion.kt | 2 +- .../jvm/classAssertionsForInnerClasses.kt | 2 +- .../jvm/classAssertionsForLocalClasses.kt | 2 +- .../jvm/classAssertionsForNestedClasses.kt | 2 +- .../assert/jvm/interfaceAssertionsDisabled.kt | 2 +- .../assert/jvm/interfaceAssertionsEnabled.kt | 4 ++-- .../box/assert/jvm/lambdaNotEvaluated.kt | 2 +- .../box/assert/jvm/localAnonymousFunction.kt | 4 ++-- .../codegen/box/assert/jvm/localClass.kt | 4 ++-- .../codegen/box/assert/jvm/localFunction.kt | 4 ++-- .../codegen/box/assert/jvm/localLambda.kt | 4 ++-- .../codegen/box/assert/jvm/localObject.kt | 4 ++-- .../jvm/noUnnecessaryClassInitialization.kt | 2 +- .../codegen/box/assert/jvm/nonLocalReturn.kt | 4 ++-- .../codegen/box/assert/jvm/ordinary.kt | 4 ++-- .../box/assert/jvm/superClassInitializer.kt | 4 ++-- .../jvm/suspendFunctionAssertionDisabled.kt | 2 +- .../jvm/suspendFunctionAssertionsEnabled.kt | 2 +- .../jvm/suspendLambdaAssertionsDisabled.kt | 2 +- .../jvm/suspendLambdaAssertionsEnabled.kt | 2 +- ...onstructorCallWithDisabledNormalization.kt | 2 +- ...ConstructorCallWithEnabledNormalization.kt | 2 +- ...nConstructorCallWithStrictNormalization.kt | 2 +- ...ConstructorCallWithEnabledNormalization.kt | 4 ++-- ...loopInInlineFunWithEnabledNormalization.kt | 2 +- .../JvmEnvironmentConfigurationDirectives.kt | 22 +++++++++++++++++++ .../JvmEnvironmentConfigurator.kt | 10 +++++++++ 31 files changed, 73 insertions(+), 41 deletions(-) diff --git a/compiler/testData/codegen/box/assert/alwaysDisable.kt b/compiler/testData/codegen/box/assert/alwaysDisable.kt index 7979acc6e65..9926f1626f7 100644 --- a/compiler/testData/codegen/box/assert/alwaysDisable.kt +++ b/compiler/testData/codegen/box/assert/alwaysDisable.kt @@ -4,7 +4,7 @@ // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 // IGNORE_BACKEND: JS -// KOTLIN_CONFIGURATION_FLAGS: ASSERTIONS_MODE=always-disable +// ASSERTIONS_MODE: always-disable // WITH_RUNTIME fun checkTrue(): Boolean { @@ -42,4 +42,4 @@ fun box(): String { if (checkFalseWithMessage()) return "FAIL 3" return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/assert/alwaysEnable.kt b/compiler/testData/codegen/box/assert/alwaysEnable.kt index 33d66d70a1f..4a3c3cda612 100644 --- a/compiler/testData/codegen/box/assert/alwaysEnable.kt +++ b/compiler/testData/codegen/box/assert/alwaysEnable.kt @@ -3,7 +3,7 @@ // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 // IGNORE_BACKEND: JS -// KOTLIN_CONFIGURATION_FLAGS: ASSERTIONS_MODE=always-enable +// ASSERTIONS_MODE: always-enable // WITH_RUNTIME fun checkTrue(): Boolean { @@ -49,4 +49,4 @@ fun box(): String { } return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/assert/jvm/assertionsEnabledBeforeClassInitializers.kt b/compiler/testData/codegen/box/assert/jvm/assertionsEnabledBeforeClassInitializers.kt index b94528d63d5..e00a5e2ebb0 100644 --- a/compiler/testData/codegen/box/assert/jvm/assertionsEnabledBeforeClassInitializers.kt +++ b/compiler/testData/codegen/box/assert/jvm/assertionsEnabledBeforeClassInitializers.kt @@ -1,5 +1,5 @@ // TARGET_BACKEND: JVM -// KOTLIN_CONFIGURATION_FLAGS: ASSERTIONS_MODE=jvm +// ASSERTIONS_MODE: jvm // WITH_RUNTIME // Assertions which run before the class initializer are always checked diff --git a/compiler/testData/codegen/box/assert/jvm/classAssertions.kt b/compiler/testData/codegen/box/assert/jvm/classAssertions.kt index 0bcb3914bcd..09e216f5ca1 100644 --- a/compiler/testData/codegen/box/assert/jvm/classAssertions.kt +++ b/compiler/testData/codegen/box/assert/jvm/classAssertions.kt @@ -1,5 +1,5 @@ // TARGET_BACKEND: JVM -// KOTLIN_CONFIGURATION_FLAGS: ASSERTIONS_MODE=jvm +// ASSERTIONS_MODE: jvm // WITH_RUNTIME package classAssertions diff --git a/compiler/testData/codegen/box/assert/jvm/classAssertionsForCompanion.kt b/compiler/testData/codegen/box/assert/jvm/classAssertionsForCompanion.kt index 0b765861c84..fa665a56062 100644 --- a/compiler/testData/codegen/box/assert/jvm/classAssertionsForCompanion.kt +++ b/compiler/testData/codegen/box/assert/jvm/classAssertionsForCompanion.kt @@ -1,5 +1,5 @@ // TARGET_BACKEND: JVM -// KOTLIN_CONFIGURATION_FLAGS: ASSERTIONS_MODE=jvm +// ASSERTIONS_MODE: jvm // WITH_RUNTIME package classAssertions diff --git a/compiler/testData/codegen/box/assert/jvm/classAssertionsForInnerClasses.kt b/compiler/testData/codegen/box/assert/jvm/classAssertionsForInnerClasses.kt index 6f53cdb07b3..fc7e117e12e 100644 --- a/compiler/testData/codegen/box/assert/jvm/classAssertionsForInnerClasses.kt +++ b/compiler/testData/codegen/box/assert/jvm/classAssertionsForInnerClasses.kt @@ -1,6 +1,6 @@ // TARGET_BACKEND: JVM // IGNORE_BACKEND: JVM -// KOTLIN_CONFIGURATION_FLAGS: ASSERTIONS_MODE=jvm +// ASSERTIONS_MODE: jvm // WITH_RUNTIME package classAssertions diff --git a/compiler/testData/codegen/box/assert/jvm/classAssertionsForLocalClasses.kt b/compiler/testData/codegen/box/assert/jvm/classAssertionsForLocalClasses.kt index 96366cc33bb..24dbb4382bf 100644 --- a/compiler/testData/codegen/box/assert/jvm/classAssertionsForLocalClasses.kt +++ b/compiler/testData/codegen/box/assert/jvm/classAssertionsForLocalClasses.kt @@ -1,6 +1,6 @@ // TARGET_BACKEND: JVM // IGNORE_BACKEND: JVM -// KOTLIN_CONFIGURATION_FLAGS: ASSERTIONS_MODE=jvm +// ASSERTIONS_MODE: jvm // WITH_RUNTIME package classAssertions diff --git a/compiler/testData/codegen/box/assert/jvm/classAssertionsForNestedClasses.kt b/compiler/testData/codegen/box/assert/jvm/classAssertionsForNestedClasses.kt index 74963866c2e..6e99b08fb66 100644 --- a/compiler/testData/codegen/box/assert/jvm/classAssertionsForNestedClasses.kt +++ b/compiler/testData/codegen/box/assert/jvm/classAssertionsForNestedClasses.kt @@ -1,6 +1,6 @@ // TARGET_BACKEND: JVM // IGNORE_BACKEND: JVM -// KOTLIN_CONFIGURATION_FLAGS: ASSERTIONS_MODE=jvm +// ASSERTIONS_MODE: jvm // WITH_RUNTIME package classAssertions diff --git a/compiler/testData/codegen/box/assert/jvm/interfaceAssertionsDisabled.kt b/compiler/testData/codegen/box/assert/jvm/interfaceAssertionsDisabled.kt index 023a189eccf..50c94865b93 100644 --- a/compiler/testData/codegen/box/assert/jvm/interfaceAssertionsDisabled.kt +++ b/compiler/testData/codegen/box/assert/jvm/interfaceAssertionsDisabled.kt @@ -1,5 +1,5 @@ // TARGET_BACKEND: JVM -// KOTLIN_CONFIGURATION_FLAGS: ASSERTIONS_MODE=jvm +// ASSERTIONS_MODE: jvm // WITH_RUNTIME package interfaceAssertionsDisabled diff --git a/compiler/testData/codegen/box/assert/jvm/interfaceAssertionsEnabled.kt b/compiler/testData/codegen/box/assert/jvm/interfaceAssertionsEnabled.kt index 3878018bf55..3ce00abf86f 100644 --- a/compiler/testData/codegen/box/assert/jvm/interfaceAssertionsEnabled.kt +++ b/compiler/testData/codegen/box/assert/jvm/interfaceAssertionsEnabled.kt @@ -1,5 +1,5 @@ // TARGET_BACKEND: JVM -// KOTLIN_CONFIGURATION_FLAGS: ASSERTIONS_MODE=jvm +// ASSERTIONS_MODE: jvm // WITH_RUNTIME package interfaceAssertionsEnabled @@ -61,4 +61,4 @@ fun box(): String { } return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/assert/jvm/lambdaNotEvaluated.kt b/compiler/testData/codegen/box/assert/jvm/lambdaNotEvaluated.kt index 02c0d488a54..0f66c5ca378 100644 --- a/compiler/testData/codegen/box/assert/jvm/lambdaNotEvaluated.kt +++ b/compiler/testData/codegen/box/assert/jvm/lambdaNotEvaluated.kt @@ -1,5 +1,5 @@ // TARGET_BACKEND: JVM -// KOTLIN_CONFIGURATION_FLAGS: ASSERTIONS_MODE=jvm +// ASSERTIONS_MODE: jvm // WITH_RUNTIME // If assertions are disabled, neither argument to assert should be evaluated. diff --git a/compiler/testData/codegen/box/assert/jvm/localAnonymousFunction.kt b/compiler/testData/codegen/box/assert/jvm/localAnonymousFunction.kt index 6bcd5092ed2..337e6bcc211 100644 --- a/compiler/testData/codegen/box/assert/jvm/localAnonymousFunction.kt +++ b/compiler/testData/codegen/box/assert/jvm/localAnonymousFunction.kt @@ -1,5 +1,5 @@ // TARGET_BACKEND: JVM -// KOTLIN_CONFIGURATION_FLAGS: ASSERTIONS_MODE=jvm +// ASSERTIONS_MODE: jvm // WITH_RUNTIME package localAnonymousFunction @@ -123,4 +123,4 @@ fun box(): String { } return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/assert/jvm/localClass.kt b/compiler/testData/codegen/box/assert/jvm/localClass.kt index 6369b054fbb..aa27419f28c 100644 --- a/compiler/testData/codegen/box/assert/jvm/localClass.kt +++ b/compiler/testData/codegen/box/assert/jvm/localClass.kt @@ -1,5 +1,5 @@ // TARGET_BACKEND: JVM -// KOTLIN_CONFIGURATION_FLAGS: ASSERTIONS_MODE=jvm +// ASSERTIONS_MODE: jvm // WITH_RUNTIME package localClass @@ -163,4 +163,4 @@ fun box(): String { } return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/assert/jvm/localFunction.kt b/compiler/testData/codegen/box/assert/jvm/localFunction.kt index 79d0ee1850e..0c2c988a694 100644 --- a/compiler/testData/codegen/box/assert/jvm/localFunction.kt +++ b/compiler/testData/codegen/box/assert/jvm/localFunction.kt @@ -1,5 +1,5 @@ // TARGET_BACKEND: JVM -// KOTLIN_CONFIGURATION_FLAGS: ASSERTIONS_MODE=jvm +// ASSERTIONS_MODE: jvm // WITH_RUNTIME package localFunction @@ -123,4 +123,4 @@ fun box(): String { } return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/assert/jvm/localLambda.kt b/compiler/testData/codegen/box/assert/jvm/localLambda.kt index 8b84cdbd072..c14ede23d2b 100644 --- a/compiler/testData/codegen/box/assert/jvm/localLambda.kt +++ b/compiler/testData/codegen/box/assert/jvm/localLambda.kt @@ -1,5 +1,5 @@ // TARGET_BACKEND: JVM -// KOTLIN_CONFIGURATION_FLAGS: ASSERTIONS_MODE=jvm +// ASSERTIONS_MODE: jvm // WITH_RUNTIME package localLambda @@ -123,4 +123,4 @@ fun box(): String { } return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/assert/jvm/localObject.kt b/compiler/testData/codegen/box/assert/jvm/localObject.kt index 1d5a992e10f..6f68346bac5 100644 --- a/compiler/testData/codegen/box/assert/jvm/localObject.kt +++ b/compiler/testData/codegen/box/assert/jvm/localObject.kt @@ -1,5 +1,5 @@ // TARGET_BACKEND: JVM -// KOTLIN_CONFIGURATION_FLAGS: ASSERTIONS_MODE=jvm +// ASSERTIONS_MODE: jvm // WITH_RUNTIME package localObject @@ -155,4 +155,4 @@ fun box(): String { } return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/assert/jvm/noUnnecessaryClassInitialization.kt b/compiler/testData/codegen/box/assert/jvm/noUnnecessaryClassInitialization.kt index f7bc41fe918..9aaf1c597be 100644 --- a/compiler/testData/codegen/box/assert/jvm/noUnnecessaryClassInitialization.kt +++ b/compiler/testData/codegen/box/assert/jvm/noUnnecessaryClassInitialization.kt @@ -1,5 +1,5 @@ // TARGET_BACKEND: JVM -// KOTLIN_CONFIGURATION_FLAGS: ASSERTIONS_MODE=jvm +// ASSERTIONS_MODE: jvm // WITH_RUNTIME // Reusing the $assertionsDisabled field in the Outer class might seem like a good idea, diff --git a/compiler/testData/codegen/box/assert/jvm/nonLocalReturn.kt b/compiler/testData/codegen/box/assert/jvm/nonLocalReturn.kt index 518cba40697..ad447c15810 100644 --- a/compiler/testData/codegen/box/assert/jvm/nonLocalReturn.kt +++ b/compiler/testData/codegen/box/assert/jvm/nonLocalReturn.kt @@ -1,5 +1,5 @@ // TARGET_BACKEND: JVM -// KOTLIN_CONFIGURATION_FLAGS: ASSERTIONS_MODE=jvm +// ASSERTIONS_MODE: jvm // WITH_RUNTIME package nonLocalReturn @@ -74,4 +74,4 @@ fun box(): String { if (!c.checkFalseWithMessage()) return "FAIL 8" return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/assert/jvm/ordinary.kt b/compiler/testData/codegen/box/assert/jvm/ordinary.kt index 198579a1e74..db101f34c3c 100644 --- a/compiler/testData/codegen/box/assert/jvm/ordinary.kt +++ b/compiler/testData/codegen/box/assert/jvm/ordinary.kt @@ -1,5 +1,5 @@ // TARGET_BACKEND: JVM -// KOTLIN_CONFIGURATION_FLAGS: ASSERTIONS_MODE=jvm +// ASSERTIONS_MODE: jvm // WITH_RUNTIME package ordinary @@ -99,4 +99,4 @@ fun box(): String { } return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/assert/jvm/superClassInitializer.kt b/compiler/testData/codegen/box/assert/jvm/superClassInitializer.kt index c15120c2db0..727d8ad9d39 100644 --- a/compiler/testData/codegen/box/assert/jvm/superClassInitializer.kt +++ b/compiler/testData/codegen/box/assert/jvm/superClassInitializer.kt @@ -1,5 +1,5 @@ // TARGET_BACKEND: JVM -// KOTLIN_CONFIGURATION_FLAGS: ASSERTIONS_MODE=jvm +// ASSERTIONS_MODE: jvm // WITH_RUNTIME package superClassInitializer @@ -117,4 +117,4 @@ fun box(): String { } return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/assert/jvm/suspendFunctionAssertionDisabled.kt b/compiler/testData/codegen/box/assert/jvm/suspendFunctionAssertionDisabled.kt index b9da206e874..1a8338e138a 100644 --- a/compiler/testData/codegen/box/assert/jvm/suspendFunctionAssertionDisabled.kt +++ b/compiler/testData/codegen/box/assert/jvm/suspendFunctionAssertionDisabled.kt @@ -1,5 +1,5 @@ // TARGET_BACKEND: JVM -// KOTLIN_CONFIGURATION_FLAGS: ASSERTIONS_MODE=jvm +// ASSERTIONS_MODE: jvm // WITH_RUNTIME // WITH_COROUTINES package suspendFunctionAssertionDisabled diff --git a/compiler/testData/codegen/box/assert/jvm/suspendFunctionAssertionsEnabled.kt b/compiler/testData/codegen/box/assert/jvm/suspendFunctionAssertionsEnabled.kt index a937c0c5bb8..9bc5ab593a7 100644 --- a/compiler/testData/codegen/box/assert/jvm/suspendFunctionAssertionsEnabled.kt +++ b/compiler/testData/codegen/box/assert/jvm/suspendFunctionAssertionsEnabled.kt @@ -1,5 +1,5 @@ // TARGET_BACKEND: JVM -// KOTLIN_CONFIGURATION_FLAGS: ASSERTIONS_MODE=jvm +// ASSERTIONS_MODE: jvm // WITH_RUNTIME // WITH_COROUTINES package suspendFunctionAssertionsEnabled diff --git a/compiler/testData/codegen/box/assert/jvm/suspendLambdaAssertionsDisabled.kt b/compiler/testData/codegen/box/assert/jvm/suspendLambdaAssertionsDisabled.kt index 098235714c0..e4d91741dd4 100644 --- a/compiler/testData/codegen/box/assert/jvm/suspendLambdaAssertionsDisabled.kt +++ b/compiler/testData/codegen/box/assert/jvm/suspendLambdaAssertionsDisabled.kt @@ -1,5 +1,5 @@ // TARGET_BACKEND: JVM -// KOTLIN_CONFIGURATION_FLAGS: ASSERTIONS_MODE=jvm +// ASSERTIONS_MODE: jvm // WITH_RUNTIME // WITH_COROUTINES package suspendLambdaAssertionsDisabled diff --git a/compiler/testData/codegen/box/assert/jvm/suspendLambdaAssertionsEnabled.kt b/compiler/testData/codegen/box/assert/jvm/suspendLambdaAssertionsEnabled.kt index e9f3ebc920f..3634ce86e73 100644 --- a/compiler/testData/codegen/box/assert/jvm/suspendLambdaAssertionsEnabled.kt +++ b/compiler/testData/codegen/box/assert/jvm/suspendLambdaAssertionsEnabled.kt @@ -1,5 +1,5 @@ // TARGET_BACKEND: JVM -// KOTLIN_CONFIGURATION_FLAGS: ASSERTIONS_MODE=jvm +// ASSERTIONS_MODE: jvm // WITH_RUNTIME // WITH_COROUTINES package suspendLambdaAssertionsEnabled diff --git a/compiler/testData/codegen/box/constructorCall/inlineFunInConstructorCallWithDisabledNormalization.kt b/compiler/testData/codegen/box/constructorCall/inlineFunInConstructorCallWithDisabledNormalization.kt index 79020cc9986..3e1c4a08742 100644 --- a/compiler/testData/codegen/box/constructorCall/inlineFunInConstructorCallWithDisabledNormalization.kt +++ b/compiler/testData/codegen/box/constructorCall/inlineFunInConstructorCallWithDisabledNormalization.kt @@ -1,6 +1,6 @@ // TARGET_BACKEND: JVM // WITH_RUNTIME -// KOTLIN_CONFIGURATION_FLAGS: CONSTRUCTOR_CALL_NORMALIZATION_MODE=disable +// CONSTRUCTOR_CALL_NORMALIZATION_MODE: disable // FILE: test.kt fun box(): String { Foo( diff --git a/compiler/testData/codegen/box/constructorCall/inlineFunInConstructorCallWithEnabledNormalization.kt b/compiler/testData/codegen/box/constructorCall/inlineFunInConstructorCallWithEnabledNormalization.kt index 64c7310ef57..8d5bea4a29e 100644 --- a/compiler/testData/codegen/box/constructorCall/inlineFunInConstructorCallWithEnabledNormalization.kt +++ b/compiler/testData/codegen/box/constructorCall/inlineFunInConstructorCallWithEnabledNormalization.kt @@ -1,6 +1,6 @@ // TARGET_BACKEND: JVM // WITH_RUNTIME -// KOTLIN_CONFIGURATION_FLAGS: CONSTRUCTOR_CALL_NORMALIZATION_MODE=enable +// CONSTRUCTOR_CALL_NORMALIZATION_MODE: enable // FILE: test.kt fun box(): String { Foo( diff --git a/compiler/testData/codegen/box/constructorCall/inlineFunInConstructorCallWithStrictNormalization.kt b/compiler/testData/codegen/box/constructorCall/inlineFunInConstructorCallWithStrictNormalization.kt index 65ef307f5b8..174d155b028 100644 --- a/compiler/testData/codegen/box/constructorCall/inlineFunInConstructorCallWithStrictNormalization.kt +++ b/compiler/testData/codegen/box/constructorCall/inlineFunInConstructorCallWithStrictNormalization.kt @@ -1,6 +1,6 @@ // TARGET_BACKEND: JVM // WITH_RUNTIME -// KOTLIN_CONFIGURATION_FLAGS: CONSTRUCTOR_CALL_NORMALIZATION_MODE=preserve-class-initialization +// CONSTRUCTOR_CALL_NORMALIZATION_MODE: preserve-class-initialization // FILE: test.kt fun box(): String { Foo( diff --git a/compiler/testData/codegen/box/constructorCall/loopInInlineFunInSuperConstructorCallWithEnabledNormalization.kt b/compiler/testData/codegen/box/constructorCall/loopInInlineFunInSuperConstructorCallWithEnabledNormalization.kt index fc914fa55c6..945640a76c6 100644 --- a/compiler/testData/codegen/box/constructorCall/loopInInlineFunInSuperConstructorCallWithEnabledNormalization.kt +++ b/compiler/testData/codegen/box/constructorCall/loopInInlineFunInSuperConstructorCallWithEnabledNormalization.kt @@ -1,6 +1,6 @@ // TARGET_BACKEND: JVM // WITH_RUNTIME -// KOTLIN_CONFIGURATION_FLAGS: CONSTRUCTOR_CALL_NORMALIZATION_MODE=enable +// CONSTRUCTOR_CALL_NORMALIZATION_MODE: enable open class A(val s: String) inline fun test(crossinline z: () -> String): String { @@ -11,4 +11,4 @@ inline fun test(crossinline z: () -> String): String { fun box(): String { return test { "OK" } -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/constructorCall/loopInInlineFunWithEnabledNormalization.kt b/compiler/testData/codegen/box/constructorCall/loopInInlineFunWithEnabledNormalization.kt index 1edbb009b57..2d5eb0145d5 100644 --- a/compiler/testData/codegen/box/constructorCall/loopInInlineFunWithEnabledNormalization.kt +++ b/compiler/testData/codegen/box/constructorCall/loopInInlineFunWithEnabledNormalization.kt @@ -1,6 +1,6 @@ // TARGET_BACKEND: JVM // WITH_RUNTIME -// KOTLIN_CONFIGURATION_FLAGS: CONSTRUCTOR_CALL_NORMALIZATION_MODE=enable +// CONSTRUCTOR_CALL_NORMALIZATION_MODE: enable // FILE: test.kt fun box(): String { Foo( diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/JvmEnvironmentConfigurationDirectives.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/JvmEnvironmentConfigurationDirectives.kt index c0b623f48dc..23b8513d982 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/JvmEnvironmentConfigurationDirectives.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/JvmEnvironmentConfigurationDirectives.kt @@ -5,11 +5,15 @@ package org.jetbrains.kotlin.test.directives +import org.jetbrains.kotlin.config.JVMAssertionsMode +import org.jetbrains.kotlin.config.JVMConstructorCallNormalizationMode +import org.jetbrains.kotlin.config.JvmStringConcat import org.jetbrains.kotlin.config.JvmTarget import org.jetbrains.kotlin.test.TestJdkKind import org.jetbrains.kotlin.test.directives.model.SimpleDirectivesContainer object JvmEnvironmentConfigurationDirectives : SimpleDirectivesContainer() { + @Suppress("RemoveExplicitTypeArguments") val JVM_TARGET by enumDirective( description = "Target bytecode version", additionalParser = JvmTarget.Companion::fromString @@ -34,4 +38,22 @@ object JvmEnvironmentConfigurationDirectives : SimpleDirectivesContainer() { val USE_PSI_CLASS_FILES_READING by directive("Use a slower (PSI-based) class files reading implementation") val USE_JAVAC by directive("Enable javac integration") val SKIP_JAVA_SOURCES by directive("Don't add java sources to compile classpath") + + @Suppress("RemoveExplicitTypeArguments") + val STRING_CONCAT by enumDirective( + description = "Configure mode of string concatenation", + additionalParser = JvmStringConcat.Companion::fromString + ) + + @Suppress("RemoveExplicitTypeArguments") + val ASSERTIONS_MODE by enumDirective( + description = "Configure jvm assertions mode", + additionalParser = JVMAssertionsMode.Companion::fromString + ) + + @Suppress("RemoveExplicitTypeArguments") + val CONSTRUCTOR_CALL_NORMALIZATION_MODE by enumDirective( + description = "Configure jvm constructor call normalization mode", + additionalParser = JVMConstructorCallNormalizationMode.Companion::fromStringOrNull + ) } diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/configuration/JvmEnvironmentConfigurator.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/configuration/JvmEnvironmentConfigurator.kt index 3f4e35fec44..675f133871a 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/configuration/JvmEnvironmentConfigurator.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/configuration/JvmEnvironmentConfigurator.kt @@ -19,6 +19,9 @@ import org.jetbrains.kotlin.platform.jvm.JvmPlatforms import org.jetbrains.kotlin.test.ConfigurationKind import org.jetbrains.kotlin.test.TestJdkKind import org.jetbrains.kotlin.test.directives.JvmEnvironmentConfigurationDirectives +import org.jetbrains.kotlin.test.directives.JvmEnvironmentConfigurationDirectives.ASSERTIONS_MODE +import org.jetbrains.kotlin.test.directives.JvmEnvironmentConfigurationDirectives.CONSTRUCTOR_CALL_NORMALIZATION_MODE +import org.jetbrains.kotlin.test.directives.JvmEnvironmentConfigurationDirectives.STRING_CONCAT import org.jetbrains.kotlin.test.directives.LanguageSettingsDirectives import org.jetbrains.kotlin.test.directives.model.DirectivesContainer import org.jetbrains.kotlin.test.directives.model.RegisteredDirectives @@ -26,6 +29,7 @@ import org.jetbrains.kotlin.test.model.DependencyDescription import org.jetbrains.kotlin.test.model.DependencyKind import org.jetbrains.kotlin.test.model.TestModule import org.jetbrains.kotlin.test.services.* +import org.jetbrains.kotlin.test.services.DirectiveToConfigurationKeyExtractor import org.jetbrains.kotlin.test.services.jvm.CompiledClassesManager import org.jetbrains.kotlin.test.services.jvm.compiledClassesManager import org.jetbrains.kotlin.test.util.KtTestUtil @@ -44,6 +48,12 @@ class JvmEnvironmentConfigurator(testServices: TestServices) : EnvironmentConfig override val additionalServices: List get() = listOf(service(::CompiledClassesManager)) + override fun DirectiveToConfigurationKeyExtractor.provideConfigurationKeys() { + register(STRING_CONCAT, JVMConfigurationKeys.STRING_CONCAT) + register(ASSERTIONS_MODE, JVMConfigurationKeys.ASSERTIONS_MODE) + register(CONSTRUCTOR_CALL_NORMALIZATION_MODE, JVMConfigurationKeys.CONSTRUCTOR_CALL_NORMALIZATION_MODE) + } + override fun configureCompilerConfiguration(configuration: CompilerConfiguration, module: TestModule, project: MockProject) { if (module.targetPlatform !in JvmPlatforms.allJvmPlatforms) return val registeredDirectives = module.directives From 98c22f9e592ae0a02dc5f36874e6ab402aad2324 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Fri, 22 Jan 2021 14:34:49 +0300 Subject: [PATCH 018/212] [TD] Add forgotten bytecode dump --- .../suspendConversion/onInlineArgument.txt | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 compiler/testData/codegen/box/coroutines/suspendConversion/onInlineArgument.txt diff --git a/compiler/testData/codegen/box/coroutines/suspendConversion/onInlineArgument.txt b/compiler/testData/codegen/box/coroutines/suspendConversion/onInlineArgument.txt new file mode 100644 index 00000000000..6c1c8d0fba8 --- /dev/null +++ b/compiler/testData/codegen/box/coroutines/suspendConversion/onInlineArgument.txt @@ -0,0 +1,37 @@ +@kotlin.coroutines.jvm.internal.DebugMetadata +@kotlin.Metadata +final class OnInlineArgumentKt$box$1 { + // source: 'onInlineArgument.kt' + enclosing method OnInlineArgumentKt.box()Ljava/lang/String; + synthetic final field $lambda: kotlin.jvm.functions.Function1 + synthetic final field $test: kotlin.jvm.internal.Ref$ObjectRef + field L$0: java.lang.Object + field label: int + inner (anonymous) class OnInlineArgumentKt$box$1 + method (p0: kotlin.jvm.internal.Ref$ObjectRef, p1: kotlin.jvm.functions.Function1, p2: kotlin.coroutines.Continuation): void + public final @org.jetbrains.annotations.NotNull method create(@org.jetbrains.annotations.NotNull p0: kotlin.coroutines.Continuation): kotlin.coroutines.Continuation + public final method invoke(p0: java.lang.Object): java.lang.Object + public final @org.jetbrains.annotations.Nullable method invokeSuspend(@org.jetbrains.annotations.NotNull p0: java.lang.Object): java.lang.Object +} + +@kotlin.Metadata +final class OnInlineArgumentKt$box$lambda$1 { + // source: 'onInlineArgument.kt' + enclosing method OnInlineArgumentKt.box()Ljava/lang/String; + public final static field INSTANCE: OnInlineArgumentKt$box$lambda$1 + inner (anonymous) class OnInlineArgumentKt$box$lambda$1 + static method (): void + method (): void + public final @org.jetbrains.annotations.NotNull method invoke(@org.jetbrains.annotations.NotNull p0: java.lang.String): java.lang.String + public synthetic bridge method invoke(p0: java.lang.Object): java.lang.Object +} + +@kotlin.Metadata +public final class OnInlineArgumentKt { + // source: 'onInlineArgument.kt' + inner (anonymous) class OnInlineArgumentKt$box$1 + inner (anonymous) class OnInlineArgumentKt$box$lambda$1 + public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String + private final static @org.jetbrains.annotations.Nullable method runS$$forInline(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function2, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object + public final static @org.jetbrains.annotations.Nullable method runS(@org.jetbrains.annotations.NotNull p0: kotlin.jvm.functions.Function2, @org.jetbrains.annotations.NotNull p1: kotlin.coroutines.Continuation): java.lang.Object +} From fd8795de996e946d0745a50f10d1f74bcaf1465d Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Mon, 25 Jan 2021 10:33:50 +0300 Subject: [PATCH 019/212] [Test] Fix FirIdenticalChecker and update some FIR_IDENTICAL testdata --- .../redeclarations/shadowedExtension/extensionOnErrorType.kt | 2 +- compiler/testData/diagnostics/tests/resolve/CycleInTypeArgs.kt | 2 +- compiler/testData/diagnostics/tests/subtyping/kt304.kt | 2 +- .../kotlin/test/frontend/fir/handlers/FirIdenticalChecker.kt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/testData/diagnostics/tests/redeclarations/shadowedExtension/extensionOnErrorType.kt b/compiler/testData/diagnostics/tests/redeclarations/shadowedExtension/extensionOnErrorType.kt index 79f828acfd1..006ee80cd51 100644 --- a/compiler/testData/diagnostics/tests/redeclarations/shadowedExtension/extensionOnErrorType.kt +++ b/compiler/testData/diagnostics/tests/redeclarations/shadowedExtension/extensionOnErrorType.kt @@ -6,4 +6,4 @@ interface G { } fun G.foo() {} -val G.bar: Int get() = 42 \ No newline at end of file +val G.bar: Int get() = 42 diff --git a/compiler/testData/diagnostics/tests/resolve/CycleInTypeArgs.kt b/compiler/testData/diagnostics/tests/resolve/CycleInTypeArgs.kt index 7065ae0cf1a..47e10ceebe0 100644 --- a/compiler/testData/diagnostics/tests/resolve/CycleInTypeArgs.kt +++ b/compiler/testData/diagnostics/tests/resolve/CycleInTypeArgs.kt @@ -2,4 +2,4 @@ class Class1X>>> -class Class2X>>> \ No newline at end of file +class Class2X>>> diff --git a/compiler/testData/diagnostics/tests/subtyping/kt304.kt b/compiler/testData/diagnostics/tests/subtyping/kt304.kt index f8eb56c0730..5387c051147 100644 --- a/compiler/testData/diagnostics/tests/subtyping/kt304.kt +++ b/compiler/testData/diagnostics/tests/subtyping/kt304.kt @@ -6,4 +6,4 @@ open class Foo() : Bar() { } open class Bar() { -} \ No newline at end of file +} diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/handlers/FirIdenticalChecker.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/handlers/FirIdenticalChecker.kt index b3008bcdf96..b0cc9954135 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/handlers/FirIdenticalChecker.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/handlers/FirIdenticalChecker.kt @@ -33,7 +33,7 @@ class FirIdenticalChecker(testServices: TestServices) : AfterAnalysisChecker(tes val classicFile = helper.getClassicFileToCompare(testDataFile) if (helper.contentsAreEquals(classicFile, firFile)) { helper.deleteFirFile(testDataFile) - helper.addDirectiveToClassicFileAndAssert(testDataFile) + helper.addDirectiveToClassicFileAndAssert(classicFile) } } else { removeFirFileIfExist(testDataFile) From 0b45139b34ecc099b7fe7e7631226abe9a44de97 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Mon, 25 Jan 2021 11:52:42 +0300 Subject: [PATCH 020/212] [Test] Fix OutOfMemoryError during extracting meta info from test Previously CodeMetaInfoParser saved MatchResults for each meta info in text (and for each meta info it was different string with text because of extracting parsed part from original text), so it led to O(n^2) memory complexity (where n is a size of original text). Such complexity caused OOME in case of big testdata (~1k meta infos for text of 4k lines) --- .../kotlin/codeMetaInfo/CodeMetaInfoParser.kt | 47 ++++++++++++++----- 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/compiler/test-infrastructure-utils/tests/org/jetbrains/kotlin/codeMetaInfo/CodeMetaInfoParser.kt b/compiler/test-infrastructure-utils/tests/org/jetbrains/kotlin/codeMetaInfo/CodeMetaInfoParser.kt index d56f7e627c0..807d2c4a737 100644 --- a/compiler/test-infrastructure-utils/tests/org/jetbrains/kotlin/codeMetaInfo/CodeMetaInfoParser.kt +++ b/compiler/test-infrastructure-utils/tests/org/jetbrains/kotlin/codeMetaInfo/CodeMetaInfoParser.kt @@ -21,13 +21,33 @@ object CodeMetaInfoParser { */ private val tagRegex = """([\S&&[^,(){}]]+)([{](.*?)[}])?(\("(.*?)"\))?(, )?""".toRegex() + private class Opening(val index: Int, val tags: String, val startOffset: Int) { + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (javaClass != other?.javaClass) return false + + other as Opening + + if (index != other.index) return false + + return true + } + + override fun hashCode(): Int { + return index + } + } + fun getCodeMetaInfoFromText(renderedText: String): List { var text = renderedText - val openingMatchResults = ArrayDeque() - val stackOfOpeningMatchResults = ArrayDeque() - val closingMatchResults = mutableMapOf() + + val openings = ArrayDeque() + val stackOfOpenings = ArrayDeque() + val closingOffsets = mutableMapOf() val result = mutableListOf() + var counter = 0 + while (true) { var openingStartOffset = Int.MAX_VALUE var closingStartOffset = Int.MAX_VALUE @@ -42,22 +62,23 @@ object CodeMetaInfoParser { text = if (openingStartOffset < closingStartOffset) { requireNotNull(opening) - openingMatchResults.addLast(opening) - stackOfOpeningMatchResults.addLast(opening) + val openingMatch = Opening(counter++, opening.groups[2]!!.value, opening.range.first) + openings.addLast(openingMatch) + stackOfOpenings.addLast(openingMatch) text.removeRange(openingStartOffset, opening.range.last + 1) } else { requireNotNull(closing) - closingMatchResults[stackOfOpeningMatchResults.removeLast()] = closing + closingOffsets[stackOfOpenings.removeLast()] = closing.range.first text.removeRange(closingStartOffset, closing.range.last + 1) } } - if (openingMatchResults.size != closingMatchResults.size) { + if (openings.size != closingOffsets.size) { error("Opening and closing tags counts are not equals") } - while (!openingMatchResults.isEmpty()) { - val openingMatchResult = openingMatchResults.removeLast() - val closingMatchResult = closingMatchResults.getValue(openingMatchResult) - val allMetaInfos = openingMatchResult.groups[2]!!.value + while (!openings.isEmpty()) { + val openingMatchResult = openings.removeLast() + val closingMatchResult = closingOffsets.getValue(openingMatchResult) + val allMetaInfos = openingMatchResult.tags tagRegex.findAll(allMetaInfos).map { it.groups }.forEach { val tag = it[1]!!.value val attributes = it[3]?.value?.split(";") ?: emptyList() @@ -65,8 +86,8 @@ object CodeMetaInfoParser { result.add( ParsedCodeMetaInfo( - openingMatchResult.range.first, - closingMatchResult.range.first, + openingMatchResult.startOffset, + closingMatchResult, attributes.toMutableList(), tag, description From 663d5026d81117d02aa31a866d13fc5f905728e8 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Mon, 25 Jan 2021 12:26:01 +0300 Subject: [PATCH 021/212] [Test] Migrate FIR diagnostic spec tests to new infrastructure This commit includes a lot of minor changes in testdata: new infrastructure requires that each test file in one testdata file in one module must have unique name, but a lot of existing spec tests didn't satisfy this requirement --- .../FirDiagnosticTestSpecGenerated.java} | 4749 ++++++++--------- .../directives/AdditionalFilesDirectives.kt | 7 + .../runners/AbstractFirDiagnosticTestSpec.kt | 35 + .../SpecHelpersSourceFilesProvider.kt | 33 + compiler/tests-spec/build.gradle.kts | 5 + .../real-literals/p-4/neg/2.2.fir.kt | 2 +- .../real-literals/p-4/neg/2.3.fir.kt | 4 +- .../p-5/pos/2.1.kt | 10 +- .../p-1/pos/2.10.kt | 14 +- .../p-1/pos/2.11.kt | 8 +- .../p-1/pos/2.12.kt | 24 +- .../p-1/pos/2.13.kt | 24 +- .../p-1/pos/2.14.kt | 24 +- .../p-1/pos/2.15.kt | 24 +- .../p-1/pos/2.16.kt | 24 +- .../call-with-named-parameters/p-1/pos/2.3.kt | 4 +- .../call-with-named-parameters/p-1/pos/2.8.kt | 24 +- .../call-with-named-parameters/p-1/pos/2.9.kt | 18 +- .../p-5/pos/1.1.fir.kt | 24 +- .../p-1/pos/2.10.fir.kt | 12 +- .../p-1/pos/2.10.kt | 14 +- .../p-1/pos/2.11.kt | 8 +- .../p-1/pos/2.12.fir.kt | 24 +- .../p-1/pos/2.12.kt | 24 +- .../p-1/pos/2.13.fir.kt | 24 +- .../p-1/pos/2.13.kt | 24 +- .../p-1/pos/2.14.fir.kt | 24 +- .../p-1/pos/2.14.kt | 24 +- .../p-1/pos/2.15.fir.kt | 24 +- .../p-1/pos/2.15.kt | 24 +- .../p-1/pos/2.16.fir.kt | 24 +- .../p-1/pos/2.16.kt | 24 +- .../p-1/pos/2.17.fir.kt | 4 +- .../p-1/pos/2.17.kt | 4 +- .../p-1/pos/2.18.kt | 4 +- .../p-1/pos/2.19.kt | 4 +- .../p-1/pos/2.20.kt | 4 +- .../p-1/pos/2.3.kt | 4 +- .../p-1/pos/2.8.fir.kt | 24 +- .../p-1/pos/2.8.kt | 24 +- .../p-1/pos/2.9.fir.kt | 18 +- .../p-1/pos/2.9.kt | 18 +- .../p-5/neg/2.3.fir.kt | 6 +- .../p-5/neg/2.3.kt | 6 +- .../p-5/neg/2.4.fir.kt | 16 +- .../p-5/neg/2.4.kt | 16 +- .../p-5/neg/2.5.fir.kt | 6 +- .../p-5/neg/2.5.kt | 6 +- .../p-5/neg/6.1.fir.kt | 18 +- .../p-5/neg/6.1.kt | 18 +- .../p-5/neg/6.4.fir.kt | 48 +- .../p-5/neg/6.4.kt | 42 +- .../p-5/pos/2.1.kt | 24 +- .../p-5/pos/2.2.kt | 24 +- .../p-5/pos/2.3.kt | 24 +- .../p-5/pos/2.4.kt | 24 +- .../p-5/pos/2.5.kt | 24 +- .../p-5/pos/4.1.kt | 24 +- .../p-5/pos/4.2.fir.kt | 6 +- .../p-5/pos/4.2.kt | 6 +- .../p-5/pos/4.3.fir.kt | 6 +- .../p-5/pos/4.3.kt | 6 +- .../p-5/pos/4.4.fir.kt | 6 +- .../p-5/pos/4.4.kt | 6 +- .../p-5/pos/4.5.fir.kt | 6 +- .../p-5/pos/4.5.kt | 6 +- .../p-5/pos/4.6.fir.kt | 12 +- .../p-5/pos/4.6.kt | 12 +- .../p-5/pos/5.1.kt | 18 +- .../p-5/pos/6.1.kt | 14 +- .../p-5/pos/6.2.fir.kt | 28 +- .../p-5/pos/6.2.kt | 28 +- .../p-5/pos/6.3.fir.kt | 12 +- .../p-5/pos/6.3.kt | 12 +- .../p-5/pos/7.1.kt | 8 +- .../infix-function-call/p-2/neg/1.1.fir.kt | 4 +- .../infix-function-call/p-2/neg/1.1.kt | 4 +- .../infix-function-call/p-2/neg/1.2.fir.kt | 4 +- .../infix-function-call/p-2/neg/1.2.kt | 4 +- .../infix-function-call/p-2/neg/1.3.fir.kt | 4 +- .../infix-function-call/p-2/neg/1.3.kt | 4 +- .../infix-function-call/p-2/neg/1.4.fir.kt | 4 +- .../infix-function-call/p-2/neg/1.4.kt | 4 +- .../infix-function-call/p-2/pos/4.1.fir.kt | 4 +- .../infix-function-call/p-2/pos/4.1.kt | 4 +- .../infix-function-call/p-2/pos/4.2.kt | 4 +- .../infix-function-call/p-2/pos/4.3.fir.kt | 4 +- .../infix-function-call/p-2/pos/4.3.kt | 4 +- .../infix-function-call/p-2/pos/4.4.kt | 4 +- .../operator-call/p-1/neg/2.4.fir.kt | 54 +- .../operator-call/p-2/pos/3.2.fir.kt | 213 +- .../operator-call/p-2/pos/3.2.kt | 8 +- .../operator-call/p-2/pos/3.3.fir.kt | 22 +- .../operator-call/p-2/pos/3.3.kt | 8 +- .../operator-call/p-2/pos/3.4.fir.kt | 26 +- .../operator-call/p-2/pos/3.4.kt | 12 +- .../operator-call/p-2/pos/3.5.fir.kt | 18 +- .../operator-call/p-2/pos/3.5.kt | 4 +- .../operator-call/p-2/pos/3.6.fir.kt | 12 + .../p-11/pos/4.2.fir.kt | 6 +- .../p-11/pos/4.2.kt | 8 +- .../p-12/pos/2.2.fir.kt | 6 +- .../p-12/pos/2.2.kt | 8 +- .../p-9/neg/2.2.fir.kt | 8 +- .../algorithm-of-msc-selection/p-9/neg/2.2.kt | 8 +- .../description/p-2/neg/2.1.fir.kt | 4 +- .../description/p-2/neg/2.1.kt | 6 +- .../receivers/p-5/pos/2.1.kt | 4 +- .../receivers/p-5/pos/3.1.kt | 8 +- .../receivers/p-5/pos/5.1.fir.kt | 8 +- .../receivers/p-5/pos/5.1.kt | 8 +- .../analysis/smartcasts/neg/10.fir.kt | 24 +- .../analysis/smartcasts/neg/2.fir.kt | 22 +- .../analysis/smartcasts/neg/3.fir.kt | 10 +- .../analysis/smartcasts/pos/3.fir.kt | 10 +- .../diagnostics/notLinked/dfa/pos/5.fir.kt | 36 +- .../diagnostics/notLinked/dfa/pos/6.fir.kt | 228 +- .../AbstractFirDiagnosticsTestSpec.kt | 37 - .../spec/utils/tasks/GenerateSpecTests.kt | 23 +- 119 files changed, 3283 insertions(+), 3579 deletions(-) rename compiler/{tests-spec/tests/org/jetbrains/kotlin/spec/checkers/FirDiagnosticsTestSpecGenerated.java => fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticTestSpecGenerated.java} (56%) create mode 100644 compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/AbstractFirDiagnosticTestSpec.kt create mode 100644 compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/sourceProviders/SpecHelpersSourceFilesProvider.kt delete mode 100644 compiler/tests-spec/tests/org/jetbrains/kotlin/spec/checkers/AbstractFirDiagnosticsTestSpec.kt diff --git a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/checkers/FirDiagnosticsTestSpecGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticTestSpecGenerated.java similarity index 56% rename from compiler/tests-spec/tests/org/jetbrains/kotlin/spec/checkers/FirDiagnosticsTestSpecGenerated.java rename to compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticTestSpecGenerated.java index ce8c4a9319d..6febc8a5ba6 100644 --- a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/checkers/FirDiagnosticsTestSpecGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticTestSpecGenerated.java @@ -1,168 +1,150 @@ /* - * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.spec.checkers; +package org.jetbrains.kotlin.test.runners; import com.intellij.testFramework.TestDataPath; -import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; -import org.jetbrains.kotlin.test.KotlinTestUtils; +import org.jetbrains.kotlin.test.util.KtTestUtil; import org.jetbrains.kotlin.test.TestMetadata; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.parallel.Execution; +import org.junit.jupiter.api.parallel.ExecutionMode; import java.io.File; import java.util.regex.Pattern; -/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ +/** This class is generated by {@link GenerateNewCompilerTests.kt}. DO NOT MODIFY MANUALLY */ @SuppressWarnings("all") @TestMetadata("compiler/tests-spec/testData/diagnostics") @TestDataPath("$PROJECT_ROOT") -@RunWith(JUnit3RunnerWithInners.class) -public class FirDiagnosticsTestSpecGenerated extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - +public class FirDiagnosticTestSpecGenerated extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInDiagnostics() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "helpers", "linked/annotations", "linked/built-in-types-and-their-semantics", "linked/control--and-data-flow-analysis.control-flow-graph.expressions-1.conditional-expressions", "linked/control--and-data-flow-analysis/performing-analysis-on-the-control-flow-graph", "linked/declarations/classifier-declaration/class-declaration/nested-and-inner-classifiers", "linked/declarations/classifier-declaration/classifier-initialization", "linked/declarations/classifier-declaration/data-class-declaration", "linked/declarations/function-declaration", "linked/declarations/property-declaration/property-initialization", "linked/declarations/type-alias", "linked/expressions/call-and-property-access-expressions", "linked/expressions/function-literals", "linked/inheritance", "linked/overload-resolution/c-level-partition", "linked/overload-resolution/determining-function-applicability-for-a-specific-call/rationale", "linked/overloadable-operators", "linked/statements/assignments/simple-assignments", "linked/type-inference/local-type-inference", "linked/type-inference/smart-casts/smart-cast-types", "linked/type-system/subtyping/subtyping-for-nullable-types", "linked/type-system/type-kinds/type-parameters"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "helpers", "linked/annotations", "linked/built-in-types-and-their-semantics", "linked/control--and-data-flow-analysis.control-flow-graph.expressions-1.conditional-expressions", "linked/control--and-data-flow-analysis/performing-analysis-on-the-control-flow-graph", "linked/declarations/classifier-declaration/class-declaration/nested-and-inner-classifiers", "linked/declarations/classifier-declaration/classifier-initialization", "linked/declarations/classifier-declaration/data-class-declaration", "linked/declarations/function-declaration", "linked/declarations/property-declaration/property-initialization", "linked/declarations/type-alias", "linked/expressions/call-and-property-access-expressions", "linked/expressions/function-literals", "linked/inheritance", "linked/overload-resolution/c-level-partition", "linked/overload-resolution/determining-function-applicability-for-a-specific-call/rationale", "linked/overloadable-operators", "linked/statements/assignments/simple-assignments", "linked/type-inference/local-type-inference", "linked/type-inference/smart-casts/smart-cast-types", "linked/type-system/subtyping/subtyping-for-nullable-types", "linked/type-system/type-kinds/type-parameters"); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Linked extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Linked extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInLinked() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "annotations", "built-in-types-and-their-semantics", "control--and-data-flow-analysis.control-flow-graph.expressions-1.conditional-expressions", "control--and-data-flow-analysis/performing-analysis-on-the-control-flow-graph", "declarations/classifier-declaration/class-declaration/nested-and-inner-classifiers", "declarations/classifier-declaration/classifier-initialization", "declarations/classifier-declaration/data-class-declaration", "declarations/function-declaration", "declarations/property-declaration/property-initialization", "declarations/type-alias", "expressions/call-and-property-access-expressions", "expressions/function-literals", "inheritance", "overload-resolution/c-level-partition", "overload-resolution/determining-function-applicability-for-a-specific-call/rationale", "overloadable-operators", "statements/assignments/simple-assignments", "type-inference/local-type-inference", "type-inference/smart-casts/smart-cast-types", "type-system/subtyping/subtyping-for-nullable-types", "type-system/type-kinds/type-parameters"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "annotations", "built-in-types-and-their-semantics", "control--and-data-flow-analysis.control-flow-graph.expressions-1.conditional-expressions", "control--and-data-flow-analysis/performing-analysis-on-the-control-flow-graph", "declarations/classifier-declaration/class-declaration/nested-and-inner-classifiers", "declarations/classifier-declaration/classifier-initialization", "declarations/classifier-declaration/data-class-declaration", "declarations/function-declaration", "declarations/property-declaration/property-initialization", "declarations/type-alias", "expressions/call-and-property-access-expressions", "expressions/function-literals", "inheritance", "overload-resolution/c-level-partition", "overload-resolution/determining-function-applicability-for-a-specific-call/rationale", "overloadable-operators", "statements/assignments/simple-assignments", "type-inference/local-type-inference", "type-inference/smart-casts/smart-cast-types", "type-system/subtyping/subtyping-for-nullable-types", "type-system/type-kinds/type-parameters"); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Control__and_data_flow_analysis extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Control__and_data_flow_analysis extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInControl__and_data_flow_analysis() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "performing-analysis-on-the-control-flow-graph"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "performing-analysis-on-the-control-flow-graph"); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Control_flow_graph extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Control_flow_graph extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInControl_flow_graph() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Expressions_1 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Expressions_1 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInExpressions_1() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Conditional_expressions extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Conditional_expressions extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInConditional_expressions() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_1 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_1 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_1() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1/neg/1.1.kt"); } + @Test @TestMetadata("1.2.kt") public void test1_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1/neg/1.2.kt"); } + @Test @TestMetadata("1.3.kt") public void test1_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1/neg/1.3.kt"); } + @Test @TestMetadata("1.4.kt") public void test1_4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1/neg/1.4.kt"); } + @Test @TestMetadata("2.1.kt") public void test2_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1/neg/2.1.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1/pos/1.1.kt"); } + @Test @TestMetadata("1.2.kt") public void test1_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1/pos/1.2.kt"); } + @Test @TestMetadata("2.1.kt") public void test2_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1/pos/2.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/control--and-data-flow-analysis/control-flow-graph/expressions-1/conditional-expressions/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } @@ -171,381 +153,368 @@ public class FirDiagnosticsTestSpecGenerated extends AbstractFirDiagnosticsTestS } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/declarations") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Declarations extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Declarations extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInDeclarations() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "classifier-declaration/class-declaration/nested-and-inner-classifiers", "classifier-declaration/classifier-initialization", "classifier-declaration/data-class-declaration", "function-declaration", "property-declaration/property-initialization", "type-alias"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "classifier-declaration/class-declaration/nested-and-inner-classifiers", "classifier-declaration/classifier-initialization", "classifier-declaration/data-class-declaration", "function-declaration", "property-declaration/property-initialization", "type-alias"); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Classifier_declaration extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Classifier_declaration extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInClassifier_declaration() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "class-declaration/nested-and-inner-classifiers", "classifier-initialization", "data-class-declaration"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "class-declaration/nested-and-inner-classifiers", "classifier-initialization", "data-class-declaration"); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Class_declaration extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Class_declaration extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInClass_declaration() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "nested-and-inner-classifiers"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "nested-and-inner-classifiers"); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Abstract_classes extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Abstract_classes extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInAbstract_classes() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-1") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_1 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_1 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_1() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-1/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-1/neg/1.1.kt"); } + @Test @TestMetadata("2.1.kt") public void test2_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-1/neg/2.1.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-1/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-1/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-1/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("2.1.kt") public void test2_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-1/pos/2.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_2 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_2 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_2() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2/neg/1.1.kt"); } + @Test @TestMetadata("1.10.kt") public void test1_10() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2/neg/1.10.kt"); } + @Test @TestMetadata("1.2.kt") public void test1_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2/neg/1.2.kt"); } + @Test @TestMetadata("1.3.kt") public void test1_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2/neg/1.3.kt"); } + @Test @TestMetadata("1.4.kt") public void test1_4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2/neg/1.4.kt"); } + @Test @TestMetadata("1.5.kt") public void test1_5() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2/neg/1.5.kt"); } + @Test @TestMetadata("1.6.kt") public void test1_6() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2/neg/1.6.kt"); } + @Test @TestMetadata("1.7.kt") public void test1_7() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2/neg/1.7.kt"); } + @Test @TestMetadata("1.8.kt") public void test1_8() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2/neg/1.8.kt"); } + @Test @TestMetadata("1.9.kt") public void test1_9() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2/neg/1.9.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2/pos/1.1.kt"); } + @Test @TestMetadata("1.2.kt") public void test1_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2/pos/1.2.kt"); } + @Test @TestMetadata("1.3.kt") public void test1_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2/pos/1.3.kt"); } + @Test @TestMetadata("1.4.kt") public void test1_4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2/pos/1.4.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/constructor-declaration") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Constructor_declaration extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Constructor_declaration extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInConstructor_declaration() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/constructor-declaration"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/constructor-declaration"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/constructor-declaration/p-4") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_4 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_4 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_4() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/constructor-declaration/p-4"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/constructor-declaration/p-4"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/constructor-declaration/p-4/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/constructor-declaration/p-4/pos/1.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/constructor-declaration/p-4/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/constructor-declaration/p-4/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/constructor-declaration/p-5") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_5 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_5 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_5() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/constructor-declaration/p-5"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/constructor-declaration/p-5"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/constructor-declaration/p-5/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/constructor-declaration/p-5/neg/1.1.kt"); } + @Test @TestMetadata("1.2.kt") public void test1_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/constructor-declaration/p-5/neg/1.2.kt"); } + @Test @TestMetadata("2.1.kt") public void test2_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/constructor-declaration/p-5/neg/2.1.kt"); } + @Test @TestMetadata("3.1.kt") public void test3_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/constructor-declaration/p-5/neg/3.1.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/constructor-declaration/p-5/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/constructor-declaration/p-5/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/constructor-declaration/p-5/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/constructor-declaration/p-5/pos/1.1.kt"); } + @Test @TestMetadata("1.2.kt") public void test1_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/constructor-declaration/p-5/pos/1.2.kt"); } + @Test @TestMetadata("1.3.kt") public void test1_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/constructor-declaration/p-5/pos/1.3.kt"); } + @Test @TestMetadata("1.4.kt") public void test1_4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/constructor-declaration/p-5/pos/1.4.kt"); } + @Test @TestMetadata("1.5.kt") public void test1_5() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/constructor-declaration/p-5/pos/1.5.kt"); } + @Test @TestMetadata("2.1.kt") public void test2_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/constructor-declaration/p-5/pos/2.1.kt"); } + @Test @TestMetadata("2.2.kt") public void test2_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/constructor-declaration/p-5/pos/2.2.kt"); } + @Test @TestMetadata("2.3.kt") public void test2_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/constructor-declaration/p-5/pos/2.3.kt"); } + @Test @TestMetadata("2.4.kt") public void test2_4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/constructor-declaration/p-5/pos/2.4.kt"); } + @Test @TestMetadata("3.1.kt") public void test3_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/constructor-declaration/p-5/pos/3.1.kt"); } + @Test @TestMetadata("3.2.kt") public void test3_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/constructor-declaration/p-5/pos/3.2.kt"); } + @Test @TestMetadata("3.3.kt") public void test3_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/constructor-declaration/p-5/pos/3.3.kt"); } + @Test @TestMetadata("3.4.kt") public void test3_4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/constructor-declaration/p-5/pos/3.4.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/constructor-declaration/p-5/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/constructor-declaration/p-5/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } @@ -553,57 +522,46 @@ public class FirDiagnosticsTestSpecGenerated extends AbstractFirDiagnosticsTestS } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/declarations/property-declaration") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Property_declaration extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Property_declaration extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInProperty_declaration() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/property-declaration"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "property-initialization"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/property-declaration"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "property-initialization"); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/declarations/property-declaration/local-property-declaration") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Local_property_declaration extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Local_property_declaration extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInLocal_property_declaration() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/property-declaration/local-property-declaration"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/property-declaration/local-property-declaration"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/declarations/property-declaration/local-property-declaration/p-1") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_1 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_1 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_1() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/property-declaration/local-property-declaration/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/property-declaration/local-property-declaration/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/declarations/property-declaration/local-property-declaration/p-1/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/declarations/property-declaration/local-property-declaration/p-1/neg/1.1.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/property-declaration/local-property-declaration/p-1/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/declarations/property-declaration/local-property-declaration/p-1/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } @@ -611,4759 +569,4367 @@ public class FirDiagnosticsTestSpecGenerated extends AbstractFirDiagnosticsTestS } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Expressions extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Expressions extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInExpressions() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "call-and-property-access-expressions", "function-literals"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "call-and-property-access-expressions", "function-literals"); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/additive-expression") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Additive_expression extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Additive_expression extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInAdditive_expression() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/additive-expression"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/additive-expression"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/additive-expression/p-4") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_4 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_4 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_4() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/additive-expression/p-4"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/additive-expression/p-4"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/additive-expression/p-4/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/additive-expression/p-4/pos/1.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/additive-expression/p-4/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/additive-expression/p-4/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/built-in-types-and-their-semantics") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Built_in_types_and_their_semantics extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Built_in_types_and_their_semantics extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInBuilt_in_types_and_their_semantics() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/built-in-types-and-their-semantics"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/built-in-types-and-their-semantics"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Kotlin_nothing_1 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Kotlin_nothing_1 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInKotlin_nothing_1() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_1 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_1 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_1() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos/1.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/built-in-types-and-their-semantics/kotlin.nothing-1/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/built-in-types-and-their-semantics/kotlin.unit") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Kotlin_unit extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Kotlin_unit extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInKotlin_unit() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/built-in-types-and-their-semantics/kotlin.unit"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/built-in-types-and-their-semantics/kotlin.unit"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/built-in-types-and-their-semantics/kotlin.unit/p-1") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_1 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_1 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_1() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/built-in-types-and-their-semantics/kotlin.unit/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/built-in-types-and-their-semantics/kotlin.unit/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/built-in-types-and-their-semantics/kotlin.unit/p-1/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/built-in-types-and-their-semantics/kotlin.unit/p-1/pos/1.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/built-in-types-and-their-semantics/kotlin.unit/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/built-in-types-and-their-semantics/kotlin.unit/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Comparison_expressions extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Comparison_expressions extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInComparison_expressions() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/p-1") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_1 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_1 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_1() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/p-1/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("2.1.kt") public void test2_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/p-1/neg/2.1.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/p-1/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/p-1/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/p-4") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_4 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_4 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_4() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/p-4"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/p-4"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/p-4/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/p-4/neg/1.1.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/p-4/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/p-4/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/p-5") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_5 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_5 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_5() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/p-5"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/p-5"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/p-5/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/p-5/pos/1.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/p-5/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/comparison-expressions/p-5/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Conditional_expression extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Conditional_expression extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInConditional_expression() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression/p-6") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_6 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_6 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_6() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression/p-6"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression/p-6"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression/p-6/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression/p-6/neg/1.1.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression/p-6/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression/p-6/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression/p-6/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression/p-6/pos/1.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression/p-6/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression/p-6/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Constant_literals extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Constant_literals extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInConstant_literals() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/boolean-literals") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Boolean_literals extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Boolean_literals extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInBoolean_literals() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/boolean-literals"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/boolean-literals"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/boolean-literals/p-1") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_1 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_1 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_1() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/boolean-literals/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/boolean-literals/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/boolean-literals/p-1/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("2.1.kt") public void test2_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/boolean-literals/p-1/neg/2.1.kt"); } + @Test @TestMetadata("3.1.kt") public void test3_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/boolean-literals/p-1/neg/3.1.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/boolean-literals/p-1/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/boolean-literals/p-1/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/boolean-literals/p-1/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("2.1.kt") public void test2_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/boolean-literals/p-1/pos/2.1.kt"); } + @Test @TestMetadata("3.1.kt") public void test3_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/boolean-literals/p-1/pos/3.1.kt"); } + @Test @TestMetadata("3.2.kt") public void test3_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/boolean-literals/p-1/pos/3.2.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/boolean-literals/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/boolean-literals/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/character-literals") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Character_literals extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Character_literals extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInCharacter_literals() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/character-literals"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/character-literals"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/character-literals/p-1") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_1 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_1 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_1() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/character-literals/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/character-literals/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/character-literals/p-1/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/character-literals/p-1/neg/1.1.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/character-literals/p-1/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/character-literals/p-1/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/character-literals/p-1/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/character-literals/p-1/pos/1.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/character-literals/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/character-literals/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/character-literals/p-4") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_4 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_4 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_4() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/character-literals/p-4"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/character-literals/p-4"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/character-literals/p-4/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/character-literals/p-4/neg/1.1.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/character-literals/p-4/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/character-literals/p-4/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/character-literals/p-4/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/character-literals/p-4/pos/1.1.kt"); } + @Test @TestMetadata("1.2.kt") public void test1_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/character-literals/p-4/pos/1.2.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/character-literals/p-4/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/character-literals/p-4/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Integer_literals extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Integer_literals extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInInteger_literals() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/binary-integer-literals") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Binary_integer_literals extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Binary_integer_literals extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInBinary_integer_literals() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/binary-integer-literals"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/binary-integer-literals"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/binary-integer-literals/p-1") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_1 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_1 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_1() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/binary-integer-literals/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/binary-integer-literals/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/binary-integer-literals/p-1/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/binary-integer-literals/p-1/neg/1.1.kt"); } + @Test @TestMetadata("2.1.kt") public void test2_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/binary-integer-literals/p-1/neg/2.1.kt"); } + @Test @TestMetadata("2.2.kt") public void test2_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/binary-integer-literals/p-1/neg/2.2.kt"); } + @Test @TestMetadata("2.3.kt") public void test2_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/binary-integer-literals/p-1/neg/2.3.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/binary-integer-literals/p-1/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/binary-integer-literals/p-1/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/decimal-integer-literals") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Decimal_integer_literals extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Decimal_integer_literals extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInDecimal_integer_literals() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/decimal-integer-literals"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/decimal-integer-literals"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/decimal-integer-literals/p-1") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_1 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_1 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_1() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/decimal-integer-literals/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/decimal-integer-literals/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/decimal-integer-literals/p-1/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("2.1.kt") public void test2_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/decimal-integer-literals/p-1/neg/2.1.kt"); } + @Test @TestMetadata("2.2.kt") public void test2_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/decimal-integer-literals/p-1/neg/2.2.kt"); } + @Test @TestMetadata("2.3.kt") public void test2_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/decimal-integer-literals/p-1/neg/2.3.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/decimal-integer-literals/p-1/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/decimal-integer-literals/p-1/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/hexadecimal-integer-literals") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Hexadecimal_integer_literals extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Hexadecimal_integer_literals extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInHexadecimal_integer_literals() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/hexadecimal-integer-literals"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/hexadecimal-integer-literals"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/hexadecimal-integer-literals/p-1") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_1 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_1 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_1() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/hexadecimal-integer-literals/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/hexadecimal-integer-literals/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/hexadecimal-integer-literals/p-1/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/hexadecimal-integer-literals/p-1/neg/1.1.kt"); } + @Test @TestMetadata("2.1.kt") public void test2_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/hexadecimal-integer-literals/p-1/neg/2.1.kt"); } + @Test @TestMetadata("2.2.kt") public void test2_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/hexadecimal-integer-literals/p-1/neg/2.2.kt"); } + @Test @TestMetadata("2.3.kt") public void test2_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/hexadecimal-integer-literals/p-1/neg/2.3.kt"); } + @Test @TestMetadata("2.4.kt") public void test2_4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/hexadecimal-integer-literals/p-1/neg/2.4.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/hexadecimal-integer-literals/p-1/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/integer-literals/hexadecimal-integer-literals/p-1/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Real_literals extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Real_literals extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInReal_literals() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-1") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_1 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_1 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_1() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-1/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-1/neg/1.1.kt"); } + @Test @TestMetadata("3.1.kt") public void test3_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-1/neg/3.1.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-1/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-1/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-1/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-1/pos/1.1.kt"); } + @Test @TestMetadata("1.2.kt") public void test1_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-1/pos/1.2.kt"); } + @Test @TestMetadata("3.1.kt") public void test3_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-1/pos/3.1.kt"); } + @Test @TestMetadata("3.2.kt") public void test3_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-1/pos/3.2.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-2") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_2 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_2 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_2() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-2"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-2"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-2/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-2/neg/1.1.kt"); } + @Test @TestMetadata("1.2.kt") public void test1_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-2/neg/1.2.kt"); } + @Test @TestMetadata("1.3.kt") public void test1_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-2/neg/1.3.kt"); } + @Test @TestMetadata("1.4.kt") public void test1_4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-2/neg/1.4.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-2/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-2/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-2/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-2/pos/1.1.kt"); } + @Test @TestMetadata("1.2.kt") public void test1_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-2/pos/1.2.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-2/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-2/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-3") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_3 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_3 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_3() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-3"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-3"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-3/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-3/neg/1.1.kt"); } + @Test @TestMetadata("1.2.kt") public void test1_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-3/neg/1.2.kt"); } + @Test @TestMetadata("2.1.kt") public void test2_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-3/neg/2.1.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-3/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-3/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-3/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-3/pos/1.1.kt"); } + @Test @TestMetadata("1.2.kt") public void test1_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-3/pos/1.2.kt"); } + @Test @TestMetadata("1.3.kt") public void test1_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-3/pos/1.3.kt"); } + @Test @TestMetadata("1.4.kt") public void test1_4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-3/pos/1.4.kt"); } + @Test @TestMetadata("1.5.kt") public void test1_5() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-3/pos/1.5.kt"); } + @Test @TestMetadata("2.1.kt") public void test2_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-3/pos/2.1.kt"); } + @Test @TestMetadata("2.2.kt") public void test2_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-3/pos/2.2.kt"); } + @Test @TestMetadata("2.3.kt") public void test2_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-3/pos/2.3.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-3/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-3/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-4") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_4 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_4 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_4() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-4"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-4"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-4/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-4/neg/1.1.kt"); } + @Test @TestMetadata("1.2.kt") public void test1_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-4/neg/1.2.kt"); } + @Test @TestMetadata("2.1.kt") public void test2_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-4/neg/2.1.kt"); } + @Test @TestMetadata("2.2.kt") public void test2_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-4/neg/2.2.kt"); } + @Test @TestMetadata("2.3.kt") public void test2_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-4/neg/2.3.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-4/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-4/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-4/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-4/pos/1.1.kt"); } + @Test @TestMetadata("1.2.kt") public void test1_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-4/pos/1.2.kt"); } + @Test @TestMetadata("1.3.kt") public void test1_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-4/pos/1.3.kt"); } + @Test @TestMetadata("1.4.kt") public void test1_4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-4/pos/1.4.kt"); } + @Test @TestMetadata("1.5.kt") public void test1_5() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-4/pos/1.5.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-4/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-4/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-5") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_5 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_5 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_5() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-5"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-5"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-5/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-5/pos/1.1.kt"); } + @Test @TestMetadata("1.2.kt") public void test1_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-5/pos/1.2.kt"); } + @Test @TestMetadata("1.3.kt") public void test1_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-5/pos/1.3.kt"); } + @Test @TestMetadata("1.4.kt") public void test1_4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-5/pos/1.4.kt"); } + @Test @TestMetadata("1.5.kt") public void test1_5() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-5/pos/1.5.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-5/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-5/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class The_types_for_integer_literals extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class The_types_for_integer_literals extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInThe_types_for_integer_literals() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_1 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_1 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_1() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/neg/1.1.kt"); } + @Test @TestMetadata("1.2.kt") public void test1_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/neg/1.2.kt"); } + @Test @TestMetadata("1.3.kt") public void test1_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/neg/1.3.kt"); } + @Test @TestMetadata("2.1.kt") public void test2_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/neg/2.1.kt"); } + @Test @TestMetadata("2.2.kt") public void test2_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/neg/2.2.kt"); } + @Test @TestMetadata("2.3.kt") public void test2_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/neg/2.3.kt"); } + @Test @TestMetadata("2.4.kt") public void test2_4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/neg/2.4.kt"); } + @Test @TestMetadata("2.5.kt") public void test2_5() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/neg/2.5.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("2.1.kt") public void test2_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/pos/2.1.kt"); } + @Test @TestMetadata("2.2.kt") public void test2_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/pos/2.2.kt"); } + @Test @TestMetadata("2.3.kt") public void test2_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/pos/2.3.kt"); } + @Test @TestMetadata("2.4.kt") public void test2_4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/pos/2.4.kt"); } + @Test @TestMetadata("2.5.kt") public void test2_5() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/pos/2.5.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/elvis-operator-expression") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Elvis_operator_expression extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Elvis_operator_expression extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInElvis_operator_expression() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/elvis-operator-expression"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/elvis-operator-expression"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/elvis-operator-expression/p-3") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_3 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_3 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_3() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/elvis-operator-expression/p-3"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/elvis-operator-expression/p-3"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/elvis-operator-expression/p-3/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/elvis-operator-expression/p-3/pos/1.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/elvis-operator-expression/p-3/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/elvis-operator-expression/p-3/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/equality-expressions") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Equality_expressions extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Equality_expressions extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInEquality_expressions() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/equality-expressions"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/equality-expressions"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/equality-expressions/value-equality-expressions") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Value_equality_expressions extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Value_equality_expressions extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInValue_equality_expressions() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/equality-expressions/value-equality-expressions"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/equality-expressions/value-equality-expressions"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/equality-expressions/value-equality-expressions/p-3") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_3 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_3 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_3() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/equality-expressions/value-equality-expressions/p-3"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/equality-expressions/value-equality-expressions/p-3"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/equality-expressions/value-equality-expressions/p-3/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/equality-expressions/value-equality-expressions/p-3/pos/1.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/equality-expressions/value-equality-expressions/p-3/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/equality-expressions/value-equality-expressions/p-3/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Jump_expressions extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Jump_expressions extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInJump_expressions() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/break-expression") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Break_expression extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Break_expression extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInBreak_expression() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/break-expression"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/break-expression"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/break-expression/p-1") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_1 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_1 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_1() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/break-expression/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/break-expression/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/break-expression/p-1/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/break-expression/p-1/neg/1.1.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/break-expression/p-1/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/break-expression/p-1/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/continue-expression") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Continue_expression extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Continue_expression extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInContinue_expression() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/continue-expression"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/continue-expression"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/continue-expression/p-1") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_1 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_1 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_1() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/continue-expression/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/continue-expression/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/continue-expression/p-1/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/continue-expression/p-1/neg/1.1.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/continue-expression/p-1/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/continue-expression/p-1/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/p-2") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_2 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_2 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_2() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/p-2"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/p-2"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/p-2/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/p-2/pos/1.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/p-2/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/p-2/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/return-expressions") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Return_expressions extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Return_expressions extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInReturn_expressions() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/return-expressions"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/return-expressions"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/return-expressions/p-1") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_1 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_1 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_1() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/return-expressions/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/return-expressions/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/return-expressions/p-1/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/return-expressions/p-1/pos/1.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/return-expressions/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/return-expressions/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/return-expressions/p-4") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_4 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_4 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_4() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/return-expressions/p-4"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/return-expressions/p-4"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/return-expressions/p-4/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/return-expressions/p-4/neg/1.1.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/return-expressions/p-4/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/jump-expressions/return-expressions/p-4/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/logical-conjunction-expression") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Logical_conjunction_expression extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Logical_conjunction_expression extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInLogical_conjunction_expression() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/logical-conjunction-expression"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/logical-conjunction-expression"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/logical-conjunction-expression/p-2") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_2 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_2 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_2() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/logical-conjunction-expression/p-2"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/logical-conjunction-expression/p-2"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/logical-conjunction-expression/p-2/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/logical-conjunction-expression/p-2/neg/1.1.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/logical-conjunction-expression/p-2/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/logical-conjunction-expression/p-2/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/logical-conjunction-expression/p-2/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/logical-conjunction-expression/p-2/pos/1.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/logical-conjunction-expression/p-2/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/logical-conjunction-expression/p-2/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/logical-disjunction-expression") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Logical_disjunction_expression extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Logical_disjunction_expression extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInLogical_disjunction_expression() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/logical-disjunction-expression"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/logical-disjunction-expression"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/logical-disjunction-expression/p-2") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_2 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_2 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_2() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/logical-disjunction-expression/p-2"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/logical-disjunction-expression/p-2"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/logical-disjunction-expression/p-2/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/logical-disjunction-expression/p-2/neg/1.1.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/logical-disjunction-expression/p-2/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/logical-disjunction-expression/p-2/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/logical-disjunction-expression/p-2/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/logical-disjunction-expression/p-2/pos/1.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/logical-disjunction-expression/p-2/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/logical-disjunction-expression/p-2/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/multiplicative-expression") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Multiplicative_expression extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Multiplicative_expression extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInMultiplicative_expression() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/multiplicative-expression"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/multiplicative-expression"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/multiplicative-expression/p-5") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_5 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_5 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_5() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/multiplicative-expression/p-5"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/multiplicative-expression/p-5"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/multiplicative-expression/p-5/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/multiplicative-expression/p-5/pos/1.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/multiplicative-expression/p-5/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/multiplicative-expression/p-5/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/not-null-assertion-expression") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Not_null_assertion_expression extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Not_null_assertion_expression extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInNot_null_assertion_expression() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/not-null-assertion-expression"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/not-null-assertion-expression"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/not-null-assertion-expression/p-2") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_2 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_2 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_2() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/not-null-assertion-expression/p-2"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/not-null-assertion-expression/p-2"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/not-null-assertion-expression/p-2/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/not-null-assertion-expression/p-2/pos/1.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/not-null-assertion-expression/p-2/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/not-null-assertion-expression/p-2/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/not-null-assertion-expression/p-3") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_3 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_3 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_3() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/not-null-assertion-expression/p-3"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/not-null-assertion-expression/p-3"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/not-null-assertion-expression/p-3/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/not-null-assertion-expression/p-3/pos/1.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/not-null-assertion-expression/p-3/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/not-null-assertion-expression/p-3/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Prefix_expressions extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Prefix_expressions extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInPrefix_expressions() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/logical-not-expression") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Logical_not_expression extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Logical_not_expression extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInLogical_not_expression() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/logical-not-expression"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/logical-not-expression"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/logical-not-expression/p-3") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_3 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_3 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_3() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/logical-not-expression/p-3"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/logical-not-expression/p-3"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/logical-not-expression/p-3/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/logical-not-expression/p-3/pos/1.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/logical-not-expression/p-3/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/logical-not-expression/p-3/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-decrement-expression") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Prefix_decrement_expression extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Prefix_decrement_expression extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInPrefix_decrement_expression() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-decrement-expression"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-decrement-expression"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-decrement-expression/p-4") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_4 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_4 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_4() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-decrement-expression/p-4"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-decrement-expression/p-4"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-decrement-expression/p-4/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-decrement-expression/p-4/neg/1.1.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-decrement-expression/p-4/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-decrement-expression/p-4/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-decrement-expression/p-5") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_5 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_5 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_5() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-decrement-expression/p-5"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-decrement-expression/p-5"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-decrement-expression/p-5/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("2.1.kt") public void test2_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-decrement-expression/p-5/neg/2.1.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-decrement-expression/p-5/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-decrement-expression/p-5/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-increment-expression") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Prefix_increment_expression extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Prefix_increment_expression extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInPrefix_increment_expression() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-increment-expression"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-increment-expression"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-increment-expression/p-4") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_4 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_4 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_4() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-increment-expression/p-4"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-increment-expression/p-4"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-increment-expression/p-4/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-increment-expression/p-4/neg/1.1.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-increment-expression/p-4/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-increment-expression/p-4/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-increment-expression/p-5") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_5 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_5 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_5() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-increment-expression/p-5"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-increment-expression/p-5"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-increment-expression/p-5/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("2.1.kt") public void test2_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-increment-expression/p-5/neg/2.1.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-increment-expression/p-5/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-increment-expression/p-5/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/unary-minus-expression") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Unary_minus_expression extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Unary_minus_expression extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInUnary_minus_expression() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/unary-minus-expression"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/unary-minus-expression"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/unary-minus-expression/p-3") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_3 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_3 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_3() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/unary-minus-expression/p-3"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/unary-minus-expression/p-3"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/unary-minus-expression/p-3/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/unary-minus-expression/p-3/pos/1.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/unary-minus-expression/p-3/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/unary-minus-expression/p-3/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/unary-plus-expression") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Unary_plus_expression extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Unary_plus_expression extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInUnary_plus_expression() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/unary-plus-expression"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/unary-plus-expression"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/unary-plus-expression/p-3") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_3 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_3 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_3() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/unary-plus-expression/p-3"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/unary-plus-expression/p-3"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/unary-plus-expression/p-3/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/unary-plus-expression/p-3/pos/1.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/unary-plus-expression/p-3/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/unary-plus-expression/p-3/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/range-expression") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Range_expression extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Range_expression extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInRange_expression() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/range-expression"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/range-expression"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/range-expression/p-4") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_4 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_4 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_4() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/range-expression/p-4"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/range-expression/p-4"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/range-expression/p-4/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/range-expression/p-4/pos/1.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/range-expression/p-4/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/range-expression/p-4/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Try_expression extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Try_expression extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInTry_expression() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-1") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_1 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_1 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_1() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-1/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-1/neg/1.1.kt"); } + @Test @TestMetadata("3.1.kt") public void test3_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-1/neg/3.1.kt"); } + @Test @TestMetadata("4.1.kt") public void test4_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-1/neg/4.1.kt"); } + @Test @TestMetadata("5.1.kt") public void test5_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-1/neg/5.1.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-1/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-1/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-1/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-1/pos/1.1.kt"); } + @Test @TestMetadata("3.1.kt") public void test3_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-1/pos/3.1.kt"); } + @Test @TestMetadata("3.2.kt") public void test3_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-1/pos/3.2.kt"); } + @Test @TestMetadata("4.1.kt") public void test4_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-1/pos/4.1.kt"); } + @Test @TestMetadata("4.2.kt") public void test4_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-1/pos/4.2.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-2") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_2 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_2 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_2() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-2"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-2"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-2/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("2.1.kt") public void test2_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-2/pos/2.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-2/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-2/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-5") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_5 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_5 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_5() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-5"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-5"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-5/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-5/pos/1.1.kt"); } + @Test @TestMetadata("2.1.kt") public void test2_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-5/pos/2.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-5/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-5/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-8") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_8 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_8 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_8() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-8"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-8"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-8/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-8/neg/1.1.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-8/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-8/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-8/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-8/pos/1.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-8/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/try-expression/p-8/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/type-checking-and-containment-checking-expressions") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Type_checking_and_containment_checking_expressions extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Type_checking_and_containment_checking_expressions extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInType_checking_and_containment_checking_expressions() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/type-checking-and-containment-checking-expressions"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/type-checking-and-containment-checking-expressions"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/type-checking-and-containment-checking-expressions/containment-checking-expression") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Containment_checking_expression extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Containment_checking_expression extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInContainment_checking_expression() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/type-checking-and-containment-checking-expressions/containment-checking-expression"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/type-checking-and-containment-checking-expressions/containment-checking-expression"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/type-checking-and-containment-checking-expressions/containment-checking-expression/p-5") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_5 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_5 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_5() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/type-checking-and-containment-checking-expressions/containment-checking-expression/p-5"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/type-checking-and-containment-checking-expressions/containment-checking-expression/p-5"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/type-checking-and-containment-checking-expressions/containment-checking-expression/p-5/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("2.1.kt") public void test2_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/type-checking-and-containment-checking-expressions/containment-checking-expression/p-5/pos/2.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/type-checking-and-containment-checking-expressions/containment-checking-expression/p-5/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/type-checking-and-containment-checking-expressions/containment-checking-expression/p-5/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/type-checking-and-containment-checking-expressions/type-checking-expression") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Type_checking_expression extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Type_checking_expression extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInType_checking_expression() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/type-checking-and-containment-checking-expressions/type-checking-expression"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/type-checking-and-containment-checking-expressions/type-checking-expression"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/type-checking-and-containment-checking-expressions/type-checking-expression/p-4") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_4 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_4 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_4() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/type-checking-and-containment-checking-expressions/type-checking-expression/p-4"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/type-checking-and-containment-checking-expressions/type-checking-expression/p-4"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/type-checking-and-containment-checking-expressions/type-checking-expression/p-4/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/type-checking-and-containment-checking-expressions/type-checking-expression/p-4/pos/1.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/type-checking-and-containment-checking-expressions/type-checking-expression/p-4/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/type-checking-and-containment-checking-expressions/type-checking-expression/p-4/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class When_expression extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class When_expression extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInWhen_expression() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Exhaustive_when_expressions extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Exhaustive_when_expressions extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInExhaustive_when_expressions() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_2 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_2 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_2() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("11.1.kt") public void test11_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/neg/11.1.kt"); } + @Test @TestMetadata("11.2.kt") public void test11_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/neg/11.2.kt"); } + @Test @TestMetadata("11.3.kt") public void test11_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/neg/11.3.kt"); } + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/neg/1.1.kt"); } + @Test @TestMetadata("1.2.kt") public void test1_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/neg/1.2.kt"); } + @Test @TestMetadata("3.1.kt") public void test3_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/neg/3.1.kt"); } + @Test @TestMetadata("9.1.kt") public void test9_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/neg/9.1.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("10.1.kt") public void test10_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/pos/10.1.kt"); } + @Test @TestMetadata("11.1.kt") public void test11_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/pos/11.1.kt"); } + @Test @TestMetadata("11.2.kt") public void test11_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/pos/11.2.kt"); } + @Test @TestMetadata("11.3.kt") public void test11_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/pos/11.3.kt"); } + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/pos/1.1.kt"); } + @Test @TestMetadata("1.2.kt") public void test1_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/pos/1.2.kt"); } + @Test @TestMetadata("1.3.kt") public void test1_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/pos/1.3.kt"); } + @Test @TestMetadata("3.1.kt") public void test3_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/pos/3.1.kt"); } + @Test @TestMetadata("7.1.kt") public void test7_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/pos/7.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/exhaustive-when-expressions/p-2/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-1") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_1 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_1 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_1() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-1/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("3.1.kt") public void test3_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-1/pos/3.1.kt"); } + @Test @TestMetadata("3.2.kt") public void test3_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-1/pos/3.2.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-2") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_2 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_2 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_2() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-2"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-2"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-2/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("2.1.kt") public void test2_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-2/neg/2.1.kt"); } + @Test @TestMetadata("2.2.kt") public void test2_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-2/neg/2.2.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-2/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-2/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-2/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-2/pos/1.1.kt"); } + @Test @TestMetadata("1.2.kt") public void test1_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-2/pos/1.2.kt"); } + @Test @TestMetadata("2.1.kt") public void test2_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-2/pos/2.1.kt"); } + @Test @TestMetadata("2.2.kt") public void test2_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-2/pos/2.2.kt"); } + @Test @TestMetadata("2.3.kt") public void test2_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-2/pos/2.3.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-2/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-2/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-3") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_3 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_3 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_3() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-3"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-3"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-3/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("2.1.kt") public void test2_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-3/neg/2.1.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-3/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-3/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-4") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_4 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_4 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_4() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-4"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-4"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-4/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-4/neg/1.1.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-4/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-4/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-4/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-4/pos/1.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-4/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-4/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-5") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_5 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_5 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_5() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-5"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-5"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-5/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-5/pos/1.1.kt"); } + @Test @TestMetadata("1.2.kt") public void test1_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-5/pos/1.2.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-5/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-5/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_6 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_6 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_6() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/1.1.kt"); } + @Test @TestMetadata("1.2.kt") public void test1_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/1.2.kt"); } + @Test @TestMetadata("3.1.kt") public void test3_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/3.1.kt"); } + @Test @TestMetadata("3.2.kt") public void test3_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/3.2.kt"); } + @Test @TestMetadata("7.1.kt") public void test7_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/7.1.kt"); } + @Test @TestMetadata("7.2.kt") public void test7_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/7.2.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/1.1.kt"); } + @Test @TestMetadata("1.2.kt") public void test1_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/1.2.kt"); } + @Test @TestMetadata("1.3.kt") public void test1_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/1.3.kt"); } + @Test @TestMetadata("1.4.kt") public void test1_4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/1.4.kt"); } + @Test @TestMetadata("3.1.kt") public void test3_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/3.1.kt"); } + @Test @TestMetadata("3.2.kt") public void test3_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/3.2.kt"); } + @Test @TestMetadata("5.1.kt") public void test5_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/5.1.kt"); } + @Test @TestMetadata("5.2.kt") public void test5_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/5.2.kt"); } + @Test @TestMetadata("6.1.kt") public void test6_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/6.1.kt"); } + @Test @TestMetadata("7.1.kt") public void test7_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/7.1.kt"); } + @Test @TestMetadata("7.2.kt") public void test7_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/7.2.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Overload_resolution extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Overload_resolution extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInOverload_resolution() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "c-level-partition", "determining-function-applicability-for-a-specific-call/rationale"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "c-level-partition", "determining-function-applicability-for-a-specific-call/rationale"); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Building_the_overload_candidate_set_ocs extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Building_the_overload_candidate_set_ocs extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInBuilding_the_overload_candidate_set_ocs() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-an-explicit-receiver") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Call_with_an_explicit_receiver extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Call_with_an_explicit_receiver extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInCall_with_an_explicit_receiver() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-an-explicit-receiver"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-an-explicit-receiver"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-an-explicit-receiver/call-with-an-explicit-type-receiver") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Call_with_an_explicit_type_receiver extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Call_with_an_explicit_type_receiver extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInCall_with_an_explicit_type_receiver() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-an-explicit-receiver/call-with-an-explicit-type-receiver"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-an-explicit-receiver/call-with-an-explicit-type-receiver"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-an-explicit-receiver/call-with-an-explicit-type-receiver/p-3") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_3 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_3 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_3() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-an-explicit-receiver/call-with-an-explicit-type-receiver/p-3"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-an-explicit-receiver/call-with-an-explicit-type-receiver/p-3"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-an-explicit-receiver/call-with-an-explicit-type-receiver/p-3/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("2.1.kt") public void test2_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-an-explicit-receiver/call-with-an-explicit-type-receiver/p-3/pos/2.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-an-explicit-receiver/call-with-an-explicit-type-receiver/p-3/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-an-explicit-receiver/call-with-an-explicit-type-receiver/p-3/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-an-explicit-receiver/p-6") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_6 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_6 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_6() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-an-explicit-receiver/p-6"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-an-explicit-receiver/p-6"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-an-explicit-receiver/p-6/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-an-explicit-receiver/p-6/pos/1.1.kt"); } + @Test @TestMetadata("1.2.kt") public void test1_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-an-explicit-receiver/p-6/pos/1.2.kt"); } + @Test @TestMetadata("1.3.kt") public void test1_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-an-explicit-receiver/p-6/pos/1.3.kt"); } + @Test @TestMetadata("1.4.kt") public void test1_4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-an-explicit-receiver/p-6/pos/1.4.kt"); } + @Test @TestMetadata("1.5.kt") public void test1_5() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-an-explicit-receiver/p-6/pos/1.5.kt"); } + @Test @TestMetadata("2.1.kt") public void test2_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-an-explicit-receiver/p-6/pos/2.1.kt"); } + @Test @TestMetadata("2.2.kt") public void test2_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-an-explicit-receiver/p-6/pos/2.2.kt"); } + @Test @TestMetadata("2.3.kt") public void test2_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-an-explicit-receiver/p-6/pos/2.3.kt"); } + @Test @TestMetadata("2.4.kt") public void test2_4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-an-explicit-receiver/p-6/pos/2.4.kt"); } + @Test @TestMetadata("3.1.kt") public void test3_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-an-explicit-receiver/p-6/pos/3.1.kt"); } + @Test @TestMetadata("3.2.kt") public void test3_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-an-explicit-receiver/p-6/pos/3.2.kt"); } + @Test @TestMetadata("4.1.kt") public void test4_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-an-explicit-receiver/p-6/pos/4.1.kt"); } + @Test @TestMetadata("4.2.kt") public void test4_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-an-explicit-receiver/p-6/pos/4.2.kt"); } + @Test @TestMetadata("5.1.kt") public void test5_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-an-explicit-receiver/p-6/pos/5.1.kt"); } + @Test @TestMetadata("5.2.kt") public void test5_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-an-explicit-receiver/p-6/pos/5.2.kt"); } + @Test @TestMetadata("6.1.kt") public void test6_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-an-explicit-receiver/p-6/pos/6.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-an-explicit-receiver/p-6/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-an-explicit-receiver/p-6/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Call_with_named_parameters extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Call_with_named_parameters extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInCall_with_named_parameters() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_1 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_1 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_1() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("2.1.kt") public void test2_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.1.kt"); } + @Test @TestMetadata("2.10.kt") public void test2_10() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.10.kt"); } + @Test @TestMetadata("2.11.kt") public void test2_11() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.11.kt"); } + @Test @TestMetadata("2.12.kt") public void test2_12() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.12.kt"); } + @Test @TestMetadata("2.13.kt") public void test2_13() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.13.kt"); } + @Test @TestMetadata("2.14.kt") public void test2_14() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.14.kt"); } + @Test @TestMetadata("2.15.kt") public void test2_15() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.15.kt"); } + @Test @TestMetadata("2.16.kt") public void test2_16() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.16.kt"); } + @Test @TestMetadata("2.2.kt") public void test2_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.2.kt"); } + @Test @TestMetadata("2.3.kt") public void test2_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.3.kt"); } + @Test @TestMetadata("2.4.kt") public void test2_4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.4.kt"); } + @Test @TestMetadata("2.5.kt") public void test2_5() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.5.kt"); } + @Test @TestMetadata("2.6.kt") public void test2_6() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.6.kt"); } + @Test @TestMetadata("2.7.kt") public void test2_7() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.7.kt"); } + @Test @TestMetadata("2.8.kt") public void test2_8() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.8.kt"); } + @Test @TestMetadata("2.9.kt") public void test2_9() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.9.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-5") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_5 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_5 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_5() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-5"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-5"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-5/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-5/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-5/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-specified-type-parameters") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Call_with_specified_type_parameters extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Call_with_specified_type_parameters extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInCall_with_specified_type_parameters() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-specified-type-parameters"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-specified-type-parameters"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-specified-type-parameters/p-2") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_2 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_2 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_2() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-specified-type-parameters/p-2"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-specified-type-parameters/p-2"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-specified-type-parameters/p-2/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-specified-type-parameters/p-2/pos/1.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-specified-type-parameters/p-2/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-specified-type-parameters/p-2/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Call_with_trailing_lambda_expressions extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Call_with_trailing_lambda_expressions extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInCall_with_trailing_lambda_expressions() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_1 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_1 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_1() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("2.1.kt") public void test2_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.1.kt"); } + @Test @TestMetadata("2.10.kt") public void test2_10() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.10.kt"); } + @Test @TestMetadata("2.11.kt") public void test2_11() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.11.kt"); } + @Test @TestMetadata("2.12.kt") public void test2_12() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.12.kt"); } + @Test @TestMetadata("2.13.kt") public void test2_13() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.13.kt"); } + @Test @TestMetadata("2.14.kt") public void test2_14() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.14.kt"); } + @Test @TestMetadata("2.15.kt") public void test2_15() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.15.kt"); } + @Test @TestMetadata("2.16.kt") public void test2_16() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.16.kt"); } + @Test @TestMetadata("2.17.kt") public void test2_17() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.17.kt"); } + @Test @TestMetadata("2.18.kt") public void test2_18() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.18.kt"); } + @Test @TestMetadata("2.19.kt") public void test2_19() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.19.kt"); } + @Test @TestMetadata("2.2.kt") public void test2_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.2.kt"); } + @Test @TestMetadata("2.20.kt") public void test2_20() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.20.kt"); } + @Test @TestMetadata("2.21.kt") public void test2_21() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.21.kt"); } + @Test @TestMetadata("2.3.kt") public void test2_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.3.kt"); } + @Test @TestMetadata("2.4.kt") public void test2_4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.4.kt"); } + @Test @TestMetadata("2.5.kt") public void test2_5() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.5.kt"); } + @Test @TestMetadata("2.6.kt") public void test2_6() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.6.kt"); } + @Test @TestMetadata("2.7.kt") public void test2_7() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.7.kt"); } + @Test @TestMetadata("2.8.kt") public void test2_8() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.8.kt"); } + @Test @TestMetadata("2.9.kt") public void test2_9() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.9.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Call_without_an_explicit_receiver extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Call_without_an_explicit_receiver extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInCall_without_an_explicit_receiver() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_5 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_5 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_5() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("2.3.kt") public void test2_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.3.kt"); } + @Test @TestMetadata("2.4.kt") public void test2_4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.4.kt"); } + @Test @TestMetadata("2.5.kt") public void test2_5() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.5.kt"); } + @Test @TestMetadata("4.1.kt") public void test4_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/4.1.kt"); } + @Test @TestMetadata("4.2.kt") public void test4_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/4.2.kt"); } + @Test @TestMetadata("6.1.kt") public void test6_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/6.1.kt"); } + @Test @TestMetadata("6.4.kt") public void test6_4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/6.4.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("2.1.kt") public void test2_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.1.kt"); } + @Test @TestMetadata("2.2.kt") public void test2_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.2.kt"); } + @Test @TestMetadata("2.3.kt") public void test2_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.3.kt"); } + @Test @TestMetadata("2.4.kt") public void test2_4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.4.kt"); } + @Test @TestMetadata("2.5.kt") public void test2_5() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.5.kt"); } + @Test @TestMetadata("4.1.kt") public void test4_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.1.kt"); } + @Test @TestMetadata("4.2.kt") public void test4_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.2.kt"); } + @Test @TestMetadata("4.3.kt") public void test4_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.3.kt"); } + @Test @TestMetadata("4.4.kt") public void test4_4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.4.kt"); } + @Test @TestMetadata("4.5.kt") public void test4_5() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.5.kt"); } + @Test @TestMetadata("4.6.kt") public void test4_6() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.6.kt"); } + @Test @TestMetadata("5.1.kt") public void test5_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/5.1.kt"); } + @Test @TestMetadata("6.1.kt") public void test6_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/6.1.kt"); } + @Test @TestMetadata("6.2.kt") public void test6_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/6.2.kt"); } + @Test @TestMetadata("6.3.kt") public void test6_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/6.3.kt"); } + @Test @TestMetadata("7.1.kt") public void test7_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/7.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Infix_function_call extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Infix_function_call extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInInfix_function_call() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_2 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_2 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_2() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/neg/1.1.kt"); } + @Test @TestMetadata("1.2.kt") public void test1_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/neg/1.2.kt"); } + @Test @TestMetadata("1.3.kt") public void test1_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/neg/1.3.kt"); } + @Test @TestMetadata("1.4.kt") public void test1_4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/neg/1.4.kt"); } + @Test @TestMetadata("4.5.kt") public void test4_5() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/neg/4.5.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("4.1.kt") public void test4_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/pos/4.1.kt"); } + @Test @TestMetadata("4.2.kt") public void test4_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/pos/4.2.kt"); } + @Test @TestMetadata("4.3.kt") public void test4_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/pos/4.3.kt"); } + @Test @TestMetadata("4.4.kt") public void test4_4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/pos/4.4.kt"); } + @Test @TestMetadata("4.5.kt") public void test4_5() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/pos/4.5.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Operator_call extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Operator_call extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInOperator_call() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_1 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_1 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_1() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("2.1.kt") public void test2_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.1.kt"); } + @Test @TestMetadata("2.2.kt") public void test2_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.2.kt"); } + @Test @TestMetadata("2.4.kt") public void test2_4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.4.kt"); } + @Test @TestMetadata("2.5.kt") public void test2_5() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.5.kt"); } + @Test @TestMetadata("2.6.kt") public void test2_6() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.6.kt"); } + @Test @TestMetadata("2.7.kt") public void test2_7() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.7.kt"); } + @Test @TestMetadata("2.8.kt") public void test2_8() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.8.kt"); } + @Test @TestMetadata("2.9.kt") public void test2_9() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.9.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("2.1.kt") public void test2_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.1.kt"); } + @Test @TestMetadata("2.2.kt") public void test2_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos/2.2.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_2 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_2 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_2() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("3.1.kt") public void test3_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.1.kt"); } + @Test @TestMetadata("3.2.kt") public void test3_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.2.kt"); } + @Test @TestMetadata("3.3.kt") public void test3_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.3.kt"); } + @Test @TestMetadata("3.4.kt") public void test3_4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.4.kt"); } + @Test @TestMetadata("3.5.kt") public void test3_5() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.5.kt"); } + @Test @TestMetadata("3.6.kt") public void test3_6() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.6.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-4") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_4 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_4 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_4() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-4"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-4"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-4/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-4/neg/1.1.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-4/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-4/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-4/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-4/pos/1.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-4/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-4/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/callables-and-invoke-convention") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Callables_and_invoke_convention extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Callables_and_invoke_convention extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInCallables_and_invoke_convention() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/callables-and-invoke-convention"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/callables-and-invoke-convention"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/callables-and-invoke-convention/p-2") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_2 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_2 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_2() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/callables-and-invoke-convention/p-2"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/callables-and-invoke-convention/p-2"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/callables-and-invoke-convention/p-2/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("10.1.kt") public void test10_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/callables-and-invoke-convention/p-2/pos/10.1.kt"); } + @Test @TestMetadata("8.1.kt") public void test8_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/callables-and-invoke-convention/p-2/pos/8.1.kt"); } + @Test @TestMetadata("9.1.kt") public void test9_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/callables-and-invoke-convention/p-2/pos/9.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/callables-and-invoke-convention/p-2/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/callables-and-invoke-convention/p-2/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Choosing_the_most_specific_candidate_from_the_overload_candidate_set extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Choosing_the_most_specific_candidate_from_the_overload_candidate_set extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInChoosing_the_most_specific_candidate_from_the_overload_candidate_set() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Algorithm_of_msc_selection extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Algorithm_of_msc_selection extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInAlgorithm_of_msc_selection() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-11") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_11 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_11 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_11() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-11"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-11"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-11/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-11/pos/1.1.kt"); } + @Test @TestMetadata("1.2.kt") public void test1_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-11/pos/1.2.kt"); } + @Test @TestMetadata("4.1.kt") public void test4_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-11/pos/4.1.kt"); } + @Test @TestMetadata("4.2.kt") public void test4_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-11/pos/4.2.kt"); } + @Test @TestMetadata("4.3.kt") public void test4_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-11/pos/4.3.kt"); } + @Test @TestMetadata("4.4.kt") public void test4_4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-11/pos/4.4.kt"); } + @Test @TestMetadata("4.5.kt") public void test4_5() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-11/pos/4.5.kt"); } + @Test @TestMetadata("5.1.kt") public void test5_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-11/pos/5.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-11/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-11/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-12") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_12 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_12 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_12() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-12"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-12"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-12/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("2.1.kt") public void test2_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-12/pos/2.1.kt"); } + @Test @TestMetadata("2.2.kt") public void test2_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-12/pos/2.2.kt"); } + @Test @TestMetadata("2.3.kt") public void test2_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-12/pos/2.3.kt"); } + @Test @TestMetadata("2.4.kt") public void test2_4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-12/pos/2.4.kt"); } + @Test @TestMetadata("2.5.kt") public void test2_5() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-12/pos/2.5.kt"); } + @Test @TestMetadata("2.6.kt") public void test2_6() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-12/pos/2.6.kt"); } + @Test @TestMetadata("2.7.kt") public void test2_7() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-12/pos/2.7.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-12/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-12/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-14") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_14 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_14 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_14() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-14"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-14"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-14/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-14/neg/1.1.kt"); } + @Test @TestMetadata("1.2.kt") public void test1_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-14/neg/1.2.kt"); } + @Test @TestMetadata("1.3.kt") public void test1_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-14/neg/1.3.kt"); } + @Test @TestMetadata("1.4.kt") public void test1_4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-14/neg/1.4.kt"); } + @Test @TestMetadata("1.5.kt") public void test1_5() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-14/neg/1.5.kt"); } + @Test @TestMetadata("1.6.kt") public void test1_6() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-14/neg/1.6.kt"); } + @Test @TestMetadata("1.7.kt") public void test1_7() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-14/neg/1.7.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-14/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-14/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-17") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_17 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_17 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_17() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-17"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-17"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-17/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("2.1.kt") public void test2_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-17/neg/2.1.kt"); } + @Test @TestMetadata("2.2.kt") public void test2_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-17/neg/2.2.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-17/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-17/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-3") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_3 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_3 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_3() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-3"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-3"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-3/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-3/pos/1.1.kt"); } + @Test @TestMetadata("1.2.kt") public void test1_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-3/pos/1.2.kt"); } + @Test @TestMetadata("1.3.kt") public void test1_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-3/pos/1.3.kt"); } + @Test @TestMetadata("1.4.kt") public void test1_4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-3/pos/1.4.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-3/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-3/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_9 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_9 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_9() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("2.1.kt") public void test2_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg/2.1.kt"); } + @Test @TestMetadata("2.2.kt") public void test2_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg/2.2.kt"); } + @Test @TestMetadata("2.3.kt") public void test2_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg/2.3.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/pos/1.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/rationale-1") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Rationale_1 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Rationale_1 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInRationale_1() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/rationale-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/rationale-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/rationale-1/p-2") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_2 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_2 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_2() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/rationale-1/p-2"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/rationale-1/p-2"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/rationale-1/p-2/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/rationale-1/p-2/pos/1.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/rationale-1/p-2/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/rationale-1/p-2/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/rationale-1/p-3") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_3 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_3 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_3() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/rationale-1/p-3"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/rationale-1/p-3"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/rationale-1/p-3/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/rationale-1/p-3/neg/1.1.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/rationale-1/p-3/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/rationale-1/p-3/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Determining_function_applicability_for_a_specific_call extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Determining_function_applicability_for_a_specific_call extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInDetermining_function_applicability_for_a_specific_call() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "rationale"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "rationale"); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Description extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Description extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInDescription() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description/p-2") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_2 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_2 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_2() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description/p-2"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description/p-2"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description/p-2/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("2.1.kt") public void test2_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description/p-2/neg/2.1.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description/p-2/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description/p-2/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Receivers extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Receivers extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInReceivers() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_5 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_5 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_5() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("2.1.kt") public void test2_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5/pos/2.1.kt"); } + @Test @TestMetadata("3.1.kt") public void test3_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5/pos/3.1.kt"); } + @Test @TestMetadata("5.1.kt") public void test5_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5/pos/5.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Resolving_callable_references extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Resolving_callable_references extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInResolving_callable_references() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/bidirectional-resolution-for-callable-calls") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Bidirectional_resolution_for_callable_calls extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Bidirectional_resolution_for_callable_calls extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInBidirectional_resolution_for_callable_calls() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/bidirectional-resolution-for-callable-calls"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/bidirectional-resolution-for-callable-calls"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/bidirectional-resolution-for-callable-calls/p-1") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_1 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_1 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_1() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/bidirectional-resolution-for-callable-calls/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/bidirectional-resolution-for-callable-calls/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/bidirectional-resolution-for-callable-calls/p-1/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/bidirectional-resolution-for-callable-calls/p-1/pos/1.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/bidirectional-resolution-for-callable-calls/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/bidirectional-resolution-for-callable-calls/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/bidirectional-resolution-for-callable-calls/p-3") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_3 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_3 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_3() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/bidirectional-resolution-for-callable-calls/p-3"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/bidirectional-resolution-for-callable-calls/p-3"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/bidirectional-resolution-for-callable-calls/p-3/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/bidirectional-resolution-for-callable-calls/p-3/neg/1.1.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/bidirectional-resolution-for-callable-calls/p-3/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/bidirectional-resolution-for-callable-calls/p-3/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/bidirectional-resolution-for-callable-calls/p-3/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/bidirectional-resolution-for-callable-calls/p-3/pos/1.1.kt"); } + @Test @TestMetadata("1.2.kt") public void test1_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/bidirectional-resolution-for-callable-calls/p-3/pos/1.2.kt"); } + @Test @TestMetadata("1.3.kt") public void test1_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/bidirectional-resolution-for-callable-calls/p-3/pos/1.3.kt"); } + @Test @TestMetadata("1.4.kt") public void test1_4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/bidirectional-resolution-for-callable-calls/p-3/pos/1.4.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/bidirectional-resolution-for-callable-calls/p-3/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/bidirectional-resolution-for-callable-calls/p-3/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/p-2") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_2 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_2 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_2() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/p-2"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/p-2"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/p-2/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("2.1.kt") public void test2_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/p-2/pos/2.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/p-2/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/p-2/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Resolving_callable_references_not_used_as_arguments_to_a_call extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Resolving_callable_references_not_used_as_arguments_to_a_call extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInResolving_callable_references_not_used_as_arguments_to_a_call() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_1 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_1 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_1() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/neg/1.1.kt"); } + @Test @TestMetadata("1.2.kt") public void test1_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/neg/1.2.kt"); } + @Test @TestMetadata("1.3.kt") public void test1_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/neg/1.3.kt"); } + @Test @TestMetadata("1.4.kt") public void test1_4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/neg/1.4.kt"); } + @Test @TestMetadata("1.5.kt") public void test1_5() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/neg/1.5.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/pos/1.1.kt"); } + @Test @TestMetadata("1.2.kt") public void test1_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/pos/1.2.kt"); } + @Test @TestMetadata("1.3.kt") public void test1_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/pos/1.3.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } @@ -5371,317 +4937,263 @@ public class FirDiagnosticsTestSpecGenerated extends AbstractFirDiagnosticsTestS } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/statements") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Statements extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Statements extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInStatements() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "assignments/simple-assignments"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "assignments/simple-assignments"); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/statements/assignments") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Assignments extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Assignments extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInAssignments() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/assignments"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "simple-assignments"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/assignments"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "simple-assignments"); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/statements/assignments/operator-assignments") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Operator_assignments extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Operator_assignments extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInOperator_assignments() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/assignments/operator-assignments"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/assignments/operator-assignments"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/statements/assignments/operator-assignments/p-2") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_2 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_2 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_2() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/assignments/operator-assignments/p-2"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/assignments/operator-assignments/p-2"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/statements/assignments/operator-assignments/p-2/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/statements/assignments/operator-assignments/p-2/neg/1.1.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/assignments/operator-assignments/p-2/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/assignments/operator-assignments/p-2/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/statements/assignments/operator-assignments/p-2/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/statements/assignments/operator-assignments/p-2/pos/1.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/assignments/operator-assignments/p-2/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/assignments/operator-assignments/p-2/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/statements/assignments/p-1") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_1 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_1 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_1() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/assignments/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/assignments/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/statements/assignments/p-1/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("2.1.kt") public void test2_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/statements/assignments/p-1/neg/2.1.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/assignments/p-1/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/assignments/p-1/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/statements/assignments/p-2") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_2 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_2 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_2() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/assignments/p-2"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/assignments/p-2"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/statements/assignments/p-2/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/statements/assignments/p-2/neg/1.1.kt"); } + @Test @TestMetadata("1.2.kt") public void test1_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/statements/assignments/p-2/neg/1.2.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/assignments/p-2/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/assignments/p-2/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/statements/loop-statements") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Loop_statements extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Loop_statements extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInLoop_statements() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/loop-statements"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/loop-statements"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/statements/loop-statements/do-while-loop-statement") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Do_while_loop_statement extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Do_while_loop_statement extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInDo_while_loop_statement() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/loop-statements/do-while-loop-statement"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/loop-statements/do-while-loop-statement"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/statements/loop-statements/do-while-loop-statement/p-1") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_1 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_1 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_1() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/loop-statements/do-while-loop-statement/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/loop-statements/do-while-loop-statement/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/statements/loop-statements/do-while-loop-statement/p-1/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/statements/loop-statements/do-while-loop-statement/p-1/pos/1.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/loop-statements/do-while-loop-statement/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/loop-statements/do-while-loop-statement/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/statements/loop-statements/do-while-loop-statement/p-3") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_3 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_3 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_3() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/loop-statements/do-while-loop-statement/p-3"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/loop-statements/do-while-loop-statement/p-3"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/statements/loop-statements/do-while-loop-statement/p-3/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/statements/loop-statements/do-while-loop-statement/p-3/neg/1.1.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/loop-statements/do-while-loop-statement/p-3/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/loop-statements/do-while-loop-statement/p-3/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/statements/loop-statements/while-loop-statement") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class While_loop_statement extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class While_loop_statement extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInWhile_loop_statement() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/loop-statements/while-loop-statement"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/loop-statements/while-loop-statement"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/statements/loop-statements/while-loop-statement/p-1") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_1 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_1 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_1() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/loop-statements/while-loop-statement/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/loop-statements/while-loop-statement/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/statements/loop-statements/while-loop-statement/p-1/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/statements/loop-statements/while-loop-statement/p-1/pos/1.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/loop-statements/while-loop-statement/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/loop-statements/while-loop-statement/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/statements/loop-statements/while-loop-statement/p-3") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_3 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_3 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_3() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/loop-statements/while-loop-statement/p-3"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/loop-statements/while-loop-statement/p-3"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/statements/loop-statements/while-loop-statement/p-3/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/statements/loop-statements/while-loop-statement/p-3/neg/1.1.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/loop-statements/while-loop-statement/p-3/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/statements/loop-statements/while-loop-statement/p-3/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } @@ -5689,87 +5201,71 @@ public class FirDiagnosticsTestSpecGenerated extends AbstractFirDiagnosticsTestS } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-inference") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Type_inference extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Type_inference extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInType_inference() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-inference"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "local-type-inference", "smart-casts/smart-cast-types"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-inference"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "local-type-inference", "smart-casts/smart-cast-types"); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-inference/smart-casts") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Smart_casts extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Smart_casts extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInSmart_casts() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-inference/smart-casts"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "smart-cast-types"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-inference/smart-casts"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "smart-cast-types"); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-inference/smart-casts/smart-cast-sink-stability") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Smart_cast_sink_stability extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Smart_cast_sink_stability extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInSmart_cast_sink_stability() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-inference/smart-casts/smart-cast-sink-stability"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-inference/smart-casts/smart-cast-sink-stability"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-inference/smart-casts/smart-cast-sink-stability/p-5") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_5 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_5 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_5() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-inference/smart-casts/smart-cast-sink-stability/p-5"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-inference/smart-casts/smart-cast-sink-stability/p-5"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-inference/smart-casts/smart-cast-sink-stability/p-5/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/type-inference/smart-casts/smart-cast-sink-stability/p-5/neg/1.1.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-inference/smart-casts/smart-cast-sink-stability/p-5/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-inference/smart-casts/smart-cast-sink-stability/p-5/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-inference/smart-casts/smart-cast-sink-stability/p-5/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/type-inference/smart-casts/smart-cast-sink-stability/p-5/pos/1.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-inference/smart-casts/smart-cast-sink-stability/p-5/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-inference/smart-casts/smart-cast-sink-stability/p-5/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } @@ -5777,444 +5273,382 @@ public class FirDiagnosticsTestSpecGenerated extends AbstractFirDiagnosticsTestS } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Type_system extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Type_system extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInType_system() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "subtyping/subtyping-for-nullable-types", "type-kinds/type-parameters"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "subtyping/subtyping-for-nullable-types", "type-kinds/type-parameters"); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Introduction_1 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Introduction_1 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInIntroduction_1() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-6") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_6 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_6 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_6() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-6"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-6"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-6/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("2.1.kt") public void test2_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-6/neg/2.1.kt"); } + @Test @TestMetadata("2.2.kt") public void test2_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-6/neg/2.2.kt"); } + @Test @TestMetadata("2.3.kt") public void test2_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-6/neg/2.3.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-6/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-6/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-8") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_8 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_8 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_8() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-8"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-8"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-8/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-8/pos/1.1.kt"); } + @Test @TestMetadata("2.1.kt") public void test2_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-8/pos/2.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-8/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-8/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Subtyping extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Subtyping extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInSubtyping() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "subtyping-for-nullable-types"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "subtyping-for-nullable-types"); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-for-intersection-types") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Subtyping_for_intersection_types extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Subtyping_for_intersection_types extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInSubtyping_for_intersection_types() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-for-intersection-types"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-for-intersection-types"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-for-intersection-types/p-1") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_1 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_1 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_1() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-for-intersection-types/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-for-intersection-types/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-for-intersection-types/p-1/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-for-intersection-types/p-1/pos/1.1.kt"); } + @Test @TestMetadata("1.2.kt") public void test1_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-for-intersection-types/p-1/pos/1.2.kt"); } + @Test @TestMetadata("1.3.kt") public void test1_3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-for-intersection-types/p-1/pos/1.3.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-for-intersection-types/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-for-intersection-types/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-rules") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Subtyping_rules extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Subtyping_rules extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInSubtyping_rules() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-rules"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-rules"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-rules/p-2") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_2 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_2 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_2() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-rules/p-2"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-rules/p-2"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-rules/p-2/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-rules/p-2/pos/1.1.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-rules/p-2/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/subtyping/subtyping-rules/p-2/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/type-contexts-and-scopes") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Type_contexts_and_scopes extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Type_contexts_and_scopes extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInType_contexts_and_scopes() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/type-contexts-and-scopes"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/type-contexts-and-scopes"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/type-contexts-and-scopes/inner-and-nested-type-contexts") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Inner_and_nested_type_contexts extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Inner_and_nested_type_contexts extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInInner_and_nested_type_contexts() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/type-contexts-and-scopes/inner-and-nested-type-contexts"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/type-contexts-and-scopes/inner-and-nested-type-contexts"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/type-contexts-and-scopes/inner-and-nested-type-contexts/p-1") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_1 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_1 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_1() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/type-contexts-and-scopes/inner-and-nested-type-contexts/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/type-contexts-and-scopes/inner-and-nested-type-contexts/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/type-contexts-and-scopes/inner-and-nested-type-contexts/p-1/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/type-system/type-contexts-and-scopes/inner-and-nested-type-contexts/p-1/neg/1.1.kt"); } + @Test @TestMetadata("1.2.kt") public void test1_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/type-system/type-contexts-and-scopes/inner-and-nested-type-contexts/p-1/neg/1.2.kt"); } + @Test @TestMetadata("2.1.kt") public void test2_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/type-system/type-contexts-and-scopes/inner-and-nested-type-contexts/p-1/neg/2.1.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/type-contexts-and-scopes/inner-and-nested-type-contexts/p-1/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/type-contexts-and-scopes/inner-and-nested-type-contexts/p-1/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/type-contexts-and-scopes/inner-and-nested-type-contexts/p-1/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/type-system/type-contexts-and-scopes/inner-and-nested-type-contexts/p-1/pos/1.1.kt"); } + @Test @TestMetadata("1.2.kt") public void test1_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/type-system/type-contexts-and-scopes/inner-and-nested-type-contexts/p-1/pos/1.2.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/type-contexts-and-scopes/inner-and-nested-type-contexts/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/type-contexts-and-scopes/inner-and-nested-type-contexts/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Type_kinds extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Type_kinds extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInType_kinds() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "type-parameters"); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true, "type-parameters"); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Built_in_types extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Built_in_types extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInBuilt_in_types() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.any") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Kotlin_any extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Kotlin_any extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInKotlin_any() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.any"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.any"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.any/p-1") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_1 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_1 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_1() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.any/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.any/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.any/p-1/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.any/p-1/pos/1.1.kt"); } + @Test @TestMetadata("1.2.kt") public void test1_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.any/p-1/pos/1.2.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.any/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.any/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.nothing") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Kotlin_nothing extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Kotlin_nothing extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInKotlin_nothing() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.nothing"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.nothing"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.nothing/p-1") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class P_1 extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class P_1 extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInP_1() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.nothing/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.nothing/p-1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.nothing/p-1/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("2.1.kt") public void test2_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.nothing/p-1/neg/2.1.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.nothing/p-1/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.nothing/p-1/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.nothing/p-1/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.1.kt") public void test1_1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.nothing/p-1/pos/1.1.kt"); } + @Test @TestMetadata("1.2.kt") public void test1_2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.nothing/p-1/pos/1.2.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.nothing/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.nothing/p-1/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } @@ -6224,1804 +5658,1885 @@ public class FirDiagnosticsTestSpecGenerated extends AbstractFirDiagnosticsTestS } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class NotLinked extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class NotLinked extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInNotLinked() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/annotations") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Annotations extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Annotations extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInAnnotations() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/annotations"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/annotations"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/annotations/annotation-classes") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Annotation_classes extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Annotation_classes extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInAnnotation_classes() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/annotations/annotation-classes"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/annotations/annotation-classes"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/annotations/annotation-classes/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.kt") public void test1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/annotations/annotation-classes/neg/1.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/annotations/annotation-classes/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/annotations/annotation-classes/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Type_annotations extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Type_annotations extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInType_annotations() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.kt") public void test1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations/neg/1.kt"); } + @Test @TestMetadata("10.kt") public void test10() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations/neg/10.kt"); } + @Test @TestMetadata("11.kt") public void test11() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations/neg/11.kt"); } + @Test @TestMetadata("2.kt") public void test2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations/neg/2.kt"); } + @Test @TestMetadata("3.kt") public void test3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations/neg/3.kt"); } + @Test @TestMetadata("4.kt") public void test4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations/neg/4.kt"); } + @Test @TestMetadata("5.kt") public void test5() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations/neg/5.kt"); } + @Test @TestMetadata("6.kt") public void test6() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations/neg/6.kt"); } + @Test @TestMetadata("7.kt") public void test7() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations/neg/7.kt"); } + @Test @TestMetadata("8.kt") public void test8() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations/neg/8.kt"); } + @Test @TestMetadata("9.kt") public void test9() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations/neg/9.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/annotations/type-annotations/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/coercion-to-unit") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Coercion_to_unit extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Coercion_to_unit extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInCoercion_to_unit() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/coercion-to-unit"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/coercion-to-unit"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/coercion-to-unit/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.kt") public void test1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/coercion-to-unit/neg/1.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/coercion-to-unit/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/coercion-to-unit/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/contracts") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Contracts extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Contracts extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInContracts() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Analysis extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Analysis extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInAnalysis() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Common extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Common extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInCommon() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.kt") public void test1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common/neg/1.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.kt") public void test1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common/pos/1.kt"); } + @Test @TestMetadata("2.kt") public void test2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common/pos/2.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ControlFlow extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class ControlFlow extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInControlFlow() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Initialization extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Initialization extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInInitialization() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.kt") public void test1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization/neg/1.kt"); } + @Test @TestMetadata("2.kt") public void test2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization/neg/2.kt"); } + @Test @TestMetadata("3.kt") public void test3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization/neg/3.kt"); } + @Test @TestMetadata("4.kt") public void test4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization/neg/4.kt"); } + @Test @TestMetadata("5.kt") public void test5() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization/neg/5.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.kt") public void test1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization/pos/1.kt"); } + @Test @TestMetadata("2.kt") public void test2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization/pos/2.kt"); } + @Test @TestMetadata("3.kt") public void test3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization/pos/3.kt"); } + @Test @TestMetadata("4.kt") public void test4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization/pos/4.kt"); } + @Test @TestMetadata("5.kt") public void test5() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization/pos/5.kt"); } + @Test @TestMetadata("6.kt") public void test6() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization/pos/6.kt"); } + @Test @TestMetadata("7.kt") public void test7() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization/pos/7.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/initialization/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/unreachableCode") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class UnreachableCode extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class UnreachableCode extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInUnreachableCode() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/unreachableCode"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/unreachableCode"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/unreachableCode/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.kt") public void test1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/unreachableCode/neg/1.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/unreachableCode/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/unreachableCode/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/unreachableCode/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.kt") public void test1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/unreachableCode/pos/1.kt"); } + @Test @TestMetadata("2.kt") public void test2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/unreachableCode/pos/2.kt"); } + @Test @TestMetadata("3.kt") public void test3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/unreachableCode/pos/3.kt"); } + @Test @TestMetadata("4.kt") public void test4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/unreachableCode/pos/4.kt"); } + @Test @TestMetadata("5.kt") public void test5() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/unreachableCode/pos/5.kt"); } + @Test @TestMetadata("6.kt") public void test6() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/unreachableCode/pos/6.kt"); } + @Test @TestMetadata("7.kt") public void test7() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/unreachableCode/pos/7.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/unreachableCode/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/controlFlow/unreachableCode/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Smartcasts extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Smartcasts extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInSmartcasts() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.kt") public void test1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/1.kt"); } + @Test @TestMetadata("10.kt") public void test10() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/10.kt"); } + @Test @TestMetadata("11.kt") public void test11() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/11.kt"); } + @Test @TestMetadata("12.kt") public void test12() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/12.kt"); } + @Test @TestMetadata("13.kt") public void test13() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/13.kt"); } + @Test @TestMetadata("14.kt") public void test14() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/14.kt"); } + @Test @TestMetadata("15.kt") public void test15() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/15.kt"); } + @Test @TestMetadata("2.kt") public void test2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/2.kt"); } + @Test @TestMetadata("3.kt") public void test3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/3.kt"); } + @Test @TestMetadata("4.kt") public void test4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/4.kt"); } + @Test @TestMetadata("5.kt") public void test5() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/5.kt"); } + @Test @TestMetadata("6.kt") public void test6() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/6.kt"); } + @Test @TestMetadata("7.kt") public void test7() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/7.kt"); } + @Test @TestMetadata("8.kt") public void test8() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/8.kt"); } + @Test @TestMetadata("9.kt") public void test9() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/9.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.kt") public void test1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/1.kt"); } + @Test @TestMetadata("10.kt") public void test10() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/10.kt"); } + @Test @TestMetadata("11.kt") public void test11() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/11.kt"); } + @Test @TestMetadata("12.kt") public void test12() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/12.kt"); } + @Test @TestMetadata("13.kt") public void test13() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/13.kt"); } + @Test @TestMetadata("14.kt") public void test14() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/14.kt"); } + @Test @TestMetadata("2.kt") public void test2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/2.kt"); } + @Test @TestMetadata("3.kt") public void test3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/3.kt"); } + @Test @TestMetadata("4.kt") public void test4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/4.kt"); } + @Test @TestMetadata("5.kt") public void test5() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/5.kt"); } + @Test @TestMetadata("6.kt") public void test6() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/6.kt"); } + @Test @TestMetadata("7.kt") public void test7() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/7.kt"); } + @Test @TestMetadata("8.kt") public void test8() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/8.kt"); } + @Test @TestMetadata("9.kt") public void test9() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/9.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Declarations extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Declarations extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInDeclarations() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ContractBuilder extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class ContractBuilder extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInContractBuilder() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/common") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Common extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Common extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInCommon() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/common"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/common"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/common/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.kt") public void test1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/common/neg/1.kt"); } + @Test @TestMetadata("10.kt") public void test10() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/common/neg/10.kt"); } + @Test @TestMetadata("11.kt") public void test11() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/common/neg/11.kt"); } + @Test @TestMetadata("12.kt") public void test12() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/common/neg/12.kt"); } + @Test @TestMetadata("13.kt") public void test13() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/common/neg/13.kt"); } + @Test @TestMetadata("14.kt") public void test14() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/common/neg/14.kt"); } + @Test @TestMetadata("15.kt") public void test15() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/common/neg/15.kt"); } + @Test @TestMetadata("16.kt") public void test16() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/common/neg/16.kt"); } + @Test @TestMetadata("17.kt") public void test17() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/common/neg/17.kt"); } + @Test @TestMetadata("19.kt") public void test19() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/common/neg/19.kt"); } + @Test @TestMetadata("2.kt") public void test2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/common/neg/2.kt"); } + @Test @TestMetadata("3.kt") public void test3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/common/neg/3.kt"); } + @Test @TestMetadata("4.kt") public void test4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/common/neg/4.kt"); } + @Test @TestMetadata("5.kt") public void test5() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/common/neg/5.kt"); } + @Test @TestMetadata("6.kt") public void test6() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/common/neg/6.kt"); } + @Test @TestMetadata("7.kt") public void test7() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/common/neg/7.kt"); } + @Test @TestMetadata("8.kt") public void test8() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/common/neg/8.kt"); } + @Test @TestMetadata("9.kt") public void test9() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/common/neg/9.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/common/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/common/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/common/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.kt") public void test1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/common/pos/1.kt"); } + @Test @TestMetadata("2.kt") public void test2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/common/pos/2.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/common/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/common/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Effects extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Effects extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInEffects() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/callsInPlace") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class CallsInPlace extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class CallsInPlace extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInCallsInPlace() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/callsInPlace"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/callsInPlace"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/callsInPlace/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.kt") public void test1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/callsInPlace/neg/1.kt"); } + @Test @TestMetadata("2.kt") public void test2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/callsInPlace/neg/2.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/callsInPlace/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/callsInPlace/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/callsInPlace/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.kt") public void test1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/callsInPlace/pos/1.kt"); } + @Test @TestMetadata("2.kt") public void test2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/callsInPlace/pos/2.kt"); } + @Test @TestMetadata("3.kt") public void test3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/callsInPlace/pos/3.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/callsInPlace/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/callsInPlace/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/common") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Common extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Common extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInCommon() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/common"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/common"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/common/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.kt") public void test1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/common/neg/1.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/common/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/common/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/returns") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Returns extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Returns extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInReturns() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/returns"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/returns"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/returns/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.kt") public void test1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/returns/neg/1.kt"); } + @Test @TestMetadata("2.kt") public void test2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/returns/neg/2.kt"); } + @Test @TestMetadata("3.kt") public void test3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/returns/neg/3.kt"); } + @Test @TestMetadata("4.kt") public void test4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/returns/neg/4.kt"); } + @Test @TestMetadata("5.kt") public void test5() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/returns/neg/5.kt"); } + @Test @TestMetadata("6.kt") public void test6() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/returns/neg/6.kt"); } + @Test @TestMetadata("7.kt") public void test7() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/returns/neg/7.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/returns/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/returns/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/returns/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.kt") public void test1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/returns/pos/1.kt"); } + @Test @TestMetadata("2.kt") public void test2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/returns/pos/2.kt"); } + @Test @TestMetadata("3.kt") public void test3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/returns/pos/3.kt"); } + @Test @TestMetadata("4.kt") public void test4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/returns/pos/4.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/returns/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/returns/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractFunction") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ContractFunction extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class ContractFunction extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInContractFunction() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractFunction"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractFunction"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractFunction/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.kt") public void test1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractFunction/neg/1.kt"); } + @Test @TestMetadata("2.kt") public void test2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractFunction/neg/2.kt"); } + @Test @TestMetadata("3.kt") public void test3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractFunction/neg/3.kt"); } + @Test @TestMetadata("4.kt") public void test4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractFunction/neg/4.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractFunction/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractFunction/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractFunction/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.kt") public void test1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractFunction/pos/1.kt"); } + @Test @TestMetadata("2.kt") public void test2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractFunction/pos/2.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractFunction/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractFunction/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/dfa") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Dfa extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Dfa extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInDfa() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/dfa"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/dfa"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.kt") public void test1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/1.kt"); } + @Test @TestMetadata("10.kt") public void test10() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/10.kt"); } + @Test @TestMetadata("11.kt") public void test11() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/11.kt"); } + @Test @TestMetadata("12.kt") public void test12() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/12.kt"); } + @Test @TestMetadata("13.kt") public void test13() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/13.kt"); } + @Test @TestMetadata("14.kt") public void test14() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/14.kt"); } + @Test @TestMetadata("15.kt") public void test15() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/15.kt"); } + @Test @TestMetadata("16.kt") public void test16() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/16.kt"); } + @Test @TestMetadata("17.kt") public void test17() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/17.kt"); } + @Test @TestMetadata("18.kt") public void test18() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/18.kt"); } + @Test @TestMetadata("19.kt") public void test19() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/19.kt"); } + @Test @TestMetadata("2.kt") public void test2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/2.kt"); } + @Test @TestMetadata("20.kt") public void test20() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/20.kt"); } + @Test @TestMetadata("21.kt") public void test21() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/21.kt"); } + @Test @TestMetadata("22.kt") public void test22() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/22.kt"); } + @Test @TestMetadata("23.kt") public void test23() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/23.kt"); } + @Test @TestMetadata("24.kt") public void test24() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/24.kt"); } + @Test @TestMetadata("25.kt") public void test25() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/25.kt"); } + @Test @TestMetadata("26.kt") public void test26() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/26.kt"); } + @Test @TestMetadata("27.kt") public void test27() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/27.kt"); } + @Test @TestMetadata("28.kt") public void test28() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/28.kt"); } + @Test @TestMetadata("29.kt") public void test29() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/29.kt"); } + @Test @TestMetadata("3.kt") public void test3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/3.kt"); } + @Test @TestMetadata("30.kt") public void test30() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/30.kt"); } + @Test @TestMetadata("31.kt") public void test31() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/31.kt"); } + @Test @TestMetadata("32.kt") public void test32() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/32.kt"); } + @Test @TestMetadata("33.kt") public void test33() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/33.kt"); } + @Test @TestMetadata("34.kt") public void test34() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/34.kt"); } + @Test @TestMetadata("35.kt") public void test35() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/35.kt"); } + @Test @TestMetadata("36.kt") public void test36() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/36.kt"); } + @Test @TestMetadata("37.kt") public void test37() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/37.kt"); } + @Test @TestMetadata("38.kt") public void test38() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/38.kt"); } + @Test @TestMetadata("39.kt") public void test39() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/39.kt"); } + @Test @TestMetadata("4.kt") public void test4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/4.kt"); } + @Test @TestMetadata("40.kt") public void test40() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/40.kt"); } + @Test @TestMetadata("41.kt") public void test41() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/41.kt"); } + @Test @TestMetadata("42.kt") public void test42() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/42.kt"); } + @Test @TestMetadata("43.kt") public void test43() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/43.kt"); } + @Test @TestMetadata("44.kt") public void test44() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/44.kt"); } + @Test @TestMetadata("45.kt") public void test45() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/45.kt"); } + @Test @TestMetadata("5.kt") public void test5() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/5.kt"); } + @Test @TestMetadata("6.kt") public void test6() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/6.kt"); } + @Test @TestMetadata("7.kt") public void test7() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/7.kt"); } + @Test @TestMetadata("8.kt") public void test8() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/8.kt"); } + @Test @TestMetadata("9.kt") public void test9() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/9.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.kt") public void test1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/1.kt"); } + @Test @TestMetadata("10.kt") public void test10() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/10.kt"); } + @Test @TestMetadata("11.kt") public void test11() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/11.kt"); } + @Test @TestMetadata("12.kt") public void test12() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/12.kt"); } + @Test @TestMetadata("13.kt") public void test13() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/13.kt"); } + @Test @TestMetadata("14.kt") public void test14() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/14.kt"); } + @Test @TestMetadata("15.kt") public void test15() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/15.kt"); } + @Test @TestMetadata("16.kt") public void test16() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/16.kt"); } + @Test @TestMetadata("17.kt") public void test17() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/17.kt"); } + @Test @TestMetadata("18.kt") public void test18() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/18.kt"); } + @Test @TestMetadata("19.kt") public void test19() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/19.kt"); } + @Test @TestMetadata("2.kt") public void test2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/2.kt"); } + @Test @TestMetadata("20.kt") public void test20() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/20.kt"); } + @Test @TestMetadata("21.kt") public void test21() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/21.kt"); } + @Test @TestMetadata("22.kt") public void test22() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/22.kt"); } + @Test @TestMetadata("23.kt") public void test23() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/23.kt"); } + @Test @TestMetadata("24.kt") public void test24() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/24.kt"); } + @Test @TestMetadata("25.kt") public void test25() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/25.kt"); } + @Test @TestMetadata("26.kt") public void test26() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/26.kt"); } + @Test @TestMetadata("27.kt") public void test27() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/27.kt"); } + @Test @TestMetadata("28.kt") public void test28() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/28.kt"); } + @Test @TestMetadata("29.kt") public void test29() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/29.kt"); } + @Test @TestMetadata("3.kt") public void test3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/3.kt"); } + @Test @TestMetadata("30.kt") public void test30() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/30.kt"); } + @Test @TestMetadata("31.kt") public void test31() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/31.kt"); } + @Test @TestMetadata("32.kt") public void test32() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/32.kt"); } + @Test @TestMetadata("33.kt") public void test33() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/33.kt"); } + @Test @TestMetadata("34.kt") public void test34() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/34.kt"); } + @Test @TestMetadata("35.kt") public void test35() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/35.kt"); } + @Test @TestMetadata("36.kt") public void test36() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/36.kt"); } + @Test @TestMetadata("37.kt") public void test37() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/37.kt"); } + @Test @TestMetadata("38.kt") public void test38() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/38.kt"); } + @Test @TestMetadata("39.kt") public void test39() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/39.kt"); } + @Test @TestMetadata("4.kt") public void test4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/4.kt"); } + @Test @TestMetadata("40.kt") public void test40() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/40.kt"); } + @Test @TestMetadata("41.kt") public void test41() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/41.kt"); } + @Test @TestMetadata("42.kt") public void test42() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/42.kt"); } + @Test @TestMetadata("43.kt") public void test43() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/43.kt"); } + @Test @TestMetadata("44.kt") public void test44() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/44.kt"); } + @Test @TestMetadata("45.kt") public void test45() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/45.kt"); } + @Test @TestMetadata("46.kt") public void test46() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/46.kt"); } + @Test @TestMetadata("47.kt") public void test47() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/47.kt"); } + @Test @TestMetadata("48.kt") public void test48() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/48.kt"); } + @Test @TestMetadata("49.kt") public void test49() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/49.kt"); } + @Test @TestMetadata("5.kt") public void test5() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/5.kt"); } + @Test @TestMetadata("50.kt") public void test50() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/50.kt"); } + @Test @TestMetadata("51.kt") public void test51() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/51.kt"); } + @Test @TestMetadata("52.kt") public void test52() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/52.kt"); } + @Test @TestMetadata("53.kt") public void test53() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/53.kt"); } + @Test @TestMetadata("54.kt") public void test54() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/54.kt"); } + @Test @TestMetadata("55.kt") public void test55() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/55.kt"); } + @Test @TestMetadata("56.kt") public void test56() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/56.kt"); } + @Test @TestMetadata("57.kt") public void test57() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/57.kt"); } + @Test @TestMetadata("58.kt") public void test58() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/58.kt"); } + @Test @TestMetadata("59.kt") public void test59() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/59.kt"); } + @Test @TestMetadata("6.kt") public void test6() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/6.kt"); } + @Test @TestMetadata("60.kt") public void test60() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/60.kt"); } + @Test @TestMetadata("61.kt") public void test61() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/61.kt"); } + @Test @TestMetadata("62.kt") public void test62() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/62.kt"); } + @Test @TestMetadata("63.kt") public void test63() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/63.kt"); } + @Test @TestMetadata("64.kt") public void test64() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/64.kt"); } + @Test @TestMetadata("65.kt") public void test65() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/65.kt"); } + @Test @TestMetadata("66.kt") public void test66() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/66.kt"); } + @Test @TestMetadata("67.kt") public void test67() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/67.kt"); } + @Test @TestMetadata("68.kt") public void test68() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/68.kt"); } + @Test @TestMetadata("69.kt") public void test69() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/69.kt"); } + @Test @TestMetadata("7.kt") public void test7() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/7.kt"); } + @Test @TestMetadata("70.kt") public void test70() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/70.kt"); } + @Test @TestMetadata("71.kt") public void test71() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/71.kt"); } + @Test @TestMetadata("72.kt") public void test72() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/72.kt"); } + @Test @TestMetadata("73.kt") public void test73() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/73.kt"); } + @Test @TestMetadata("8.kt") public void test8() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/8.kt"); } + @Test @TestMetadata("9.kt") public void test9() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/9.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/local-variables") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Local_variables extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Local_variables extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInLocal_variables() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/local-variables"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/local-variables"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/local-variables/type-parameters") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Type_parameters extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Type_parameters extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInType_parameters() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/local-variables/type-parameters"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/local-variables/type-parameters"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/local-variables/type-parameters/neg") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Neg extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Neg extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.kt") public void test1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/local-variables/type-parameters/neg/1.kt"); } + @Test public void testAllFilesPresentInNeg() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/local-variables/type-parameters/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/local-variables/type-parameters/neg"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/overload-resolution") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Overload_resolution extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Overload_resolution extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInOverload_resolution() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/overload-resolution"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/overload-resolution"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/overload-resolution/building-the-overload-candidate-set-ocs") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Building_the_overload_candidate_set_ocs extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Building_the_overload_candidate_set_ocs extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInBuilding_the_overload_candidate_set_ocs() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/overload-resolution/building-the-overload-candidate-set-ocs"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/overload-resolution/building-the-overload-candidate-set-ocs"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Infix_function_call extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Infix_function_call extends AbstractFirDiagnosticTestSpec { + @Test public void testAllFilesPresentInInfix_function_call() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } + @Nested @TestMetadata("compiler/tests-spec/testData/diagnostics/notLinked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/pos") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Pos extends AbstractFirDiagnosticsTestSpec { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - + public class Pos extends AbstractFirDiagnosticTestSpec { + @Test @TestMetadata("1.kt") public void test1() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/pos/1.kt"); } + @Test @TestMetadata("2.kt") public void test2() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/pos/2.kt"); } + @Test @TestMetadata("3.kt") public void test3() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/pos/3.kt"); } + @Test @TestMetadata("4.kt") public void test4() throws Exception { runTest("compiler/tests-spec/testData/diagnostics/notLinked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/pos/4.kt"); } + @Test public void testAllFilesPresentInPos() throws Exception { - org.jetbrains.kotlin.test.util.KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/tests-spec/testData/diagnostics/notLinked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/pos"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } } } diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/AdditionalFilesDirectives.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/AdditionalFilesDirectives.kt index f28059996ef..74e4d356c9d 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/AdditionalFilesDirectives.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/AdditionalFilesDirectives.kt @@ -37,4 +37,11 @@ object AdditionalFilesDirectives : SimpleDirectivesContainer() { See file ./compiler/testData/diagnostics/helpers/coroutines/TailCallOptimizationChecker.kt """.trimIndent() ) + + val SPEC_HELPERS by directive( + description = """ + Adds util functions from `test-spec` modules + See directory ./compiler/tests-spec/helpers/ + """.trimIndent() + ) } diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/AbstractFirDiagnosticTestSpec.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/AbstractFirDiagnosticTestSpec.kt new file mode 100644 index 00000000000..0fa4966a258 --- /dev/null +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/AbstractFirDiagnosticTestSpec.kt @@ -0,0 +1,35 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.test.runners + +import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder +import org.jetbrains.kotlin.test.directives.AdditionalFilesDirectives.SPEC_HELPERS +import org.jetbrains.kotlin.test.directives.JvmEnvironmentConfigurationDirectives.WITH_STDLIB +import org.jetbrains.kotlin.test.frontend.fir.FirFailingTestSuppressor +import org.jetbrains.kotlin.test.frontend.fir.handlers.FirIdenticalChecker +import org.jetbrains.kotlin.test.services.fir.FirOldFrontendMetaConfigurator +import org.jetbrains.kotlin.test.services.sourceProviders.SpecHelpersSourceFilesProvider + +abstract class AbstractFirDiagnosticTestSpec : AbstractFirDiagnosticTest() { + override fun configure(builder: TestConfigurationBuilder) { + super.configure(builder) + with(builder) { + defaultDirectives { + +SPEC_HELPERS + +WITH_STDLIB + } + + useAdditionalSourceProviders(::SpecHelpersSourceFilesProvider) + + useAfterAnalysisCheckers( + ::FirIdenticalChecker, + ::FirFailingTestSuppressor, + ) + + useMetaTestConfigurators(::FirOldFrontendMetaConfigurator) + } + } +} diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/sourceProviders/SpecHelpersSourceFilesProvider.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/sourceProviders/SpecHelpersSourceFilesProvider.kt new file mode 100644 index 00000000000..66cc802706a --- /dev/null +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/services/sourceProviders/SpecHelpersSourceFilesProvider.kt @@ -0,0 +1,33 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.test.services.sourceProviders + +import org.jetbrains.kotlin.test.directives.AdditionalFilesDirectives +import org.jetbrains.kotlin.test.directives.AdditionalFilesDirectives.SPEC_HELPERS +import org.jetbrains.kotlin.test.directives.model.DirectivesContainer +import org.jetbrains.kotlin.test.directives.model.RegisteredDirectives +import org.jetbrains.kotlin.test.model.TestFile +import org.jetbrains.kotlin.test.model.TestModule +import org.jetbrains.kotlin.test.services.AdditionalSourceProvider +import org.jetbrains.kotlin.test.services.TestServices +import java.io.File + +class SpecHelpersSourceFilesProvider(testServices: TestServices) : AdditionalSourceProvider(testServices) { + companion object { + const val HELPERS_DIR_PATH = "compiler/tests-spec/testData/diagnostics/helpers" + } + + override val directives: List = + listOf(AdditionalFilesDirectives) + + override fun produceAdditionalFiles(globalDirectives: RegisteredDirectives, module: TestModule): List { + if (SPEC_HELPERS !in module.directives) return emptyList() + return File(HELPERS_DIR_PATH).walkTopDown().mapNotNull { + if (it.isDirectory) return@mapNotNull null + it.toTestFile() + }.toList() + } +} diff --git a/compiler/tests-spec/build.gradle.kts b/compiler/tests-spec/build.gradle.kts index 74bad7b98bc..b045fa034c8 100644 --- a/compiler/tests-spec/build.gradle.kts +++ b/compiler/tests-spec/build.gradle.kts @@ -5,6 +5,11 @@ plugins { dependencies { testCompile(projectTests(":compiler")) + testImplementation(projectTests(":compiler:test-infrastructure")) + testImplementation(projectTests(":compiler:tests-common-new")) + testRuntimeOnly(platform("org.junit:junit-bom:5.7.0")) + testRuntimeOnly("org.junit.jupiter:junit-jupiter") + testCompileOnly(intellijDep()) { includeJars("groovy", "groovy-xml", rootProject = rootProject) } diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-4/neg/2.2.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-4/neg/2.2.fir.kt index ebcba03e8ad..21420844b81 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-4/neg/2.2.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-4/neg/2.2.fir.kt @@ -59,7 +59,7 @@ val value_19 = 9_______9______9_____9____9___9__9_9.0E__0_0_0_0_0_0_0_0_0_0.12345678e+__90F // TESTCASE NUMBER: 21 -val value_21 = 1_2_3_4_5_6_7_8_9.2_3_4_5_6_7_8_9e_-_0 +val value_21 = 1_2_3_4_5_6_7_8_9.2_3_4_5_6_7_8_9e_-_0 // TESTCASE NUMBER: 22 val value_22 = .345______________6e_____7_______8f diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-4/neg/2.3.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-4/neg/2.3.fir.kt index 8e6fb5d6d54..429a99c31d8 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-4/neg/2.3.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-4/neg/2.3.fir.kt @@ -38,7 +38,7 @@ val value_12 = 33__3.0_e_10__0 val value_13 = .0_E_0______00F // TESTCASE NUMBER: 14 -val value_14 = 5_________555_________5.0____e____-____9 +val value_14 = 5_________555_________5.0____e____-____9 // TESTCASE NUMBER: 15 val value_15 = 666_666.0__________________________________________________1_E+_2___________________________________________________________________0F @@ -50,7 +50,7 @@ val value_16 = 9_______9______9_____9____9___9__9_9.0___E_ val value_17 = 0_0_0_0_0_0_0_0_0_0.12345678___e+__90F // TESTCASE NUMBER: 18 -val value_18 = 1_2_3_4_5_6_7_8_9.2_3_4_5_6_7_8_9_e_-_0 +val value_18 = 1_2_3_4_5_6_7_8_9.2_3_4_5_6_7_8_9_e_-_0 // TESTCASE NUMBER: 19 val value_19 = .45_6_E_7f diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/type-checking-and-containment-checking-expressions/containment-checking-expression/p-5/pos/2.1.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/type-checking-and-containment-checking-expressions/containment-checking-expression/p-5/pos/2.1.kt index 2cd2ebfb992..2654b952e15 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/type-checking-and-containment-checking-expressions/containment-checking-expression/p-5/pos/2.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/type-checking-and-containment-checking-expressions/containment-checking-expression/p-5/pos/2.1.kt @@ -14,7 +14,7 @@ */ -// FILE: TestCase.kt +// FILE: TestCase1.kt // TESTCASE NUMBER: 1 package testPackCase1 import checkType @@ -41,7 +41,7 @@ fun case1() { a checkType { check() } } -// FILE: TestCase.kt +// FILE: TestCase2.kt // TESTCASE NUMBER: 2 package testPackCase2 import checkType @@ -67,7 +67,7 @@ fun case2() { a checkType { check() } } -// FILE: TestCase.kt +// FILE: TestCase3.kt // TESTCASE NUMBER: 3 package testPackCase3 import checkType @@ -94,7 +94,7 @@ fun case3() { a checkType { check() } } -// FILE: TestCase.kt +// FILE: TestCase4.kt // TESTCASE NUMBER: 4 package testPackCase4 import checkType @@ -118,4 +118,4 @@ fun case4(nothing: Nothing) { val b = A(mutableSetOf(1, C(), 3, false, 2, "azaza")) val a = (nothing in b) a checkType { check() } -} \ No newline at end of file +} diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.10.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.10.kt index d8d8935f62f..34e363c8d02 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.10.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.10.kt @@ -14,7 +14,7 @@ * DESCRIPTION: Explicit receiver: Top-level non-extension functions: Callables star-imported into the current file; */ -// FILE: TestCase.kt +// FILE: TestCase1.kt // TESTCASE NUMBER: 1 package testsCase1 @@ -23,12 +23,12 @@ import libPackageCase1.* fun case1() { listOf(elements = arrayOf(1)) } -// FILE: Lib.kt +// FILE: Lib1.kt package libPackageCase1 fun listOf(vararg elements: T): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase2.kt // TESTCASE NUMBER: 2 package testsCase2 import libPackageCase2.* @@ -42,7 +42,7 @@ class A { operator fun invoke(): T = TODO() } -// FILE: Lib.kt +// FILE: Lib2.kt package libPackageCase2 import testsCase2.* @@ -50,7 +50,7 @@ fun listOf(vararg elements: T): List = TODO() val listOf: A get() = A() -// FILE: TestCase.kt +// FILE: TestCase3.kt // TESTCASE NUMBER: 3 package testsCase3 import libPackageCase3.* @@ -64,11 +64,11 @@ class A { operator fun invoke(vararg elements: T): List = TODO() } -// FILE: Lib.kt +// FILE: Lib3.kt package libPackageCase3 import testsCase3.* private fun listOf(vararg elements: T): List = TODO() val listOf: A - get() = A() \ No newline at end of file + get() = A() diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.11.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.11.kt index 1b9ef9687cb..57ee81c1cb9 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.11.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.11.kt @@ -14,7 +14,7 @@ * DESCRIPTION: Explicit receiver: Top-level non-extension functions: Implicitly imported callables */ -// FILE: TestCase.kt +// FILE: TestCase1.kt // TESTCASE NUMBER: 1 package testsCase1 import libPackageCase1.* //nothing to import @@ -22,12 +22,12 @@ import libPackageCase1.* //nothing to import fun case1() { listOf(elements = *arrayOf(1)) } -// FILE: Lib.kt +// FILE: Lib1.kt package libPackageCase1 private fun listOf(vararg elements1: T): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase2.kt // TESTCASE NUMBER: 2 package testscase2 @@ -44,7 +44,7 @@ class A { operator fun invoke(vararg elements1: T): List = TODO() } -// FILE: Lib.kt +// FILE: Lib2.kt package libPackagecase2 import testscase2.* private fun listOf(vararg elements1: T): List = TODO() diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.12.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.12.kt index 153e5dad911..1cacea542bf 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.12.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.12.kt @@ -14,7 +14,7 @@ * DESCRIPTION: Explicit receiver: The overload candidate sets for each pair of implicit receivers: Local extension callables */ -// FILE: TestCase.kt +// FILE: TestCase1.kt // TESTCASE NUMBER: 1 package testsCase1 import libPackageCase1.* @@ -29,14 +29,14 @@ class Case1(){ listOf(elements1= arrayOf(1)) } } -// FILE: Lib.kt +// FILE: Lib1.kt package libPackageCase1 import testsCase1.* public fun listOf(vararg elements1: T): List = TODO() fun Case1.listOf(vararg elements1: T): List = TODO() -// FILE: Lib.kt +// FILE: Lib2.kt package libPackageCase1Explicit import testsCase1.* @@ -44,7 +44,7 @@ fun Case1.listOf(vararg elements1: T): List = TODO() public fun listOf(vararg elements1: T): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack1.kt package testsCase1 fun Case1.listOf(vararg elements1: T): List = TODO() @@ -53,7 +53,7 @@ public fun listOf(vararg elements1: T): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase2.kt // TESTCASE NUMBER: 2 package testsCase2 import libPackageCase2.* @@ -74,7 +74,7 @@ class Case2(){ class A { operator fun invoke(vararg elements1: T): List = TODO() } -// FILE: Lib.kt +// FILE: Lib3.kt package libPackageCase2 import testsCase2.* @@ -83,7 +83,7 @@ val Case2.listOf: A public fun listOf(vararg elements1: T): List = TODO() fun Case2.listOf(vararg elements1: T): List = TODO() -// FILE: Lib.kt +// FILE: Lib4.kt package libPackageCase2Explicit import testsCase2.* @@ -93,7 +93,7 @@ fun Case2.listOf(vararg elements1: T): List = TODO() public fun listOf(vararg elements1: T): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack2.kt package testsCase2 val Case2.listOf: A get() = A() @@ -105,7 +105,7 @@ public fun listOf(vararg elements1: T): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase3.kt // TESTCASE NUMBER: 3 package testsCase3 import libPackageCase3.* @@ -126,7 +126,7 @@ class Case3(){ class A { operator fun invoke(vararg elements1: T): List = TODO() } -// FILE: Lib.kt +// FILE: Lib5.kt // TESTCASE NUMBER: 3 package libPackageCase3 @@ -137,7 +137,7 @@ val Case3.listOf: A public fun listOf(vararg elements1: T): List = TODO() fun Case3.listOf(vararg elements1: T): List = TODO() -// FILE: Lib.kt +// FILE: Lib6.kt // TESTCASE NUMBER: 3 package libPackageCase3Explicit @@ -149,7 +149,7 @@ fun Case3.listOf(vararg elements1: T): List = TODO() public fun listOf(vararg elements1: T): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack3.kt // TESTCASE NUMBER: 3 package testsCase3 diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.13.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.13.kt index a28c8f6f757..a0d739ae5db 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.13.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.13.kt @@ -14,7 +14,7 @@ * DESCRIPTION: Explicit receiver: The overload candidate sets for each pair of implicit receivers: Local extension callables */ -// FILE: TestCase.kt +// FILE: TestCase1.kt // TESTCASE NUMBER: 1 package testsCase1 import libPackageCase1.* @@ -35,14 +35,14 @@ class Case1(){ } -// FILE: Lib.kt +// FILE: Lib1.kt package libPackageCase1 import testsCase1.* public fun listOf(vararg elements1: T): List = TODO() fun Case1.listOf(vararg elements1: T): List = TODO() -// FILE: Lib.kt +// FILE: Lib2.kt package libPackageCase1Explicit import testsCase1.* @@ -50,14 +50,14 @@ fun Case1.listOf(vararg elements1: T): List = TODO() public fun listOf(vararg elements1: T): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack1.kt package testsCase1 fun Case1.listOf(vararg elements1: T): List = TODO() public fun listOf(vararg elements1: T): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase2.kt /* * TESTCASE NUMBER: 2 @@ -94,7 +94,7 @@ class A { operator fun invoke(vararg elements1: T): List = TODO() } -// FILE: Lib.kt +// FILE: Lib3.kt // TESTCASE NUMBER: 2 package libPackageCase2 import testsCase2.* @@ -103,7 +103,7 @@ val Case2.listOf: A public fun listOf(vararg elements1: T): List = TODO() fun Case2.listOf(vararg elements1: T): List = TODO() -// FILE: Lib.kt +// FILE: Lib4.kt // TESTCASE NUMBER: 2 package libPackageCase2Explicit @@ -113,7 +113,7 @@ fun Case2.listOf(vararg elements1: T): List = TODO() public fun listOf(vararg elements1: T): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack2.kt // TESTCASE NUMBER: 2 package testsCase2 @@ -122,7 +122,7 @@ fun Case2.listOf(vararg elements1: T): List = TODO() public fun listOf(vararg elements1: T): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase3.kt /* * TESTCASE NUMBER: 3 @@ -159,7 +159,7 @@ class A { operator fun invoke(vararg elements1: T): List = TODO() } -// FILE: Lib.kt +// FILE: Lib5.kt // TESTCASE NUMBER: 3 package libPackageCase3 import testsCase3.* @@ -168,7 +168,7 @@ val Case3.listOf: A public fun listOf(vararg elements1: T): List = TODO() fun Case3.listOf(vararg elements1: T): List = TODO() -// FILE: Lib.kt +// FILE: Lib6.kt // TESTCASE NUMBER: 3 package libPackageCase3Explicit @@ -178,7 +178,7 @@ fun Case3.listOf(vararg elements1: T): List = TODO() public fun listOf(vararg elements1: T): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack3.kt // TESTCASE NUMBER: 3 package testsCase3 fun Case3.listOf(vararg elements1: T): List = TODO() diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.14.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.14.kt index b284ef6671c..cc9dbd17c5c 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.14.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.14.kt @@ -14,7 +14,7 @@ * DESCRIPTION: Explicit receiver: The overload candidate sets for each pair of implicit receivers: Explicitly imported extension callables */ -// FILE: TestCase.kt +// FILE: TestCase1.kt // TESTCASE NUMBER: 1 package testsCase1 @@ -28,14 +28,14 @@ class Case1(){ } } -// FILE: Lib.kt +// FILE: Lib1.kt package libPackageCase1 import testsCase1.* public fun listOf(vararg elements1: T): List = TODO() fun Case1.listOf(vararg elements1: T): List = TODO() -// FILE: Lib.kt +// FILE: Lib2.kt package libPackageCase1Explicit import testsCase1.* @@ -43,14 +43,14 @@ fun Case1.listOf(vararg elements1: T): List = TODO() public fun listOf(vararg elements1: T): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack1.kt package testsCase1 fun Case1.listOf(vararg elements1: T): List = TODO() public fun listOf(vararg elements1: T): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase2.kt // TESTCASE NUMBER: 2 package testsCase2 @@ -68,14 +68,14 @@ class A { operator fun invoke(vararg elements1: T): List = TODO() } -// FILE: Lib.kt +// FILE: Lib3.kt package libPackageCase2 import testsCase2.* public fun listOf(vararg elements1: T): List = TODO() fun Case2.listOf(vararg elements1: T): List = TODO() -// FILE: Lib.kt +// FILE: Lib4.kt package libPackageCase2Explicit import testsCase2.* @@ -86,7 +86,7 @@ fun Case2.listOf(vararg elements1: T): List = TODO() public fun listOf(vararg elements1: T): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack2.kt package testsCase2 fun Case2.listOf(vararg elements1: T): List = TODO() @@ -94,7 +94,7 @@ public fun listOf(vararg elements1: T): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase3.kt // TESTCASE NUMBER: 3 package testsCase3 @@ -112,14 +112,14 @@ class A { operator fun invoke(vararg elements1: T): List = TODO() } -// FILE: Lib.kt +// FILE: Lib5.kt package libPackageCase3 import testsCase3.* public fun listOf(vararg elements1: T): List = TODO() fun Case3.listOf(vararg elements1: T): List = TODO() -// FILE: Lib.kt +// FILE: Lib6.kt package libPackageCase3Explicit import testsCase3.* @@ -130,7 +130,7 @@ private fun Case3.listOf(vararg elements1: T): List = TODO() public fun listOf(vararg elements1: T): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack3.kt package testsCase3 fun Case3.listOf(vararg elements1: T): List = TODO() diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.15.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.15.kt index 638968cb1eb..60325160852 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.15.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.15.kt @@ -14,7 +14,7 @@ * DESCRIPTION: Explicit receiver: The overload candidate sets for each pair of implicit receivers: declared in the package scope extension callables */ -// FILE: TestCase.kt +// FILE: TestCase1.kt // TESTCASE NUMBER: 1 package testsCase1 import libPackageCase1.* @@ -27,19 +27,19 @@ class Case1(){ } } -// FILE: Lib.kt +// FILE: Lib1.kt package libPackageCase1 import testsCase1.* public fun listOf(vararg elements1: T): List = TODO() fun Case1.listOf(vararg elements1: T): List = TODO() -// FILE: Lib.kt +// FILE: Lib2.kt package libPackageCase1Explicit public fun listOf(vararg elements1: T): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack1.kt package testsCase1 fun Case1.listOf(vararg elements1: T): List = TODO() @@ -47,7 +47,7 @@ public fun listOf(vararg elements1: T): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase2.kt // TESTCASE NUMBER: 2 package testsCase2 import libPackageCase2.* @@ -63,7 +63,7 @@ class A { operator fun invoke(vararg elements1: T): List = TODO() } -// FILE: Lib.kt +// FILE: Lib3.kt package libPackageCase2 import testsCase2.* @@ -73,12 +73,12 @@ val Case2.listOf: A fun listOf(vararg elements1: T): List = TODO() fun Case2.listOf(vararg elements1: T): List = TODO() -// FILE: Lib.kt +// FILE: Lib4.kt package libPackageCase2Explicit public fun listOf(vararg elements1: T): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack2.kt package testsCase2 fun Case2.listOf(vararg elements1: T): List = TODO() @@ -86,7 +86,7 @@ public fun listOf(vararg elements1: T): List = TODO() val Case2.listOf: A get() = A() -// FILE: TestCase.kt +// FILE: TestCase3.kt // TESTCASE NUMBER: 3 package testsCase3 import libPackageCase3.* @@ -102,19 +102,19 @@ class A { operator fun invoke(vararg elements1: T): List = TODO() } -// FILE: Lib.kt +// FILE: Lib5.kt package libPackageCase3 import testsCase3.* fun listOf(vararg elements1: T): List = TODO() fun Case3.listOf(vararg elements1: T): List = TODO() -// FILE: Lib.kt +// FILE: Lib6.kt package libPackageCase3Explicit public fun listOf(vararg elements1: T): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack3.kt package testsCase3 val Case3.listOf: A diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.16.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.16.kt index 1e743cbb75c..7ad873fb14e 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.16.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.16.kt @@ -14,7 +14,7 @@ * DESCRIPTION: Explicit receiver: The overload candidate sets for each pair of implicit receivers: Implicitly imported extension callables */ -// FILE: TestCase.kt +// FILE: TestCase1.kt // TESTCASE NUMBER: 1 package testsCase1 import libPackageCase1.* @@ -27,25 +27,25 @@ class Case1(){ } } -// FILE: Lib.kt +// FILE: Lib1.kt package libPackageCase1 import testsCase1.* public fun listOf(vararg elements1: T): List = TODO() fun Case1.listOf(vararg elements1: T): List = TODO() -// FILE: Lib.kt +// FILE: Lib2.kt package libPackageCase1Explicit public fun listOf(vararg elements1: T): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack1.kt package testsCase1 public fun listOf(vararg elements1: T): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase2.kt // TESTCASE NUMBER: 2 package testsCase2 import libPackageCase2.* @@ -62,7 +62,7 @@ class A { } -// FILE: Lib.kt +// FILE: Lib3.kt package libPackageCase2 import testsCase2.* @@ -72,18 +72,18 @@ val Case2.listOf: A public fun listOf(vararg elements1: T): List = TODO() fun Case2.listOf(vararg elements1: T): List = TODO() -// FILE: Lib.kt +// FILE: Lib4.kt package libPackageCase2Explicit public fun listOf(vararg elements1: T): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack2.kt package testsCase2 public fun listOf(vararg elements1: T): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase3.kt // TESTCASE NUMBER: 3 package testsCase3 import libPackageCase3.* @@ -100,7 +100,7 @@ class A { } -// FILE: Lib.kt +// FILE: Lib5.kt package libPackageCase3 import testsCase3.* @@ -110,12 +110,12 @@ val Case3.listOf: A fun listOf(vararg elements1: T): List = TODO() private fun Case3.listOf(vararg elements1: T): List = TODO() -// FILE: Lib.kt +// FILE: Lib6.kt package libPackageCase3Explicit public fun listOf(vararg elements1: T): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack3.kt package testsCase3 public fun listOf(vararg elements1: T): List = TODO() diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.3.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.3.kt index bc32926ceb8..2eaec347dc4 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.3.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.3.kt @@ -13,12 +13,12 @@ * DESCRIPTION: Implicit receiver: sets of explicitly imported, declared in the package scope and star-imported extension callables */ -// FILE: Extensions.kt +// FILE: Extensions1.kt package libPackageExplicit public fun String.padEnd(lengthParam: Int, padChar: Char = ' '): String = TODO() -// FILE: Extensions.kt +// FILE: Extensions2.kt package libPackage public fun String.padEnd(lengthParam: Int, padChar: Char = ' '): String = TODO() diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.8.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.8.kt index 4ada0f5cd17..4c6e686b536 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.8.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.8.kt @@ -14,7 +14,7 @@ * DESCRIPTION: Explicit receiver: Top-level non-extension functions: Callables explicitly imported into the current file */ -// FILE: TestCase.kt +// FILE: TestCase1.kt // TESTCASE NUMBER: 1 package testsCase1 import libPackageCase1.* @@ -24,23 +24,23 @@ fun case1() { listOf(elements1= arrayOf(1)) } -// FILE: Lib.kt +// FILE: Lib1.kt package libPackageCase1 public fun listOf(vararg elements1: T): List = TODO() -// FILE: Lib.kt +// FILE: Lib2.kt package libPackageCase1Explicit public fun listOf(vararg elements1: T): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack1.kt package testsCase1 public fun listOf(vararg elements1: T): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase2.kt // TESTCASE NUMBER: 2 package testsCase2 import libPackageCase2.* @@ -52,12 +52,12 @@ fun case2() { class A { operator fun invoke(vararg elements1: T): List = TODO() } -// FILE: Lib.kt +// FILE: Lib3.kt package libPackageCase2 public fun listOf(vararg elements1: T): List = TODO() -// FILE: Lib.kt +// FILE: Lib4.kt package libPackageCase2Explicit import testsCase2.* @@ -66,14 +66,14 @@ val listOf: A public fun listOf(vararg elements1: T): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack2.kt package testsCase2 public fun listOf(vararg elements1: T): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase3.kt // TESTCASE NUMBER: 3 package testsCase3 import libPackageCase3.* @@ -85,12 +85,12 @@ fun case3() { class A { operator fun invoke(vararg elements1: T): List = TODO() } -// FILE: Lib.kt +// FILE: Lib5.kt package libPackageCase3 public fun listOf(vararg elements1: T): List = TODO() -// FILE: Lib.kt +// FILE: Lib6.kt package libPackageCase3Explicit import testsCase3.* @@ -99,7 +99,7 @@ val listOf: A private fun listOf(vararg elements1: T): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack3.kt package testsCase3 public fun listOf(vararg elements1: T): List = TODO() diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.9.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.9.kt index 9ee8e0236ca..35f6297bf44 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.9.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.9.kt @@ -14,7 +14,7 @@ * DESCRIPTION: Explicit receiver: Top-level non-extension functions: Callables declared in the same package */ -// FILE: TestCase.kt +// FILE: TestCase1.kt // TESTCASE NUMBER: 1 package testsCase1 import libPackageCase1.* @@ -23,17 +23,17 @@ fun case1() { listOf(elements1= arrayOf(1)) } -// FILE: Lib.kt +// FILE: Lib1.kt package libPackageCase1 public fun listOf(vararg elements1: T): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack1.kt package testsCase1 public fun listOf(vararg elements1: T): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase2.kt // TESTCASE NUMBER: 2 package testsCase2 import libPackageCase2.* @@ -42,12 +42,12 @@ fun case2() { listOf(elements1= arrayOf(1)) } -// FILE: Lib.kt +// FILE: Lib2.kt package libPackageCase2 public fun listOf(vararg elements1: T): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack2.kt package testsCase2 import testsCase2.* @@ -61,7 +61,7 @@ class A { public fun listOf(vararg elements1: T): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase3.kt // TESTCASE NUMBER: 3 package testsCase3 import libPackageCase3.* @@ -70,12 +70,12 @@ fun case3() { listOf(elements1= arrayOf(1)) } -// FILE: Lib.kt +// FILE: Lib3.kt package libPackageCase3 public fun listOf(vararg elements1: T): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack3.kt package testsCase3 import testsCase3.* diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-5/pos/1.1.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-5/pos/1.1.fir.kt index e20858f465c..7d4592a3a2e 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-5/pos/1.1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-5/pos/1.1.fir.kt @@ -4,7 +4,7 @@ -// FILE: TestCase.kt +// FILE: TestCase1.kt // TESTCASE NUMBER: 1 package testsCase1 import libPackageCase1.* @@ -17,25 +17,25 @@ class Case1(){ } } -// FILE: Lib.kt +// FILE: Lib1.kt package libPackageCase1 import testsCase1.* public fun listOf(vararg elements1: T): List = TODO() fun Case1.listOf(vararg elements1: T): List = TODO() -// FILE: Lib.kt +// FILE: Lib2.kt package libPackageCase1Explicit public fun listOf(vararg elements1: T): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack1.kt package testsCase1 public fun listOf(vararg elements1: T): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase2.kt // TESTCASE NUMBER: 2 package testsCase2 import libPackageCase2.* @@ -52,7 +52,7 @@ class A { } -// FILE: Lib.kt +// FILE: Lib3.kt package libPackageCase2 import testsCase2.* @@ -62,18 +62,18 @@ val Case2.listOf: A public fun listOf(vararg elements1: T): List = TODO() fun Case2.listOf(vararg elements1: T): List = TODO() -// FILE: Lib.kt +// FILE: Lib4.kt package libPackageCase2Explicit public fun listOf(vararg elements1: T): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack2.kt package testsCase2 public fun listOf(vararg elements1: T): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase3.kt // TESTCASE NUMBER: 3 package testsCase3 import libPackageCase3.* @@ -90,7 +90,7 @@ class A { } -// FILE: Lib.kt +// FILE: Lib5.kt package libPackageCase3 import testsCase3.* @@ -100,12 +100,12 @@ val Case3.listOf: A fun listOf(vararg elements1: T): List = TODO() private fun Case3.listOf(vararg elements1: T): List = TODO() -// FILE: Lib.kt +// FILE: Lib6.kt package libPackageCase3Explicit public fun listOf(vararg elements1: T): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack3.kt package testsCase3 public fun listOf(vararg elements1: T): List = TODO() diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.10.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.10.fir.kt index 16bac3cb0fd..639caa205e9 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.10.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.10.fir.kt @@ -3,7 +3,7 @@ // SKIP_TXT -// FILE: TestCase.kt +// FILE: TestCase1.kt // TESTCASE NUMBER: 1 package testsCase1 @@ -12,12 +12,12 @@ import libPackageCase1.* fun case1() { listOf(elements = arrayOf(1), body = { "" }) } -// FILE: Lib.kt +// FILE: Lib1.kt package libPackageCase1 fun listOf(vararg elements: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase2.kt // TESTCASE NUMBER: 2 package testsCase2 import libPackageCase2.* @@ -31,7 +31,7 @@ class A { operator fun invoke(): T = TODO() } -// FILE: Lib.kt +// FILE: Lib2.kt package libPackageCase2 import testsCase2.* @@ -39,7 +39,7 @@ fun listOf(vararg elements: T = TODO(), body: () -> T = { TODO() }): List val listOf: A get() = A() -// FILE: TestCase.kt +// FILE: TestCase3.kt // TESTCASE NUMBER: 3 package testsCase3 import libPackageCase3.* @@ -53,7 +53,7 @@ class A { operator fun invoke(vararg elements: T = TODO(), body: () -> T = { TODO() }): List = TODO() } -// FILE: Lib.kt +// FILE: Lib3.kt package libPackageCase3 import testsCase3.* diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.10.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.10.kt index 49dd591a308..973dd507afa 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.10.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.10.kt @@ -13,7 +13,7 @@ * DESCRIPTION: call-with-trailing-lambda-expressions,Explicit receiver: Top-level non-extension functions: Callables star-imported into the current file; */ -// FILE: TestCase.kt +// FILE: TestCase1.kt // TESTCASE NUMBER: 1 package testsCase1 @@ -22,12 +22,12 @@ import libPackageCase1.* fun case1() { listOf(elements = arrayOf(1), body = { "" }) } -// FILE: Lib.kt +// FILE: Lib1.kt package libPackageCase1 fun listOf(vararg elements: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase2.kt // TESTCASE NUMBER: 2 package testsCase2 import libPackageCase2.* @@ -41,7 +41,7 @@ class A { operator fun invoke(): T = TODO() } -// FILE: Lib.kt +// FILE: Lib2.kt package libPackageCase2 import testsCase2.* @@ -49,7 +49,7 @@ fun listOf(vararg elements: T = TODO(), body: () -> T = { TODO() }): List val listOf: A get() = A() -// FILE: TestCase.kt +// FILE: TestCase3.kt // TESTCASE NUMBER: 3 package testsCase3 import libPackageCase3.* @@ -63,11 +63,11 @@ class A { operator fun invoke(vararg elements: T = TODO(), body: () -> T = { TODO() }): List = TODO() } -// FILE: Lib.kt +// FILE: Lib3.kt package libPackageCase3 import testsCase3.* private fun listOf(vararg elements: T = TODO(), body: () -> T = { TODO() }): List = TODO() val listOf: A - get() = A() \ No newline at end of file + get() = A() diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.11.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.11.kt index 6b05b91b7f0..eca20f6eb55 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.11.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.11.kt @@ -14,7 +14,7 @@ * DESCRIPTION: call-with-trailing-lambda-expressions,Explicit receiver: Top-level non-extension functions: Implicitly imported callables */ -// FILE: TestCase.kt +// FILE: TestCase1.kt // TESTCASE NUMBER: 1 package testsCase1 @@ -23,12 +23,12 @@ import libPackageCase1.* //nothing to import fun case1() { run(block = { "ss" }) } -// FILE: Lib.kt +// FILE: Lib1.kt package libPackageCase1 private fun run(vararg elements: R = TODO(), block: () -> R): R = TODO() -// FILE: TestCase.kt +// FILE: TestCase2.kt // TESTCASE NUMBER: 2 package testscase2 @@ -45,7 +45,7 @@ class A { fun run(vararg elements: R = TODO(), block: () -> R): R = TODO() } -// FILE: Lib.kt +// FILE: Lib2.kt package libPackagecase2 import testscase2.* diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.12.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.12.fir.kt index a98a950b1da..5731a210dd5 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.12.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.12.fir.kt @@ -3,7 +3,7 @@ // SKIP_TXT -// FILE: TestCase.kt +// FILE: TestCase1.kt // TESTCASE NUMBER: 1 package testsCase1 @@ -19,14 +19,14 @@ class Case1() { listOf(elements1 = arrayOf(1), body = { "" }) } } -// FILE: Lib.kt +// FILE: Lib1.kt package libPackageCase1 import testsCase1.* public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() fun Case1.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: Lib.kt +// FILE: Lib2.kt package libPackageCase1Explicit import testsCase1.* @@ -34,14 +34,14 @@ fun Case1.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack1.kt package testsCase1 fun Case1.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase2.kt // TESTCASE NUMBER: 2 package testsCase2 import libPackageCase2.* @@ -63,7 +63,7 @@ class Case2() { class A { operator fun invoke(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() } -// FILE: Lib.kt +// FILE: Lib3.kt package libPackageCase2 import testsCase2.* @@ -73,7 +73,7 @@ val Case2.listOf: A public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() fun Case2.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: Lib.kt +// FILE: Lib4.kt package libPackageCase2Explicit import testsCase2.* @@ -84,7 +84,7 @@ fun Case2.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack2.kt package testsCase2 val Case2.listOf: A get() = A() @@ -94,7 +94,7 @@ fun Case2.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase3.kt // TESTCASE NUMBER: 3 package testsCase3 import libPackageCase3.* @@ -117,7 +117,7 @@ class Case3() { class A { operator fun invoke(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() } -// FILE: Lib.kt +// FILE: Lib5.kt // TESTCASE NUMBER: 3 package libPackageCase3 @@ -129,7 +129,7 @@ val Case3.listOf: A public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() fun Case3.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: Lib.kt +// FILE: Lib6.kt // TESTCASE NUMBER: 3 package libPackageCase3Explicit @@ -142,7 +142,7 @@ fun Case3.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack3.kt // TESTCASE NUMBER: 3 package testsCase3 diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.12.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.12.kt index c7322b46a43..d6755fd9874 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.12.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.12.kt @@ -13,7 +13,7 @@ * DESCRIPTION: call-with-trailing-lambda-expressions,Explicit receiver: The overload candidate sets for each pair of implicit receivers: Local extension callables */ -// FILE: TestCase.kt +// FILE: TestCase1.kt // TESTCASE NUMBER: 1 package testsCase1 @@ -29,14 +29,14 @@ class Case1() { listOf(elements1 = arrayOf(1), body = { "" }) } } -// FILE: Lib.kt +// FILE: Lib1.kt package libPackageCase1 import testsCase1.* public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() fun Case1.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: Lib.kt +// FILE: Lib2.kt package libPackageCase1Explicit import testsCase1.* @@ -44,14 +44,14 @@ fun Case1.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack1.kt package testsCase1 fun Case1.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase2.kt // TESTCASE NUMBER: 2 package testsCase2 import libPackageCase2.* @@ -73,7 +73,7 @@ class Case2() { class A { operator fun invoke(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() } -// FILE: Lib.kt +// FILE: Lib3.kt package libPackageCase2 import testsCase2.* @@ -83,7 +83,7 @@ val Case2.listOf: A public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() fun Case2.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: Lib.kt +// FILE: Lib4.kt package libPackageCase2Explicit import testsCase2.* @@ -94,7 +94,7 @@ fun Case2.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack2.kt package testsCase2 val Case2.listOf: A get() = A() @@ -104,7 +104,7 @@ fun Case2.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase3.kt // TESTCASE NUMBER: 3 package testsCase3 import libPackageCase3.* @@ -127,7 +127,7 @@ class Case3() { class A { operator fun invoke(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() } -// FILE: Lib.kt +// FILE: Lib5.kt // TESTCASE NUMBER: 3 package libPackageCase3 @@ -139,7 +139,7 @@ val Case3.listOf: A public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() fun Case3.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: Lib.kt +// FILE: Lib6.kt // TESTCASE NUMBER: 3 package libPackageCase3Explicit @@ -152,7 +152,7 @@ fun Case3.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack3.kt // TESTCASE NUMBER: 3 package testsCase3 diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.13.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.13.fir.kt index e58839bf267..498ba2ef125 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.13.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.13.fir.kt @@ -3,7 +3,7 @@ // SKIP_TXT -// FILE: TestCase.kt +// FILE: TestCase1.kt // TESTCASE NUMBER: 1 package testsCase1 @@ -25,14 +25,14 @@ class Case1() { } -// FILE: Lib.kt +// FILE: Lib1.kt package libPackageCase1 import testsCase1.* public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() fun Case1.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: Lib.kt +// FILE: Lib2.kt package libPackageCase1Explicit import testsCase1.* @@ -40,14 +40,14 @@ fun Case1.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack1.kt package testsCase1 fun Case1.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase2.kt /* * TESTCASE NUMBER: 2 @@ -86,7 +86,7 @@ class A { operator fun invoke(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() } -// FILE: Lib.kt +// FILE: Lib3.kt // TESTCASE NUMBER: 2 package libPackageCase2 import testsCase2.* @@ -97,7 +97,7 @@ val Case2.listOf: A public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() fun Case2.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: Lib.kt +// FILE: Lib4.kt // TESTCASE NUMBER: 2 package libPackageCase2Explicit @@ -107,7 +107,7 @@ fun Case2.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack2.kt // TESTCASE NUMBER: 2 package testsCase2 @@ -116,7 +116,7 @@ fun Case2.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase3.kt /* * TESTCASE NUMBER: 3 @@ -154,7 +154,7 @@ class A { operator fun invoke(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() } -// FILE: Lib.kt +// FILE: Lib5.kt // TESTCASE NUMBER: 3 package libPackageCase3 import testsCase3.* @@ -165,7 +165,7 @@ val Case3.listOf: A public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() fun Case3.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: Lib.kt +// FILE: Lib6.kt // TESTCASE NUMBER: 3 package libPackageCase3Explicit @@ -175,7 +175,7 @@ fun Case3.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack3.kt // TESTCASE NUMBER: 3 package testsCase3 fun Case3.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.13.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.13.kt index 0f52b935059..9b830a475c8 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.13.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.13.kt @@ -13,7 +13,7 @@ * DESCRIPTION: call-with-trailing-lambda-expressions,Explicit receiver: The overload candidate sets for each pair of implicit receivers: Local extension callables */ -// FILE: TestCase.kt +// FILE: TestCase1.kt // TESTCASE NUMBER: 1 package testsCase1 @@ -35,14 +35,14 @@ class Case1() { } -// FILE: Lib.kt +// FILE: Lib1.kt package libPackageCase1 import testsCase1.* public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() fun Case1.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: Lib.kt +// FILE: Lib2.kt package libPackageCase1Explicit import testsCase1.* @@ -50,14 +50,14 @@ fun Case1.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack1.kt package testsCase1 fun Case1.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase2.kt /* * TESTCASE NUMBER: 2 @@ -96,7 +96,7 @@ class A { operator fun invoke(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() } -// FILE: Lib.kt +// FILE: Lib3.kt // TESTCASE NUMBER: 2 package libPackageCase2 import testsCase2.* @@ -107,7 +107,7 @@ val Case2.listOf: A public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() fun Case2.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: Lib.kt +// FILE: Lib4.kt // TESTCASE NUMBER: 2 package libPackageCase2Explicit @@ -117,7 +117,7 @@ fun Case2.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack2.kt // TESTCASE NUMBER: 2 package testsCase2 @@ -126,7 +126,7 @@ fun Case2.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase3.kt /* * TESTCASE NUMBER: 3 @@ -164,7 +164,7 @@ class A { operator fun invoke(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() } -// FILE: Lib.kt +// FILE: Lib5.kt // TESTCASE NUMBER: 3 package libPackageCase3 import testsCase3.* @@ -175,7 +175,7 @@ val Case3.listOf: A public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() fun Case3.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: Lib.kt +// FILE: Lib6.kt // TESTCASE NUMBER: 3 package libPackageCase3Explicit @@ -185,7 +185,7 @@ fun Case3.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack3.kt // TESTCASE NUMBER: 3 package testsCase3 fun Case3.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.14.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.14.fir.kt index 908e9031210..9b034fd832c 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.14.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.14.fir.kt @@ -3,7 +3,7 @@ // SKIP_TXT -// FILE: TestCase.kt +// FILE: TestCase1.kt // TESTCASE NUMBER: 1 package testsCase1 @@ -18,14 +18,14 @@ class Case1() { } } -// FILE: Lib.kt +// FILE: Lib1.kt package libPackageCase1 import testsCase1.* public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() fun Case1.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: Lib.kt +// FILE: Lib2.kt package libPackageCase1Explicit import testsCase1.* @@ -33,14 +33,14 @@ fun Case1.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack1.kt package testsCase1 fun Case1.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase2.kt // TESTCASE NUMBER: 2 package testsCase2 @@ -58,14 +58,14 @@ class A { operator fun invoke(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() } -// FILE: Lib.kt +// FILE: Lib3.kt package libPackageCase2 import testsCase2.* public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() fun Case2.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: Lib.kt +// FILE: Lib4.kt package libPackageCase2Explicit import testsCase2.* @@ -76,14 +76,14 @@ fun Case2.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack2.kt package testsCase2 fun Case2.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase3.kt // TESTCASE NUMBER: 3 package testsCase3 @@ -101,14 +101,14 @@ class A { operator fun invoke(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() } -// FILE: Lib.kt +// FILE: Lib5.kt package libPackageCase3 import testsCase3.* public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() fun Case3.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: Lib.kt +// FILE: Lib6.kt package libPackageCase3Explicit import testsCase3.* @@ -119,7 +119,7 @@ private fun Case3.listOf(vararg elements1: T = TODO(), body: () -> T = { TOD public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack3.kt package testsCase3 fun Case3.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.14.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.14.kt index 2b674b854b9..9cb3acbf983 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.14.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.14.kt @@ -13,7 +13,7 @@ * DESCRIPTION: call-with-trailing-lambda-expressions,Explicit receiver: The overload candidate sets for each pair of implicit receivers: Explicitly imported extension callables */ -// FILE: TestCase.kt +// FILE: TestCase1.kt // TESTCASE NUMBER: 1 package testsCase1 @@ -28,14 +28,14 @@ class Case1() { } } -// FILE: Lib.kt +// FILE: Lib1.kt package libPackageCase1 import testsCase1.* public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() fun Case1.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: Lib.kt +// FILE: Lib2.kt package libPackageCase1Explicit import testsCase1.* @@ -43,14 +43,14 @@ fun Case1.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack1.kt package testsCase1 fun Case1.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase2.kt // TESTCASE NUMBER: 2 package testsCase2 @@ -68,14 +68,14 @@ class A { operator fun invoke(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() } -// FILE: Lib.kt +// FILE: Lib3.kt package libPackageCase2 import testsCase2.* public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() fun Case2.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: Lib.kt +// FILE: Lib4.kt package libPackageCase2Explicit import testsCase2.* @@ -86,14 +86,14 @@ fun Case2.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack2.kt package testsCase2 fun Case2.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase3.kt // TESTCASE NUMBER: 3 package testsCase3 @@ -111,14 +111,14 @@ class A { operator fun invoke(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() } -// FILE: Lib.kt +// FILE: Lib5.kt package libPackageCase3 import testsCase3.* public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() fun Case3.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: Lib.kt +// FILE: Lib6.kt package libPackageCase3Explicit import testsCase3.* @@ -129,7 +129,7 @@ private fun Case3.listOf(vararg elements1: T = TODO(), body: () -> T = { TOD public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack3.kt package testsCase3 fun Case3.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.15.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.15.fir.kt index e14e2cc4a4c..ddbdce304d8 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.15.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.15.fir.kt @@ -3,7 +3,7 @@ // SKIP_TXT -// FILE: TestCase.kt +// FILE: TestCase1.kt // TESTCASE NUMBER: 1 package testsCase1 @@ -17,26 +17,26 @@ class Case1() { } } -// FILE: Lib.kt +// FILE: Lib1.kt package libPackageCase1 import testsCase1.* public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() fun Case1.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: Lib.kt +// FILE: Lib2.kt package libPackageCase1Explicit public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack1.kt package testsCase1 fun Case1.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase2.kt // TESTCASE NUMBER: 2 package testsCase2 import libPackageCase2.* @@ -53,7 +53,7 @@ class A { operator fun invoke(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() } -// FILE: Lib.kt +// FILE: Lib3.kt package libPackageCase2 import testsCase2.* @@ -63,12 +63,12 @@ val Case2.listOf: A fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() fun Case2.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: Lib.kt +// FILE: Lib4.kt package libPackageCase2Explicit public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack2.kt package testsCase2 fun Case2.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() @@ -76,7 +76,7 @@ public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): val Case2.listOf: A get() = A() -// FILE: TestCase.kt +// FILE: TestCase3.kt // TESTCASE NUMBER: 3 package testsCase3 import libPackageCase3.* @@ -93,19 +93,19 @@ class A { operator fun invoke(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() } -// FILE: Lib.kt +// FILE: Lib5.kt package libPackageCase3 import testsCase3.* fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() fun Case3.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: Lib.kt +// FILE: Lib6.kt package libPackageCase3Explicit public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack3.kt package testsCase3 val Case3.listOf: A diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.15.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.15.kt index 1c6aa9e2581..72aa97dafed 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.15.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.15.kt @@ -13,7 +13,7 @@ * DESCRIPTION: call-with-trailing-lambda-expressions,Explicit receiver: The overload candidate sets for each pair of implicit receivers: declared in the package scope extension callables */ -// FILE: TestCase.kt +// FILE: TestCase1.kt // TESTCASE NUMBER: 1 package testsCase1 @@ -27,26 +27,26 @@ class Case1() { } } -// FILE: Lib.kt +// FILE: Lib1.kt package libPackageCase1 import testsCase1.* public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() fun Case1.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: Lib.kt +// FILE: Lib2.kt package libPackageCase1Explicit public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack1.kt package testsCase1 fun Case1.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase2.kt // TESTCASE NUMBER: 2 package testsCase2 import libPackageCase2.* @@ -63,7 +63,7 @@ class A { operator fun invoke(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() } -// FILE: Lib.kt +// FILE: Lib3.kt package libPackageCase2 import testsCase2.* @@ -73,12 +73,12 @@ val Case2.listOf: A fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() fun Case2.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: Lib.kt +// FILE: Lib4.kt package libPackageCase2Explicit public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack2.kt package testsCase2 fun Case2.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() @@ -86,7 +86,7 @@ public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): val Case2.listOf: A get() = A() -// FILE: TestCase.kt +// FILE: TestCase3.kt // TESTCASE NUMBER: 3 package testsCase3 import libPackageCase3.* @@ -103,19 +103,19 @@ class A { operator fun invoke(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() } -// FILE: Lib.kt +// FILE: Lib5.kt package libPackageCase3 import testsCase3.* fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() fun Case3.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: Lib.kt +// FILE: Lib6.kt package libPackageCase3Explicit public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack3.kt package testsCase3 val Case3.listOf: A diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.16.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.16.fir.kt index b368b9dd019..b8d52e5be8e 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.16.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.16.fir.kt @@ -3,7 +3,7 @@ // SKIP_TXT -// FILE: TestCase.kt +// FILE: TestCase1.kt // TESTCASE NUMBER: 1 package testsCase1 @@ -17,25 +17,25 @@ class Case1() { } } -// FILE: Lib.kt +// FILE: Lib1.kt package libPackageCase1 import testsCase1.* public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() fun Case1.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: Lib.kt +// FILE: Lib2.kt package libPackageCase1Explicit public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack1.kt package testsCase1 public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase2.kt // TESTCASE NUMBER: 2 package testsCase2 import libPackageCase2.* @@ -53,7 +53,7 @@ class A { } -// FILE: Lib.kt +// FILE: Lib3.kt package libPackageCase2 import testsCase2.* @@ -63,18 +63,18 @@ val Case2.listOf: A public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() fun Case2.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: Lib.kt +// FILE: Lib4.kt package libPackageCase2Explicit public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack2.kt package testsCase2 public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase3.kt // TESTCASE NUMBER: 3 package testsCase3 import libPackageCase3.* @@ -92,7 +92,7 @@ class A { } -// FILE: Lib.kt +// FILE: Lib5.kt package libPackageCase3 import testsCase3.* @@ -102,12 +102,12 @@ val Case3.listOf: A fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() private fun Case3.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: Lib.kt +// FILE: Lib6.kt package libPackageCase3Explicit public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack3.kt package testsCase3 public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.16.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.16.kt index de40fcd2f0b..e0425318192 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.16.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.16.kt @@ -13,7 +13,7 @@ * DESCRIPTION: call-with-trailing-lambda-expressions,Explicit receiver: The overload candidate sets for each pair of implicit receivers: Implicitly imported extension callables */ -// FILE: TestCase.kt +// FILE: TestCase1.kt // TESTCASE NUMBER: 1 package testsCase1 @@ -27,25 +27,25 @@ class Case1() { } } -// FILE: Lib.kt +// FILE: Lib1.kt package libPackageCase1 import testsCase1.* public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() fun Case1.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: Lib.kt +// FILE: Lib2.kt package libPackageCase1Explicit public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack1.kt package testsCase1 public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase2.kt // TESTCASE NUMBER: 2 package testsCase2 import libPackageCase2.* @@ -63,7 +63,7 @@ class A { } -// FILE: Lib.kt +// FILE: Lib3.kt package libPackageCase2 import testsCase2.* @@ -73,18 +73,18 @@ val Case2.listOf: A public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() fun Case2.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: Lib.kt +// FILE: Lib4.kt package libPackageCase2Explicit public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack2.kt package testsCase2 public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase3.kt // TESTCASE NUMBER: 3 package testsCase3 import libPackageCase3.* @@ -102,7 +102,7 @@ class A { } -// FILE: Lib.kt +// FILE: Lib5.kt package libPackageCase3 import testsCase3.* @@ -112,12 +112,12 @@ val Case3.listOf: A fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() private fun Case3.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: Lib.kt +// FILE: Lib6.kt package libPackageCase3Explicit public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack3.kt package testsCase3 public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.17.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.17.fir.kt index 90ecb446112..50e6e9a114b 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.17.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.17.fir.kt @@ -3,14 +3,14 @@ // SKIP_TXT // TESTCASE NUMBER: 0, 1, 2, 3, 4 -// FILE: Extensions.kt +// FILE: Extensions1.kt package libPackage class A() { infix fun foo(x: ()->Int) = "member fun foo" } -// FILE: Extensions.kt +// FILE: Extensions2.kt // TESTCASE NUMBER: 0 package sentence3 diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.17.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.17.kt index 60c1f780d30..4e1fc7a5b93 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.17.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.17.kt @@ -15,14 +15,14 @@ */ // TESTCASE NUMBER: 0, 1, 2, 3, 4 -// FILE: Extensions.kt +// FILE: Extensions1.kt package libPackage class A() { infix fun foo(x: ()->Int) = "member fun foo" } -// FILE: Extensions.kt +// FILE: Extensions2.kt // TESTCASE NUMBER: 0 package sentence3 diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.18.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.18.kt index 371811e254a..85fb650f193 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.18.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.18.kt @@ -16,11 +16,11 @@ * DESCRIPTION: Infix fun: Local extension infix extension callables */ -// FILE: Extensions.kt +// FILE: Extensions1.kt package libPackage infix fun CharSequence.trim(predicate: (Char) -> Boolean): CharSequence = TODO() -// FILE: Extensions.kt +// FILE: Extensions2.kt package sentence3 diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.19.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.19.kt index 3d11ccc6a23..e9cf67a247e 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.19.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.19.kt @@ -16,12 +16,12 @@ * DESCRIPTION: infix fun: Explicitly imported infix extension callables */ -// FILE: Extensions.kt +// FILE: Extensions1.kt package libPackage infix fun CharSequence.trim(predicate: (Char) -> Boolean): CharSequence = TODO() -// FILE: Extensions.kt +// FILE: Extensions2.kt package sentence3 diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.20.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.20.kt index 27fe2e46b48..0e304d65600 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.20.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.20.kt @@ -16,12 +16,12 @@ * DESCRIPTION: infix fun: Star-imported infix extension callables */ -// FILE: Extensions.kt +// FILE: Extensions1.kt package libPackage infix fun CharSequence.trim(predicate: (Char) -> Boolean): CharSequence = TODO() -// FILE: Extensions.kt +// FILE: Extensions2.kt package sentence3 diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.3.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.3.kt index b83175e923a..f4b4aabb879 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.3.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.3.kt @@ -14,12 +14,12 @@ * DESCRIPTION: call-with-trailing-lambda-expressions,Implicit receiver: sets of explicitly imported, declared in the package scope and star-imported extension callables */ -// FILE: Extensions.kt +// FILE: Extensions1.kt package libPackageExplicit public fun T.let(block: (T) -> R): R = TODO() -// FILE: Extensions.kt +// FILE: Extensions2.kt package libPackage public fun T.let(block: (T) -> R): R = TODO() diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.8.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.8.fir.kt index 5f5e42e606e..74d268893a5 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.8.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.8.fir.kt @@ -3,7 +3,7 @@ // SKIP_TXT -// FILE: TestCase.kt +// FILE: TestCase1.kt // TESTCASE NUMBER: 1 package testsCase1 @@ -14,23 +14,23 @@ fun case1() { listOf(elements1 = arrayOf(1), body = { "" }) } -// FILE: Lib.kt +// FILE: Lib1.kt package libPackageCase1 public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: Lib.kt +// FILE: Lib2.kt package libPackageCase1Explicit public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack1.kt package testsCase1 public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase2.kt // TESTCASE NUMBER: 2 package testsCase2 import libPackageCase2.* @@ -43,12 +43,12 @@ fun case2() { class A { operator fun invoke(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() } -// FILE: Lib.kt +// FILE: Lib3.kt package libPackageCase2 public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: Lib.kt +// FILE: Lib4.kt package libPackageCase2Explicit import testsCase2.* @@ -57,13 +57,13 @@ val listOf: A public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack2.kt package testsCase2 public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase3.kt // TESTCASE NUMBER: 3 package testsCase3 import libPackageCase3.* @@ -76,12 +76,12 @@ fun case3() { class A { operator fun invoke(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() } -// FILE: Lib.kt +// FILE: Lib5.kt package libPackageCase3 public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: Lib.kt +// FILE: Lib6.kt package libPackageCase3Explicit import testsCase3.* @@ -90,7 +90,7 @@ val listOf: A private fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack3.kt package testsCase3 public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.8.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.8.kt index 9d937afb0f3..9d1e073cf1a 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.8.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.8.kt @@ -13,7 +13,7 @@ * DESCRIPTION: call-with-trailing-lambda-expressions,Explicit receiver: Top-level non-extension functions: Callables explicitly imported into the current file */ -// FILE: TestCase.kt +// FILE: TestCase1.kt // TESTCASE NUMBER: 1 package testsCase1 @@ -24,23 +24,23 @@ fun case1() { listOf(elements1 = arrayOf(1), body = { "" }) } -// FILE: Lib.kt +// FILE: Lib1.kt package libPackageCase1 public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: Lib.kt +// FILE: Lib2.kt package libPackageCase1Explicit public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack1.kt package testsCase1 public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase2.kt // TESTCASE NUMBER: 2 package testsCase2 import libPackageCase2.* @@ -53,12 +53,12 @@ fun case2() { class A { operator fun invoke(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() } -// FILE: Lib.kt +// FILE: Lib3.kt package libPackageCase2 public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: Lib.kt +// FILE: Lib4.kt package libPackageCase2Explicit import testsCase2.* @@ -67,13 +67,13 @@ val listOf: A public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack2.kt package testsCase2 public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase3.kt // TESTCASE NUMBER: 3 package testsCase3 import libPackageCase3.* @@ -86,12 +86,12 @@ fun case3() { class A { operator fun invoke(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() } -// FILE: Lib.kt +// FILE: Lib5.kt package libPackageCase3 public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: Lib.kt +// FILE: Lib6.kt package libPackageCase3Explicit import testsCase3.* @@ -100,7 +100,7 @@ val listOf: A private fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack3.kt package testsCase3 public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.9.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.9.fir.kt index 824ac59fd0c..e97960dfaa4 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.9.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.9.fir.kt @@ -3,7 +3,7 @@ // SKIP_TXT -// FILE: TestCase.kt +// FILE: TestCase1.kt // TESTCASE NUMBER: 1 package testsCase1 @@ -13,17 +13,17 @@ fun case1() { listOf(elements1 = arrayOf(1), body = { "" }) } -// FILE: Lib.kt +// FILE: Lib1.kt package libPackageCase1 public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack1.kt package testsCase1 public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase2.kt // TESTCASE NUMBER: 2 package testsCase2 import libPackageCase2.* @@ -32,12 +32,12 @@ fun case2() { listOf(elements1 = arrayOf(1), body = { "" }) } -// FILE: Lib.kt +// FILE: Lib2.kt package libPackageCase2 public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack2.kt package testsCase2 import testsCase2.* @@ -51,7 +51,7 @@ class A { public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase3.kt // TESTCASE NUMBER: 3 package testsCase3 import libPackageCase3.* @@ -60,12 +60,12 @@ fun case3() { listOf(elements1 = arrayOf(1), body = { "" }) } -// FILE: Lib.kt +// FILE: Lib3.kt package libPackageCase3 public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack3.kt package testsCase3 import testsCase3.* diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.9.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.9.kt index d409292a19e..ed42966d3bb 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.9.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.9.kt @@ -13,7 +13,7 @@ * DESCRIPTION: call-with-trailing-lambda-expressions,Explicit receiver: Top-level non-extension functions: Callables declared in the same package */ -// FILE: TestCase.kt +// FILE: TestCase1.kt // TESTCASE NUMBER: 1 package testsCase1 @@ -23,17 +23,17 @@ fun case1() { listOf(elements1 = arrayOf(1), body = { "" }) } -// FILE: Lib.kt +// FILE: Lib1.kt package libPackageCase1 public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack1.kt package testsCase1 public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase2.kt // TESTCASE NUMBER: 2 package testsCase2 import libPackageCase2.* @@ -42,12 +42,12 @@ fun case2() { listOf(elements1 = arrayOf(1), body = { "" }) } -// FILE: Lib.kt +// FILE: Lib2.kt package libPackageCase2 public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack2.kt package testsCase2 import testsCase2.* @@ -61,7 +61,7 @@ class A { public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: TestCase.kt +// FILE: TestCase3.kt // TESTCASE NUMBER: 3 package testsCase3 import libPackageCase3.* @@ -70,12 +70,12 @@ fun case3() { listOf(elements1 = arrayOf(1), body = { "" }) } -// FILE: Lib.kt +// FILE: Lib3.kt package libPackageCase3 public fun listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack3.kt package testsCase3 import testsCase3.* diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.3.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.3.fir.kt index 1342fb03854..50eb95f646e 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.3.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.3.fir.kt @@ -2,21 +2,21 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION -NOTHING_TO_INLINE // SKIP_TXT -// FILE: Lib.kt +// FILE: Lib1.kt package libPackageCase1 import testsCase1.* public fun emptyArray(): Array = TODO() fun Case1.emptyArray(): Array = TODO() -// FILE: Lib.kt +// FILE: Lib2.kt package libPackageCase1Explicit import testsCase1.* fun Case1.emptyArray(): Array = TODO() public fun emptyArray(): Array = TODO() -// FILE: Lib.kt +// FILE: Lib3.kt package libPackageCase1ExplicitDuplicate import testsCase1.* diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.3.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.3.kt index cc0d0ff67a1..5d1b1ea14f1 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.3.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.3.kt @@ -16,21 +16,21 @@ */ -// FILE: Lib.kt +// FILE: Lib1.kt package libPackageCase1 import testsCase1.* public fun emptyArray(): Array = TODO() fun Case1.emptyArray(): Array = TODO() -// FILE: Lib.kt +// FILE: Lib2.kt package libPackageCase1Explicit import testsCase1.* fun Case1.emptyArray(): Array = TODO() public fun emptyArray(): Array = TODO() -// FILE: Lib.kt +// FILE: Lib3.kt package libPackageCase1ExplicitDuplicate import testsCase1.* diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.4.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.4.fir.kt index e3529c3e0d3..b51a49349ff 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.4.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.4.fir.kt @@ -2,7 +2,7 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION -NOTHING_TO_INLINE // SKIP_TXT -// FILE: TestCase.kt +// FILE: TestCase1.kt // TESTCASE NUMBER: 1 package testsCase1 import libPackageCase1.* @@ -18,19 +18,19 @@ class Case1(){ } -// FILE: Lib.kt +// FILE: Lib1.kt package libPackageCase1 import testsCase1.* public fun emptyArray(): Array = TODO() fun Case1.emptyArray(): Array = TODO() -// FILE: Lib.kt +// FILE: Lib2.kt package libPackageCase1Explicit public fun emptyArray(): Array = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack1.kt // TESTCASE NUMBER: 1 package testsCase1 fun Case1.emptyArray(): Array = TODO() @@ -40,7 +40,7 @@ public fun emptyArray(): Array = TODO() -// FILE: TestCase.kt +// FILE: TestCase2.kt // TESTCASE NUMBER: 2 package testsCase2 import libPackageCase2.* @@ -62,19 +62,19 @@ class A { operator fun invoke(): Unit = TODO() } -// FILE: Lib.kt +// FILE: Lib3.kt package libPackageCase2 import testsCase2.* public fun emptyArray(): Array = TODO() fun Case2.emptyArray(): Array = TODO() -// FILE: Lib.kt +// FILE: Lib4.kt package libPackageCase2Explicit public fun emptyArray(): Array = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack2.kt // TESTCASE NUMBER: 2 package testsCase2 fun Case2.emptyArray(): Array = TODO() diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.4.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.4.kt index f01f0c35823..f0d908eda74 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.4.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.4.kt @@ -18,7 +18,7 @@ -// FILE: TestCase.kt +// FILE: TestCase1.kt // TESTCASE NUMBER: 1 package testsCase1 import libPackageCase1.* @@ -34,19 +34,19 @@ class Case1(){ } -// FILE: Lib.kt +// FILE: Lib1.kt package libPackageCase1 import testsCase1.* public fun emptyArray(): Array = TODO() fun Case1.emptyArray(): Array = TODO() -// FILE: Lib.kt +// FILE: Lib2.kt package libPackageCase1Explicit public fun emptyArray(): Array = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack1.kt // TESTCASE NUMBER: 1 package testsCase1 fun Case1.emptyArray(): Array = TODO() @@ -56,7 +56,7 @@ public fun emptyArray(): Array = TODO() -// FILE: TestCase.kt +// FILE: TestCase2.kt // TESTCASE NUMBER: 2 package testsCase2 import libPackageCase2.* @@ -78,19 +78,19 @@ class A { operator fun invoke(): Unit = TODO() } -// FILE: Lib.kt +// FILE: Lib3.kt package libPackageCase2 import testsCase2.* public fun emptyArray(): Array = TODO() fun Case2.emptyArray(): Array = TODO() -// FILE: Lib.kt +// FILE: Lib4.kt package libPackageCase2Explicit public fun emptyArray(): Array = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack2.kt // TESTCASE NUMBER: 2 package testsCase2 fun Case2.emptyArray(): Array = TODO() diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.5.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.5.fir.kt index 1537549cc1f..f88363e7ee5 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.5.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.5.fir.kt @@ -2,20 +2,20 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION -NOTHING_TO_INLINE // SKIP_TXT -// FILE: Lib.kt +// FILE: Lib1.kt package libPackageCase1 import testsCase1.* public fun emptyArray(): Array = TODO() fun Case1.emptyArray(): Array = TODO() -// FILE: Lib.kt +// FILE: Lib2.kt package libPackageCase1Duplicate import testsCase1.* public fun emptyArray(): Array = TODO() fun Case1.emptyArray(): Array = TODO() -// FILE: Lib.kt +// FILE: Lib3.kt package libPackageCase1Explicit public fun emptyArray(): Array = TODO() diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.5.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.5.kt index 2bb904e7da2..f128010a52d 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.5.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.5.kt @@ -16,20 +16,20 @@ */ -// FILE: Lib.kt +// FILE: Lib1.kt package libPackageCase1 import testsCase1.* public fun emptyArray(): Array = TODO() fun Case1.emptyArray(): Array = TODO() -// FILE: Lib.kt +// FILE: Lib2.kt package libPackageCase1Duplicate import testsCase1.* public fun emptyArray(): Array = TODO() fun Case1.emptyArray(): Array = TODO() -// FILE: Lib.kt +// FILE: Lib3.kt package libPackageCase1Explicit public fun emptyArray(): Array = TODO() diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/6.1.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/6.1.fir.kt index 25f94aaa87c..d37c5f79351 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/6.1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/6.1.fir.kt @@ -16,7 +16,7 @@ fun case1() { Regex("") } -// FILE: Lib.kt +// FILE: Lib1.kt package libCase1 fun Regex(pattern: String) {} @@ -36,11 +36,11 @@ fun case2() { Regex("") } -// FILE: Lib.kt +// FILE: Lib2.kt package libCase2.a fun Regex(pattern: String) {} -// FILE: Lib.kt +// FILE: Lib3.kt package libCase2.b fun Regex(pattern: String) {} @@ -60,11 +60,11 @@ fun case4() { Regex("") } -// FILE: Lib.kt +// FILE: Lib4.kt package libCase4.a fun Regex(pattern: String) {} -// FILE: Lib.kt +// FILE: Lib5.kt package libCase4.b class Regex(pattern: String) {} @@ -83,11 +83,11 @@ fun case5() { Regex("") } -// FILE: Lib.kt +// FILE: Lib6.kt package libCase5.a fun Regex(pattern: String) {} -// FILE: Lib.kt +// FILE: Lib7.kt package libCase5.b class Regex(pattern: String) {} @@ -104,10 +104,10 @@ fun case6() { MyRegex("") } -// FILE: Lib.kt +// FILE: Lib8.kt package libCase6.a fun MyRegex(pattern: String) {} -// FILE: Lib.kt +// FILE: Lib9.kt package libCase6.b class MyRegex(pattern: String) {} diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/6.1.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/6.1.kt index 7f002bfaa83..1978ee061b9 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/6.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/6.1.kt @@ -24,7 +24,7 @@ fun case1() { Regex("") } -// FILE: Lib.kt +// FILE: Lib1.kt package libCase1 fun Regex(pattern: String) {} @@ -44,11 +44,11 @@ fun case2() { Regex("") } -// FILE: Lib.kt +// FILE: Lib2.kt package libCase2.a fun Regex(pattern: String) {} -// FILE: Lib.kt +// FILE: Lib3.kt package libCase2.b fun Regex(pattern: String) {} @@ -68,11 +68,11 @@ fun case4() { Regex("") } -// FILE: Lib.kt +// FILE: Lib4.kt package libCase4.a fun Regex(pattern: String) {} -// FILE: Lib.kt +// FILE: Lib5.kt package libCase4.b class Regex(pattern: String) {} @@ -91,11 +91,11 @@ fun case5() { Regex("") } -// FILE: Lib.kt +// FILE: Lib6.kt package libCase5.a fun Regex(pattern: String) {} -// FILE: Lib.kt +// FILE: Lib7.kt package libCase5.b class Regex(pattern: String) {} @@ -112,11 +112,11 @@ fun case6() { MyRegex("") } -// FILE: Lib.kt +// FILE: Lib8.kt package libCase6.a fun MyRegex(pattern: String) {} -// FILE: Lib.kt +// FILE: Lib9.kt package libCase6.b class MyRegex(pattern: String) {} diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/6.4.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/6.4.fir.kt index 19be89e5aab..01968f15cee 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/6.4.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/6.4.fir.kt @@ -2,6 +2,14 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION // SKIP_TXT +/* + * KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE) + * + * SPEC VERSION: 0.1-401 + * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 5 -> sentence 6 + * NUMBER: 4 + * DESCRIPTION: + */ @@ -20,7 +28,7 @@ fun case1() { Regex("") } -// FILE: Lib.kt +// FILE: Lib1.kt package libCase1.a fun Regex(pattern: String) {} @@ -28,7 +36,7 @@ object Regex { operator fun invoke(s: String) {} } -// FILE: Lib1.kt +// FILE: Lib1_1.kt package libCase1.b enum class Regex{ @@ -56,7 +64,7 @@ fun case2() { Regex("") } -// FILE: Lib.kt +// FILE: Lib2.kt package libCase2.a fun Regex(pattern: String) {} @@ -64,7 +72,7 @@ fun Regex(pattern: String) {} // operator fun invoke(s: String) {} //} -// FILE: Lib1.kt +// FILE: Lib12.kt package libCase2.b enum class Regex{ @@ -91,7 +99,7 @@ fun case3() { Regex("") } -// FILE: Lib.kt +// FILE: Lib3.kt package libCase3.a fun Regex(pattern: String) {} @@ -99,7 +107,7 @@ object Regex { operator fun invoke(s: String) {} } -// FILE: Lib1.kt +// FILE: Lib1_3.kt package libCase3.b class Regex(val s: String) @@ -117,7 +125,7 @@ fun case4() { Regex("") } -// FILE: Lib.kt +// FILE: Lib4.kt package libCase4.a fun Regex(pattern: String) {} @@ -125,7 +133,7 @@ fun Regex(pattern: String) {} // operator fun invoke(s: String) {} //} -// FILE: Lib1.kt +// FILE: Lib14.kt package libCase4.b class Regex(val s: String) @@ -143,14 +151,14 @@ fun case(){ A() } -// FILE: Lib.kt +// FILE: Lib5.kt package libCase5.a fun A() {} //(1) //object A{ // operator fun invoke(){} //} -// FILE: Lib.kt +// FILE: Lib6.kt package libCase5.b class A() @@ -169,13 +177,13 @@ fun case(){ A() } -// FILE: Lib.kt +// FILE: Lib7.kt package libCase6.a fun A() : String = " " //(1) object A{ //operator fun invoke(){} } -// FILE: Lib.kt +// FILE: Lib8.kt package libCase6.b class A() @@ -193,11 +201,11 @@ fun case7(){ object A{ //operator fun invoke(){} } -// FILE: Lib.kt +// FILE: Lib9.kt package libCase7.a fun A() : String = " " //(1) -// FILE: Lib.kt +// FILE: Lib10.kt package libCase7.b class A() @@ -217,14 +225,14 @@ fun case8(){ A() } -// FILE: Lib.kt +// FILE: Lib11.kt package libCase8.a fun A() : String = " " //(1) -// FILE: Lib.kt +// FILE: Lib1_2.kt package libCase8.b class A() -// FILE: Lib.kt +// FILE: Lib13.kt package libCase8.c object A{ //operator fun invoke(){} @@ -244,14 +252,14 @@ fun case9(){ A() } -// FILE: Lib.kt +// FILE: Lib1_4.kt package libCase9.a fun A() : String = " " //(1) -// FILE: Lib.kt +// FILE: Lib15.kt package libCase9.b class A() -// FILE: Lib.kt +// FILE: Lib16.kt package libCase9.c object A{ //operator fun invoke(){} diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/6.4.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/6.4.kt index 1c4c0561d19..f9c7c512721 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/6.4.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/6.4.kt @@ -28,7 +28,7 @@ fun case1() { Regex("") } -// FILE: Lib.kt +// FILE: Lib1.kt package libCase1.a fun Regex(pattern: String) {} @@ -36,7 +36,7 @@ object Regex { operator fun invoke(s: String) {} } -// FILE: Lib1.kt +// FILE: Lib1_1.kt package libCase1.b enum class Regex{ @@ -64,7 +64,7 @@ fun case2() { Regex("") } -// FILE: Lib.kt +// FILE: Lib2.kt package libCase2.a fun Regex(pattern: String) {} @@ -72,7 +72,7 @@ fun Regex(pattern: String) {} // operator fun invoke(s: String) {} //} -// FILE: Lib1.kt +// FILE: Lib12.kt package libCase2.b enum class Regex{ @@ -99,7 +99,7 @@ fun case3() { Regex("") } -// FILE: Lib.kt +// FILE: Lib3.kt package libCase3.a fun Regex(pattern: String) {} @@ -107,7 +107,7 @@ object Regex { operator fun invoke(s: String) {} } -// FILE: Lib1.kt +// FILE: Lib1_3.kt package libCase3.b class Regex(val s: String) @@ -125,7 +125,7 @@ fun case4() { Regex("") } -// FILE: Lib.kt +// FILE: Lib4.kt package libCase4.a fun Regex(pattern: String) {} @@ -133,7 +133,7 @@ fun Regex(pattern: String) {} // operator fun invoke(s: String) {} //} -// FILE: Lib1.kt +// FILE: Lib14.kt package libCase4.b class Regex(val s: String) @@ -151,14 +151,14 @@ fun case(){ A() } -// FILE: Lib.kt +// FILE: Lib5.kt package libCase5.a fun A() {} //(1) //object A{ // operator fun invoke(){} //} -// FILE: Lib.kt +// FILE: Lib6.kt package libCase5.b class A() @@ -177,13 +177,13 @@ fun case(){ A() } -// FILE: Lib.kt +// FILE: Lib7.kt package libCase6.a fun A() : String = " " //(1) object A{ //operator fun invoke(){} } -// FILE: Lib.kt +// FILE: Lib8.kt package libCase6.b class A() @@ -201,11 +201,11 @@ fun case7(){ object A{ //operator fun invoke(){} } -// FILE: Lib.kt +// FILE: Lib9.kt package libCase7.a fun A() : String = " " //(1) -// FILE: Lib.kt +// FILE: Lib10.kt package libCase7.b class A() @@ -225,14 +225,14 @@ fun case8(){ A() } -// FILE: Lib.kt +// FILE: Lib11.kt package libCase8.a fun A() : String = " " //(1) -// FILE: Lib.kt +// FILE: Lib1_2.kt package libCase8.b class A() -// FILE: Lib.kt +// FILE: Lib13.kt package libCase8.c object A{ //operator fun invoke(){} @@ -252,14 +252,14 @@ fun case9(){ A() } -// FILE: Lib.kt +// FILE: Lib1_4.kt package libCase9.a fun A() : String = " " //(1) -// FILE: Lib.kt +// FILE: Lib15.kt package libCase9.b class A() -// FILE: Lib.kt +// FILE: Lib16.kt package libCase9.c object A{ //operator fun invoke(){} @@ -290,4 +290,4 @@ package libCase10.b class A() // FILE: Libc.kt package libCase10.c -interface A \ No newline at end of file +interface A diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.1.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.1.kt index 865c42e9c75..11e1238d404 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.1.kt @@ -17,7 +17,7 @@ * DESCRIPTION: The overload candidate sets for each pair of implicit receivers: Local extension callables */ -// FILE: TestCase.kt +// FILE: TestCase1.kt // TESTCASE NUMBER: 1 package testsCase1 import libPackageCase1.* @@ -32,14 +32,14 @@ class Case1(){ emptyArray() } } -// FILE: Lib.kt +// FILE: Lib1.kt package libPackageCase1 import testsCase1.* public fun emptyArray(): Array = TODO() fun Case1.emptyArray(): Array = TODO() -// FILE: Lib.kt +// FILE: Lib2.kt package libPackageCase1Explicit import testsCase1.* @@ -47,7 +47,7 @@ fun Case1.emptyArray(): Array = TODO() public fun emptyArray(): Array = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack1.kt package testsCase1 fun Case1.emptyArray(): Array = TODO() @@ -56,7 +56,7 @@ public fun emptyArray(): Array = TODO() -// FILE: TestCase.kt +// FILE: TestCase2.kt // TESTCASE NUMBER: 2 package testsCase2 import libPackageCase2.* @@ -77,7 +77,7 @@ class Case2(){ class A { operator fun invoke(): T = TODO() } -// FILE: Lib.kt +// FILE: Lib3.kt package libPackageCase2 import testsCase2.* @@ -86,7 +86,7 @@ val Case2.emptyArray: A public fun emptyArray(): Array = TODO() fun Case2.emptyArray(): Array = TODO() -// FILE: Lib.kt +// FILE: Lib4.kt package libPackageCase2Explicit import testsCase2.* @@ -96,7 +96,7 @@ fun Case2.emptyArray(): Array = TODO() public fun emptyArray(): Array = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack2.kt package testsCase2 val Case2.emptyArray: A get() = A() @@ -108,7 +108,7 @@ public fun emptyArray(): Array = TODO() -// FILE: TestCase.kt +// FILE: TestCase3.kt // TESTCASE NUMBER: 3 package testsCase3 import libPackageCase3.* @@ -129,7 +129,7 @@ class Case3(){ class A { operator fun invoke(): T = TODO() } -// FILE: Lib.kt +// FILE: Lib5.kt // TESTCASE NUMBER: 3 package libPackageCase3 @@ -140,7 +140,7 @@ val Case3.emptyArray: A public fun emptyArray(): Array = TODO() fun Case3.emptyArray(): Array = TODO() -// FILE: Lib.kt +// FILE: Lib6.kt // TESTCASE NUMBER: 3 package libPackageCase3Explicit @@ -152,7 +152,7 @@ fun Case3.emptyArray(): Array = TODO() public fun emptyArray(): Array = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack3.kt // TESTCASE NUMBER: 3 package testsCase3 diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.2.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.2.kt index 502b02bba18..336fbefb985 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.2.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.2.kt @@ -17,7 +17,7 @@ * DESCRIPTION: The overload candidate sets for each pair of implicit receivers: Local extension callables */ -// FILE: TestCase.kt +// FILE: TestCase1.kt // TESTCASE NUMBER: 1 package testsCase1 import libPackageCase1.* @@ -38,14 +38,14 @@ class Case1(){ } -// FILE: Lib.kt +// FILE: Lib1.kt package libPackageCase1 import testsCase1.* public fun emptyArray(): Array = TODO() fun Case1.emptyArray(): Array = TODO() -// FILE: Lib.kt +// FILE: Lib2.kt package libPackageCase1Explicit import testsCase1.* @@ -53,14 +53,14 @@ fun Case1.emptyArray(): Array = TODO() public fun emptyArray(): Array = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack1.kt package testsCase1 fun Case1.emptyArray(): Array = TODO() public fun emptyArray(): Array = TODO() -// FILE: TestCase.kt +// FILE: TestCase2.kt /* * TESTCASE NUMBER: 2 @@ -97,7 +97,7 @@ class A { operator fun invoke(): T = TODO() } -// FILE: Lib.kt +// FILE: Lib3.kt // TESTCASE NUMBER: 2 package libPackageCase2 import testsCase2.* @@ -106,7 +106,7 @@ val Case2.emptyArray: A public fun emptyArray(): Array = TODO() fun Case2.emptyArray(): Array = TODO() -// FILE: Lib.kt +// FILE: Lib4.kt // TESTCASE NUMBER: 2 package libPackageCase2Explicit @@ -116,7 +116,7 @@ fun Case2.emptyArray(): Array = TODO() public fun emptyArray(): Array = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack2.kt // TESTCASE NUMBER: 2 package testsCase2 @@ -125,7 +125,7 @@ fun Case2.emptyArray(): Array = TODO() public fun emptyArray(): Array = TODO() -// FILE: TestCase.kt +// FILE: TestCase3.kt /* * TESTCASE NUMBER: 3 @@ -162,7 +162,7 @@ class A { operator fun invoke(): T = TODO() } -// FILE: Lib.kt +// FILE: Lib5.kt // TESTCASE NUMBER: 3 package libPackageCase3 import testsCase3.* @@ -171,7 +171,7 @@ val Case3.emptyArray: A public fun emptyArray(): Array = TODO() fun Case3.emptyArray(): Array = TODO() -// FILE: Lib.kt +// FILE: Lib6.kt // TESTCASE NUMBER: 3 package libPackageCase3Explicit @@ -181,7 +181,7 @@ fun Case3.emptyArray(): Array = TODO() public fun emptyArray(): Array = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack3.kt // TESTCASE NUMBER: 3 package testsCase3 fun Case3.emptyArray(): Array = TODO() diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.3.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.3.kt index 69aefaf7e61..40482eba191 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.3.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.3.kt @@ -17,7 +17,7 @@ * DESCRIPTION: The overload candidate sets for each pair of implicit receivers: Explicitly imported extension callables */ -// FILE: TestCase.kt +// FILE: TestCase1.kt // TESTCASE NUMBER: 1 package testsCase1 @@ -31,14 +31,14 @@ class Case1(){ } } -// FILE: Lib.kt +// FILE: Lib1.kt package libPackageCase1 import testsCase1.* public fun emptyArray(): Array = TODO() fun Case1.emptyArray(): Array = TODO() -// FILE: Lib.kt +// FILE: Lib2.kt package libPackageCase1Explicit import testsCase1.* @@ -46,14 +46,14 @@ fun Case1.emptyArray(): Array = TODO() public fun emptyArray(): Array = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack1.kt package testsCase1 fun Case1.emptyArray(): Array = TODO() public fun emptyArray(): Array = TODO() -// FILE: TestCase.kt +// FILE: TestCase2.kt // TESTCASE NUMBER: 2 package testsCase2 @@ -71,14 +71,14 @@ class A { operator fun invoke(): T = TODO() } -// FILE: Lib.kt +// FILE: Lib3.kt package libPackageCase2 import testsCase2.* public fun emptyArray(): Array = TODO() fun Case2.emptyArray(): Array = TODO() -// FILE: Lib.kt +// FILE: Lib4.kt package libPackageCase2Explicit import testsCase2.* @@ -89,7 +89,7 @@ fun Case2.emptyArray(): Array = TODO() public fun emptyArray(): Array = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack2.kt package testsCase2 fun Case2.emptyArray(): Array = TODO() @@ -97,7 +97,7 @@ public fun emptyArray(): Array = TODO() -// FILE: TestCase.kt +// FILE: TestCase3.kt // TESTCASE NUMBER: 3 package testsCase3 @@ -115,14 +115,14 @@ class A { operator fun invoke(): T = TODO() } -// FILE: Lib.kt +// FILE: Lib5.kt package libPackageCase3 import testsCase3.* public fun emptyArray(): Array = TODO() fun Case3.emptyArray(): Array = TODO() -// FILE: Lib.kt +// FILE: Lib6.kt package libPackageCase3Explicit import testsCase3.* @@ -133,7 +133,7 @@ private fun Case3.emptyArray(): Array = TODO() public fun emptyArray(): Array = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack3.kt package testsCase3 fun Case3.emptyArray(): Array = TODO() diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.4.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.4.kt index dbcef3e4a3e..76654d1c6c1 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.4.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.4.kt @@ -17,7 +17,7 @@ * DESCRIPTION: The overload candidate sets for each pair of implicit receivers: declared in the package scope extension callables */ -// FILE: TestCase.kt +// FILE: TestCase1.kt // TESTCASE NUMBER: 1 package testsCase1 import libPackageCase1.* @@ -30,19 +30,19 @@ class Case1(){ } } -// FILE: Lib.kt +// FILE: Lib1.kt package libPackageCase1 import testsCase1.* public fun emptyArray(): Array = TODO() fun Case1.emptyArray(): Array = TODO() -// FILE: Lib.kt +// FILE: Lib2.kt package libPackageCase1Explicit public fun emptyArray(): Array = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack1.kt package testsCase1 fun Case1.emptyArray(): Array = TODO() @@ -50,7 +50,7 @@ public fun emptyArray(): Array = TODO() -// FILE: TestCase.kt +// FILE: TestCase2.kt // TESTCASE NUMBER: 2 package testsCase2 import libPackageCase2.* @@ -66,7 +66,7 @@ class A { operator fun invoke(): T = TODO() } -// FILE: Lib.kt +// FILE: Lib3.kt package libPackageCase2 import testsCase2.* @@ -76,12 +76,12 @@ val Case2.emptyArray: A fun emptyArray(): Array = TODO() fun Case2.emptyArray(): Array = TODO() -// FILE: Lib.kt +// FILE: Lib4.kt package libPackageCase2Explicit public fun emptyArray(): Array = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack2.kt package testsCase2 fun Case2.emptyArray(): Array = TODO() @@ -89,7 +89,7 @@ public fun emptyArray(): Array = TODO() val Case2.emptyArray: A get() = A() -// FILE: TestCase.kt +// FILE: TestCase3.kt // TESTCASE NUMBER: 3 package testsCase3 import libPackageCase3.* @@ -105,19 +105,19 @@ class A { operator fun invoke(): T = TODO() } -// FILE: Lib.kt +// FILE: Lib5.kt package libPackageCase3 import testsCase3.* fun emptyArray(): Array = TODO() fun Case3.emptyArray(): Array = TODO() -// FILE: Lib.kt +// FILE: Lib6.kt package libPackageCase3Explicit public fun emptyArray(): Array = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack3.kt package testsCase3 val Case3.emptyArray: A diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.5.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.5.kt index e2feea8382d..dfda2bf1c2c 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.5.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/2.5.kt @@ -17,7 +17,7 @@ * DESCRIPTION: The overload candidate sets for each pair of implicit receivers: Implicitly imported extension callables */ -// FILE: TestCase.kt +// FILE: TestCase1.kt // TESTCASE NUMBER: 1 package testsCase1 import libPackageCase1.* @@ -30,25 +30,25 @@ class Case1(){ } } -// FILE: Lib.kt +// FILE: Lib1.kt package libPackageCase1 import testsCase1.* public fun emptyArray(): Array = TODO() fun Case1.emptyArray(): Array = TODO() -// FILE: Lib.kt +// FILE: Lib2.kt package libPackageCase1Explicit public fun emptyArray(): Array = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack1.kt package testsCase1 public fun emptyArray(): Array = TODO() -// FILE: TestCase.kt +// FILE: TestCase2.kt // TESTCASE NUMBER: 2 package testsCase2 import libPackageCase2.* @@ -65,7 +65,7 @@ class A { } -// FILE: Lib.kt +// FILE: Lib3.kt package libPackageCase2 import testsCase2.* @@ -75,18 +75,18 @@ val Case2.emptyArray: A public fun emptyArray(): Array = TODO() fun Case2.emptyArray(): Array = TODO() -// FILE: Lib.kt +// FILE: Lib4.kt package libPackageCase2Explicit public fun emptyArray(): Array = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack2.kt package testsCase2 public fun emptyArray(): Array = TODO() -// FILE: TestCase.kt +// FILE: TestCase3.kt // TESTCASE NUMBER: 3 package testsCase3 import libPackageCase3.* @@ -103,7 +103,7 @@ class A { } -// FILE: Lib.kt +// FILE: Lib5.kt package libPackageCase3 import testsCase3.* @@ -113,12 +113,12 @@ val Case3.emptyArray: A fun emptyArray(): Array = TODO() private fun Case3.emptyArray(): Array = TODO() -// FILE: Lib.kt +// FILE: Lib6.kt package libPackageCase3Explicit public fun emptyArray(): Array = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack3.kt package testsCase3 public fun emptyArray(): Array = TODO() diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.1.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.1.kt index 658b3899f66..5959a636542 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.1.kt @@ -16,7 +16,7 @@ * DESCRIPTION: Top-level non-extension functions: Callables explicitly imported into the current file */ -// FILE: TestCase.kt +// FILE: TestCase1.kt // TESTCASE NUMBER: 1 package testsCase1 import libPackageCase1.* @@ -26,23 +26,23 @@ fun case1() { emptyArray() } -// FILE: Lib.kt +// FILE: Lib1.kt package libPackageCase1 public fun emptyArray(): Array = TODO() -// FILE: Lib.kt +// FILE: Lib2.kt package libPackageCase1Explicit public fun emptyArray(): Array = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack1.kt package testsCase1 public fun emptyArray(): Array = TODO() -// FILE: TestCase.kt +// FILE: TestCase2.kt // TESTCASE NUMBER: 2 package testsCase2 import libPackageCase2.* @@ -54,12 +54,12 @@ fun case2() { class A { operator fun invoke(): T = TODO() } -// FILE: Lib.kt +// FILE: Lib3.kt package libPackageCase2 public fun emptyArray(): Array = TODO() -// FILE: Lib.kt +// FILE: Lib4.kt package libPackageCase2Explicit import testsCase2.* @@ -68,14 +68,14 @@ val emptyArray: A public fun emptyArray(): Array = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack2.kt package testsCase2 public fun emptyArray(): Array = TODO() -// FILE: TestCase.kt +// FILE: TestCase3.kt // TESTCASE NUMBER: 3 package testsCase3 import libPackageCase3.* @@ -87,12 +87,12 @@ fun case3() { class A { operator fun invoke(): T = TODO() } -// FILE: Lib.kt +// FILE: Lib5.kt package libPackageCase3 public fun emptyArray(): Array = TODO() -// FILE: Lib.kt +// FILE: Lib6.kt package libPackageCase3Explicit import testsCase3.* @@ -101,7 +101,7 @@ val emptyArray: A private fun emptyArray(): Array = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack3.kt package testsCase3 public fun emptyArray(): Array = TODO() diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.2.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.2.fir.kt index c9c2fac31c5..54540ed5157 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.2.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.2.fir.kt @@ -22,7 +22,7 @@ fun case1(){ B() } -// FILE: Lib.kt +// FILE: Lib1.kt package lib.case1 fun A() : String = "" @@ -50,7 +50,7 @@ fun case2(){ B() } -// FILE: Lib.kt +// FILE: Lib2.kt package lib.case2 //fun A() : String = "" @@ -81,7 +81,7 @@ fun case3(){ B() } -// FILE: Lib.kt +// FILE: Lib3.kt package lib.case3 //fun A() : String = "" diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.2.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.2.kt index 1adda34d976..623988521a6 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.2.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.2.kt @@ -31,7 +31,7 @@ fun case1(){ ; typeCall: function")!>B() } -// FILE: Lib.kt +// FILE: Lib1.kt package lib.case1 fun A() : String = "" @@ -59,7 +59,7 @@ fun case2(){ ; typeCall: function")!>B() } -// FILE: Lib.kt +// FILE: Lib2.kt package lib.case2 //fun A() : String = "" @@ -90,7 +90,7 @@ fun case3(){ ; typeCall: function")!>B() } -// FILE: Lib.kt +// FILE: Lib3.kt package lib.case3 //fun A() : String = "" diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.3.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.3.fir.kt index cb24e88b073..cbc9bdae412 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.3.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.3.fir.kt @@ -22,7 +22,7 @@ fun case1(){ B() } -// FILE: Lib.kt +// FILE: Lib1.kt package lib.case1 fun A() : String = "" @@ -50,7 +50,7 @@ fun case2(){ B() } -// FILE: Lib.kt +// FILE: Lib2.kt package lib.case2 //fun A() : String = "" @@ -78,7 +78,7 @@ fun case3(){ B() } -// FILE: Lib.kt +// FILE: Lib3.kt package lib.case3 //fun A() : String = "" diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.3.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.3.kt index 7aa118f32b3..d7dd3262988 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.3.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.3.kt @@ -31,7 +31,7 @@ fun case1(){ ; typeCall: function")!>B() } -// FILE: Lib.kt +// FILE: Lib1.kt package lib.case1 fun A() : String = "" @@ -59,7 +59,7 @@ fun case2(){ ; typeCall: function")!>B() } -// FILE: Lib.kt +// FILE: Lib2.kt package lib.case2 //fun A() : String = "" @@ -87,7 +87,7 @@ fun case3(){ ; typeCall: function")!>B() } -// FILE: Lib.kt +// FILE: Lib3.kt package lib.case3 //fun A() : String = "" diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.4.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.4.fir.kt index 5e06259f0b3..3c380a4e0b4 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.4.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.4.fir.kt @@ -22,7 +22,7 @@ fun case1(){ B() } -// FILE: Lib.kt +// FILE: Lib1.kt package lib.case1 fun A() : String = "" @@ -50,7 +50,7 @@ fun case2(){ B() } -// FILE: Lib.kt +// FILE: Lib2.kt package lib.case2 //fun A() : String = "" @@ -79,7 +79,7 @@ fun case3(){ B() } -// FILE: Lib.kt +// FILE: Lib3.kt package lib.case3 //fun A() : String = "" diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.4.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.4.kt index eff98d77bdf..c8a1f356ad7 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.4.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.4.kt @@ -31,7 +31,7 @@ fun case1(){ ; typeCall: function")!>B() } -// FILE: Lib.kt +// FILE: Lib1.kt package lib.case1 fun A() : String = "" @@ -59,7 +59,7 @@ fun case2(){ ; typeCall: function")!>B() } -// FILE: Lib.kt +// FILE: Lib2.kt package lib.case2 //fun A() : String = "" @@ -88,7 +88,7 @@ fun case3(){ ; typeCall: function")!>B() } -// FILE: Lib.kt +// FILE: Lib3.kt package lib.case3 //fun A() : String = "" diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.5.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.5.fir.kt index 663c80c08d2..10cf0efb228 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.5.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.5.fir.kt @@ -22,7 +22,7 @@ fun case1(){ B() } -// FILE: Lib.kt +// FILE: Lib1.kt package lib.case1 fun B() : String = "" @@ -50,7 +50,7 @@ fun case2(){ B() } -// FILE: Lib.kt +// FILE: Lib2.kt package lib.case2 //fun B() : String = "" @@ -81,7 +81,7 @@ fun case3(){ B() } -// FILE: Lib.kt +// FILE: Lib3.kt package lib.case3 //fun B() : String = "" diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.5.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.5.kt index cf3b4f628fd..158402ea4ca 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.5.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.5.kt @@ -32,7 +32,7 @@ fun case1(){ ; typeCall: function")!>B() } -// FILE: Lib.kt +// FILE: Lib1.kt package lib.case1 fun B() : String = "" @@ -60,7 +60,7 @@ fun case2(){ ; typeCall: function")!>B() } -// FILE: Lib.kt +// FILE: Lib2.kt package lib.case2 //fun B() : String = "" @@ -91,7 +91,7 @@ fun case3(){ ; typeCall: function")!>B() } -// FILE: Lib.kt +// FILE: Lib3.kt package lib.case3 //fun B() : String = "" diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.6.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.6.fir.kt index 385fe9df188..d85fea04ffe 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.6.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.6.fir.kt @@ -23,7 +23,7 @@ fun case1(){ B() } -// FILE: Lib.kt +// FILE: Lib1.kt package lib.case1.a fun C() : String = "" @@ -32,7 +32,7 @@ object C { operator fun invoke() : Int = 1 } -// FILE: Lib.kt +// FILE: Lib2.kt package lib.case1.b fun C() : String = "" @@ -61,7 +61,7 @@ fun case2(){ B() } -// FILE: Lib.kt +// FILE: Lib3.kt package lib.case2.a //fun C() : String = "" @@ -69,7 +69,7 @@ package lib.case2.a object C { operator fun invoke() : Int = 1 } -// FILE: Lib.kt +// FILE: Lib4.kt package lib.case2.b //fun C() : String = "" @@ -104,7 +104,7 @@ fun case3(){ B.invoke() } -// FILE: Lib.kt +// FILE: Lib5.kt package lib.case3.a //fun B() : String = "" @@ -112,7 +112,7 @@ package lib.case3.a object C { /*operator*/ fun invoke() : Int = 1 } -// FILE: Lib.kt +// FILE: Lib6.kt package lib.case3.b //fun C() : String = "" diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.6.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.6.kt index e3e1f1c872c..8e63afc1345 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.6.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/4.6.kt @@ -33,7 +33,7 @@ fun case1(){ B() } -// FILE: Lib.kt +// FILE: Lib1.kt package lib.case1.a fun C() : String = "" @@ -42,7 +42,7 @@ object C { operator fun invoke() : Int = 1 } -// FILE: Lib.kt +// FILE: Lib2.kt package lib.case1.b fun C() : String = "" @@ -71,7 +71,7 @@ fun case2(){ B() } -// FILE: Lib.kt +// FILE: Lib3.kt package lib.case2.a //fun C() : String = "" @@ -79,7 +79,7 @@ package lib.case2.a object C { operator fun invoke() : Int = 1 } -// FILE: Lib.kt +// FILE: Lib4.kt package lib.case2.b //fun C() : String = "" @@ -114,7 +114,7 @@ fun case3(){ B.invoke() } -// FILE: Lib.kt +// FILE: Lib5.kt package lib.case3.a //fun B() : String = "" @@ -122,7 +122,7 @@ package lib.case3.a object C { /*operator*/ fun invoke() : Int = 1 } -// FILE: Lib.kt +// FILE: Lib6.kt package lib.case3.b //fun C() : String = "" diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/5.1.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/5.1.kt index 7fd8435a2a6..7079b84320c 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/5.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/5.1.kt @@ -16,7 +16,7 @@ * DESCRIPTION: Top-level non-extension functions: Callables declared in the same package */ -// FILE: TestCase.kt +// FILE: TestCase1.kt // TESTCASE NUMBER: 1 package testsCase1 import libPackageCase1.* @@ -25,17 +25,17 @@ fun case1() { emptyArray() } -// FILE: Lib.kt +// FILE: Lib1.kt package libPackageCase1 public fun emptyArray(): Array = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack1.kt package testsCase1 public fun emptyArray(): Array = TODO() -// FILE: TestCase.kt +// FILE: TestCase2.kt // TESTCASE NUMBER: 2 package testsCase2 import libPackageCase2.* @@ -44,12 +44,12 @@ fun case2() { emptyArray() } -// FILE: Lib.kt +// FILE: Lib2.kt package libPackageCase2 public fun emptyArray(): Array = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack2.kt package testsCase2 import testsCase2.* @@ -63,7 +63,7 @@ class A { public fun emptyArray(): Array = TODO() -// FILE: TestCase.kt +// FILE: TestCase3.kt // TESTCASE NUMBER: 3 package testsCase3 import libPackageCase3.* @@ -72,12 +72,12 @@ fun case3() { emptyArray() } -// FILE: Lib.kt +// FILE: Lib3.kt package libPackageCase3 public fun emptyArray(): Array = TODO() -// FILE: LibtestsPack.kt +// FILE: LibtestsPack3.kt package testsCase3 import testsCase3.* diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/6.1.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/6.1.kt index 4f25097cca8..5d23e1a19cc 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/6.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/6.1.kt @@ -16,7 +16,7 @@ * DESCRIPTION: Top-level non-extension functions: Callables star-imported into the current file; */ -// FILE: TestCase.kt +// FILE: TestCase1.kt // TESTCASE NUMBER: 1 package testsCase1 @@ -25,13 +25,13 @@ import libPackageCase1.* fun case1() { emptyArray() } -// FILE: Lib.kt +// FILE: Lib1.kt package libPackageCase1 public fun emptyArray(): Array = TODO() -// FILE: TestCase.kt +// FILE: TestCase2.kt // TESTCASE NUMBER: 2 package testsCase2 import libPackageCase2.* @@ -45,7 +45,7 @@ class A { operator fun invoke(): T = TODO() } -// FILE: Lib.kt +// FILE: Lib2.kt package libPackageCase2 import testsCase2.* @@ -54,7 +54,7 @@ public fun emptyArray(): Array = TODO() val emptyArray: A get() = A() -// FILE: TestCase.kt +// FILE: TestCase3.kt // TESTCASE NUMBER: 3 package testsCase3 import libPackageCase3.* @@ -68,11 +68,11 @@ class A { operator fun invoke(): T = TODO() } -// FILE: Lib.kt +// FILE: Lib3.kt package libPackageCase3 import testsCase3.* private fun emptyArray(): Array = TODO() val emptyArray: A - get() = A() \ No newline at end of file + get() = A() diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/6.2.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/6.2.fir.kt index 34128df17c2..ee54f0ecfbd 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/6.2.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/6.2.fir.kt @@ -3,7 +3,7 @@ // SKIP_TXT -// FILE: TestCase1.kt +// FILE: TestCase11.kt /* * TESTCASE NUMBER: 1 * UNEXPECTED BEHAVIOUR @@ -16,12 +16,12 @@ fun case1() { Regex("") } -// FILE: Lib.kt +// FILE: Lib1.kt package libCase1 fun Regex(pattern: String) {} -// FILE: TestCase1.kt +// FILE: TestCase12.kt /* * TESTCASE NUMBER: 1 * UNEXPECTED BEHAVIOUR @@ -33,7 +33,7 @@ fun case() { Regex("") } -// FILE: Lib.kt +// FILE: Lib2.kt package testPackCase1 class Regex(pattern: String) {} @@ -53,7 +53,7 @@ fun case2() { Regex("") } -// FILE: Lib.kt +// FILE: Lib3.kt package libCase2.a fun Regex(pattern: String) {} @@ -61,7 +61,7 @@ fun Regex(pattern: String) {} // operator fun invoke(s: String) {} //} -// FILE: Lib1.kt +// FILE: Lib11.kt package libCase2.b enum class Regex{ @@ -87,7 +87,7 @@ fun case3() { Regex("") } -// FILE: Lib.kt +// FILE: Lib4.kt package libCase3 fun Regex(pattern: String) {} @@ -110,7 +110,7 @@ fun case4() { Regex("") } -// FILE: Lib.kt +// FILE: Lib5.kt package libCase4.a fun Regex(pattern: String) {} @@ -118,7 +118,7 @@ object Regex { operator fun invoke(s: String) {} } -// FILE: Lib1.kt +// FILE: Lib12.kt package libCase4.b enum class Regex{ @@ -141,7 +141,7 @@ fun case() { Regex("") } -// FILE: Lib.kt +// FILE: Lib6.kt package testPackCase5 fun Regex(pattern: String) {} @@ -158,7 +158,7 @@ fun case() { Regex("") } -// FILE: Lib.kt +// FILE: Lib7.kt package testPackCase6 fun Regex(pattern: String) {} @@ -175,7 +175,7 @@ fun case() { Regex("") } -// FILE: Lib.kt +// FILE: Lib8.kt package testPackCase7 class Regex(pattern: String) {} @@ -192,7 +192,7 @@ fun case() { Regex("") } -// FILE: Lib.kt +// FILE: Lib9.kt package testPackCase8 class Regex(pattern: String) {} @@ -209,6 +209,6 @@ fun case() { Regex("") } -// FILE: Lib.kt +// FILE: Lib10.kt package testPackCase9 class Regex(pattern: String) {} diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/6.2.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/6.2.kt index fa1eb0924e6..c753511cd98 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/6.2.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/6.2.kt @@ -11,7 +11,7 @@ * DESCRIPTION: */ -// FILE: TestCase1.kt +// FILE: TestCase11.kt /* * TESTCASE NUMBER: 1 * UNEXPECTED BEHAVIOUR @@ -24,12 +24,12 @@ fun case1() { Regex("") } -// FILE: Lib.kt +// FILE: Lib1.kt package libCase1 fun Regex(pattern: String) {} -// FILE: TestCase1.kt +// FILE: TestCase12.kt /* * TESTCASE NUMBER: 1 * UNEXPECTED BEHAVIOUR @@ -41,7 +41,7 @@ fun case() { ; typeCall: function")!>Regex("") } -// FILE: Lib.kt +// FILE: Lib2.kt package testPackCase1 class Regex(pattern: String) {} @@ -61,7 +61,7 @@ fun case2() { Regex("") } -// FILE: Lib.kt +// FILE: Lib3.kt package libCase2.a fun Regex(pattern: String) {} @@ -69,7 +69,7 @@ fun Regex(pattern: String) {} // operator fun invoke(s: String) {} //} -// FILE: Lib1.kt +// FILE: Lib11.kt package libCase2.b enum class Regex{ @@ -95,7 +95,7 @@ fun case3() { Regex("") } -// FILE: Lib.kt +// FILE: Lib4.kt package libCase3 fun Regex(pattern: String) {} @@ -118,7 +118,7 @@ fun case4() { Regex("") } -// FILE: Lib.kt +// FILE: Lib5.kt package libCase4.a fun Regex(pattern: String) {} @@ -126,7 +126,7 @@ object Regex { operator fun invoke(s: String) {} } -// FILE: Lib1.kt +// FILE: Lib12.kt package libCase4.b enum class Regex{ @@ -149,7 +149,7 @@ fun case() { Regex("") } -// FILE: Lib.kt +// FILE: Lib6.kt package testPackCase5 fun Regex(pattern: String) {} @@ -166,7 +166,7 @@ fun case() { Regex("") } -// FILE: Lib.kt +// FILE: Lib7.kt package testPackCase6 fun Regex(pattern: String) {} @@ -183,7 +183,7 @@ fun case() { ; typeCall: function")!>Regex("") } -// FILE: Lib.kt +// FILE: Lib8.kt package testPackCase7 class Regex(pattern: String) {} @@ -200,7 +200,7 @@ fun case() { ; typeCall: function")!>Regex("") } -// FILE: Lib.kt +// FILE: Lib9.kt package testPackCase8 class Regex(pattern: String) {} @@ -217,7 +217,7 @@ fun case() { ; typeCall: function")!>Regex("") } -// FILE: Lib.kt +// FILE: Lib10.kt package testPackCase9 class Regex(pattern: String) {} diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/6.3.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/6.3.fir.kt index 33259c2c715..6d34b9324b2 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/6.3.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/6.3.fir.kt @@ -18,7 +18,7 @@ fun case1() { Regex("") } -// FILE: Lib.kt +// FILE: Lib1.kt package libCase1 class Regex(pattern: String) @@ -38,7 +38,7 @@ fun case2() { Regex("") } -// FILE: Lib.kt +// FILE: Lib2.kt package libCase2 //fun Regex(pattern: String) {} @@ -46,7 +46,7 @@ object Regex { operator fun invoke(s: String) {} } -// FILE: Lib1.kt +// FILE: Lib11.kt package lib1Case2 enum class Regex{ @@ -71,7 +71,7 @@ fun case3() { Regex("") } -// FILE: Lib.kt +// FILE: Lib3.kt package libCase3 enum class Regex{ @@ -98,11 +98,11 @@ fun case4() { Regex("") } -// FILE: Lib.kt +// FILE: Lib4.kt package libCase4 class Regex(pattern: String) {} -// FILE: Lib1.kt +// FILE: Lib12.kt package lib1Case4 enum class Regex{ diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/6.3.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/6.3.kt index c50725a569b..2b8ce04d271 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/6.3.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/6.3.kt @@ -26,7 +26,7 @@ fun case1() { ; typeCall: function")!>Regex("") } -// FILE: Lib.kt +// FILE: Lib1.kt package libCase1 class Regex(pattern: String) @@ -46,7 +46,7 @@ fun case2() { ; typeCall: function")!>Regex("") } -// FILE: Lib.kt +// FILE: Lib2.kt package libCase2 //fun Regex(pattern: String) {} @@ -54,7 +54,7 @@ object Regex { operator fun invoke(s: String) {} } -// FILE: Lib1.kt +// FILE: Lib11.kt package lib1Case2 enum class Regex{ @@ -79,7 +79,7 @@ fun case3() { ; typeCall: function")!>Regex("") } -// FILE: Lib.kt +// FILE: Lib3.kt package libCase3 enum class Regex{ @@ -106,11 +106,11 @@ fun case4() { ; typeCall: function")!>Regex("") } -// FILE: Lib.kt +// FILE: Lib4.kt package libCase4 class Regex(pattern: String) {} -// FILE: Lib1.kt +// FILE: Lib12.kt package lib1Case4 enum class Regex{ diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/7.1.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/7.1.kt index a52af9bf640..1744dafd658 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/7.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/pos/7.1.kt @@ -16,7 +16,7 @@ * DESCRIPTION: Top-level non-extension functions: Implicitly imported callables */ -// FILE: TestCase.kt +// FILE: TestCase1.kt // TESTCASE NUMBER: 1 package testsCase1 import libPackageCase1.* //nothing to import, function emptyArray is private @@ -24,12 +24,12 @@ import libPackageCase1.* //nothing to import, function emptyArray is private fun case1() { emptyArray() } -// FILE: Lib.kt +// FILE: Lib1.kt package libPackageCase1 private fun emptyArray(): Array = TODO() -// FILE: TestCase.kt +// FILE: TestCase2.kt // TESTCASE NUMBER: 2 package testscase2 @@ -46,7 +46,7 @@ class A { operator fun invoke(): T = TODO() } -// FILE: Lib.kt +// FILE: Lib2.kt package libPackagecase2 import testscase2.* private fun emptyArray(): Array = TODO() diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/neg/1.1.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/neg/1.1.fir.kt index da1cd88a32d..2db48105ceb 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/neg/1.1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/neg/1.1.fir.kt @@ -2,14 +2,14 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION -EXTENSION_SHADOWED_BY_MEMBER // SKIP_TXT -// FILE: Extensions.kt +// FILE: Extensions1.kt package libPackage class A() { fun foo(x: Int) = "member fun foo" } -// FILE: Extensions.kt +// FILE: Extensions2.kt // TESTCASE NUMBER: 1, 2, 3, 4 package sentence3 diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/neg/1.1.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/neg/1.1.kt index a946fda0c88..814f1721f4a 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/neg/1.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/neg/1.1.kt @@ -13,14 +13,14 @@ * DESCRIPTION: Implicitly imported extension callable without infix modifier */ -// FILE: Extensions.kt +// FILE: Extensions1.kt package libPackage class A() { fun foo(x: Int) = "member fun foo" } -// FILE: Extensions.kt +// FILE: Extensions2.kt // TESTCASE NUMBER: 1, 2, 3, 4 package sentence3 diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/neg/1.2.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/neg/1.2.fir.kt index 21f9aee9ba2..091876b7dc3 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/neg/1.2.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/neg/1.2.fir.kt @@ -2,14 +2,14 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION // SKIP_TXT -// FILE: Extensions.kt +// FILE: Extensions1.kt package libPackage operator fun CharSequence.contains(regex: Regex): Boolean { println("my contains") return true } -// FILE: Extensions.kt +// FILE: Extensions2.kt package sentence3 diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/neg/1.2.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/neg/1.2.kt index 3a536ea8664..cebfa72b022 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/neg/1.2.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/neg/1.2.kt @@ -15,14 +15,14 @@ * DESCRIPTION: Local extension infix extension callables */ -// FILE: Extensions.kt +// FILE: Extensions1.kt package libPackage operator fun CharSequence.contains(regex: Regex): Boolean { println("my contains") return true } -// FILE: Extensions.kt +// FILE: Extensions2.kt package sentence3 diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/neg/1.3.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/neg/1.3.fir.kt index 3bb9af3599c..53efae4a21c 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/neg/1.3.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/neg/1.3.fir.kt @@ -2,14 +2,14 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION // SKIP_TXT -// FILE: Extensions.kt +// FILE: Extensions1.kt package libPackage operator fun CharSequence.contains(regex: Regex): Boolean { println("my contains") return true } -// FILE: Extensions.kt +// FILE: Extensions2.kt package sentence3 diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/neg/1.3.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/neg/1.3.kt index cb319355844..97291830cde 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/neg/1.3.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/neg/1.3.kt @@ -15,14 +15,14 @@ * DESCRIPTION: Explicitly imported infix extension callables */ -// FILE: Extensions.kt +// FILE: Extensions1.kt package libPackage operator fun CharSequence.contains(regex: Regex): Boolean { println("my contains") return true } -// FILE: Extensions.kt +// FILE: Extensions2.kt package sentence3 diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/neg/1.4.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/neg/1.4.fir.kt index 657e92db7d5..6f9e36c7b56 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/neg/1.4.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/neg/1.4.fir.kt @@ -2,14 +2,14 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION // SKIP_TXT -// FILE: Extensions.kt +// FILE: Extensions1.kt package libPackage operator fun CharSequence.contains(regex: Regex): Boolean { println("my contains") return true } -// FILE: Extensions.kt +// FILE: Extensions2.kt package sentence3 diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/neg/1.4.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/neg/1.4.kt index b643769b938..bcd0f39ca1a 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/neg/1.4.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/neg/1.4.kt @@ -14,14 +14,14 @@ * DESCRIPTION: Star-imported infix extension callables */ -// FILE: Extensions.kt +// FILE: Extensions1.kt package libPackage operator fun CharSequence.contains(regex: Regex): Boolean { println("my contains") return true } -// FILE: Extensions.kt +// FILE: Extensions2.kt package sentence3 diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/pos/4.1.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/pos/4.1.fir.kt index 82166ae54d1..655c5b7cd1b 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/pos/4.1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/pos/4.1.fir.kt @@ -3,14 +3,14 @@ // SKIP_TXT // TESTCASE NUMBER: 0, 1, 2, 3, 4 -// FILE: Extensions.kt +// FILE: Extensions1.kt package libPackage class A() { infix fun foo(x: Int) = "member fun foo" } -// FILE: Extensions.kt +// FILE: Extensions2.kt // TESTCASE NUMBER: 0 package sentence3 diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/pos/4.1.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/pos/4.1.kt index b6b8de03f7d..fdb3af29665 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/pos/4.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/pos/4.1.kt @@ -15,14 +15,14 @@ */ // TESTCASE NUMBER: 0, 1, 2, 3, 4 -// FILE: Extensions.kt +// FILE: Extensions1.kt package libPackage class A() { infix fun foo(x: Int) = "member fun foo" } -// FILE: Extensions.kt +// FILE: Extensions2.kt // TESTCASE NUMBER: 0 package sentence3 diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/pos/4.2.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/pos/4.2.kt index 4b49ba5f794..3b0857c6758 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/pos/4.2.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/pos/4.2.kt @@ -16,14 +16,14 @@ * DESCRIPTION: Local extension infix extension callables */ -// FILE: Extensions.kt +// FILE: Extensions1.kt package libPackage infix operator fun CharSequence.contains(regex: Regex): Boolean { println("my contains") return true } -// FILE: Extensions.kt +// FILE: Extensions2.kt package sentence3 diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/pos/4.3.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/pos/4.3.fir.kt index 15a241699d4..ab411ce4a71 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/pos/4.3.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/pos/4.3.fir.kt @@ -2,14 +2,14 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION // SKIP_TXT -// FILE: Extensions.kt +// FILE: Extensions1.kt package libPackage infix operator fun CharSequence.contains(regex: Regex): Boolean { println("my contains") return true } -// FILE: Extensions.kt +// FILE: Extensions2.kt package sentence3 diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/pos/4.3.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/pos/4.3.kt index 080a34a8faf..1596024b23b 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/pos/4.3.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/pos/4.3.kt @@ -15,14 +15,14 @@ * DESCRIPTION: Explicitly imported infix extension callables */ -// FILE: Extensions.kt +// FILE: Extensions1.kt package libPackage infix operator fun CharSequence.contains(regex: Regex): Boolean { println("my contains") return true } -// FILE: Extensions.kt +// FILE: Extensions2.kt package sentence3 diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/pos/4.4.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/pos/4.4.kt index d921c7a0df0..ab7c1fc0b95 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/pos/4.4.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/infix-function-call/p-2/pos/4.4.kt @@ -16,14 +16,14 @@ * DESCRIPTION: Star-imported infix extension callables */ -// FILE: Extensions.kt +// FILE: Extensions1.kt package libPackage infix operator fun CharSequence.contains(regex: Regex): Boolean { println("my contains") return true } -// FILE: Extensions.kt +// FILE: Extensions2.kt package sentence3 diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.4.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.4.fir.kt index dca1e020a8b..b23bb9fedf4 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.4.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.4.fir.kt @@ -2,6 +2,17 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION // SKIP_TXT +/* + * KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE) + * + * SPEC VERSION: 0.1-448 + * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 1 -> sentence 2 + * PRIMARY LINKS: overload-resolution, choosing-the-most-specific-candidate-from-the-overload-candidate-set, algorithm-of-msc-selection -> paragraph 3 -> sentence 1 + * NUMBER: 4 + * DESCRIPTION: without inline plusAssign functions + * UNEXPECTED BEHAVIOUR + * ISSUES: KT-39819 + */ // FILE: TestCase1.kt @@ -22,11 +33,11 @@ fun case1 (){ class B { private operator fun plusAssign(c: () -> C) {} - private operator fun plus(c: () -> C): C = c() + private operator fun plus(c: () -> C): C = c() //(3) } class C -// FILE: LibCase1.kt +// FILE: LibCase1b.kt package LibPackCase1.b import LibPackCase1.a.* import testPackCase1.B @@ -35,8 +46,45 @@ import testPackCase1.C operator fun B?.plusAssign( c: ()->C) {} //(2) -// FILE: LibCase1.kt +// FILE: LibCase1a.kt package LibPackCase1.a import testPackCase1.B operator fun B?.plusAssign( c: ()->Int) {} //(1) + +// FILE: TestCase2.kt +/* + * TESTCASE NUMBER: 2 + * NOTE: + */ +package testPackCase2 +import LibPackCase2.a.* +import LibPackCase2.b.* + +fun case2 (){ + var b: B = B() + b += { C() } + + b += {1} +} + +class B { + private operator fun plusAssign(c: () -> C) {} + private operator fun plus(c: () -> C): C = c() //(3) +} +class C + +// FILE: LibCase2b.kt +package LibPackCase2.b +import LibPackCase2.a.* +import testPackCase2.B +import testPackCase2.C + +operator fun B.plusAssign( c: ()->C) {} //(2) + + +// FILE: LibCase2a.kt +package LibPackCase2.a +import testPackCase2.B + +operator fun B.plusAssign( c: ()->Int) {} //(1) diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.2.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.2.fir.kt index 1fdb7810d32..09355fd4f0e 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.2.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.2.fir.kt @@ -1,10 +1,25 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION +// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION -EXTENSION_SHADOWED_BY_MEMBER // SKIP_TXT +/* + * KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE) + * + * SPEC VERSION: 0.1-268 + * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 2 -> sentence 3 + * PRIMARY LINKS: overload-resolution, building-the-overload-candidate-set-ocs, call-with-an-explicit-receiver -> paragraph 6 -> sentence 1 + * overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 4 -> sentence 1 + * NUMBER: 1 + * DESCRIPTION: Non-extension member callables + */ + + // FILE: LibCase1.kt -// TESTCASE NUMBER: 1 +// TESTCASE NUMBER: 1, 2 +// TESTCASE NUMBER: 1, 2 package libPackage + import testPackCase1.Case import testPackCase1.Case.Inv import testPackCase1.Case.E @@ -15,60 +30,60 @@ operator fun Case.Inv.invoke(i: Int) = 1 // FILE: TestCase1.kt -// TESTCASE NUMBER: 1 +// TESTCASE NUMBER: 1, 2 package testPackCase1 import libPackage.plus import libPackage.* import libPackage.invoke + class Case() { class E(val plus: Inv? = null) { - /*operator*/ fun plus(value: Int) = Case() + operator fun plus(value: Int) = Case() } class Inv() { - /*operator*/ fun invoke(value: Int) = Case() + operator fun invoke(value: Int) = Case() } fun foo(e: E) { operator fun E.plus(value: Int) = Case() run { - e + 1 + e+1 } - e + 1 - + e+1 + e.plus(1) + e.plus?.invoke(1) //ok } } -// FILE: LibCase1.kt -// TESTCASE NUMBER: 2 +// FILE: LibCase3.kt +// TESTCASE NUMBER: 3, 4 package libPackage -import testPackCase2.Case -import testPackCase2.Case.Inv -import testPackCase2.Case.E +import testPackCase3.Case +import testPackCase3.Case.Inv +import testPackCase3.Case.E -operator fun Case.E.plus(value: Int) = Inv() +operator fun Case.E.plus(value: Int) = Inv() operator fun Case.Inv.invoke(i: Int) = 1 -// FILE: TestCase1.kt -// TESTCASE NUMBER: 2 -package testPackCase2 +// FILE: TestCase3.kt +// TESTCASE NUMBER: 3, 4 +package testPackCase3 import libPackage.plus import libPackage.* import libPackage.invoke -operator fun Case.E.plus(value: Int) = Case() - class Case() { class E(val plus: Inv? = null) { - /*operator*/ fun plus(value: Int) = Case() + operator fun plus(value: Int) = Case() } class Inv() { - /*operator*/ fun invoke(value: Int) = Case() + operator fun invoke(value: Int) = Case() } fun foo(e: E) { @@ -77,79 +92,89 @@ class Case() { run { operator fun E.plus(value: Int) = Case() - e + 1 + e+1 } - e + 1 + e+1 + } + fun boo(e: E) { + /*operator*/ fun E.plus(value: Int) = Case() + + run { + /*operator*/ fun E.plus(value: Int) = Case() + + e+1 + } + e+1 } } -// FILE: LibCase3.kt -// TESTCASE NUMBER: 3 +// FILE: LibCase5.kt +// TESTCASE NUMBER: 5, 6 package libPackage -import testPackCase3.Case -import testPackCase3.Case.Inv -import testPackCase3.Case.E + +import testPackCase5.Case +import testPackCase5.Case.Inv +import testPackCase5.Case.E operator fun Case.E.plusAssign(value: Int) {} operator fun Case.Inv.invoke(i: Int) {} -// FILE: TestCase3.kt -// TESTCASE NUMBER: 3 -package testPackCase3 +// FILE: TestCase6.kt +// TESTCASE NUMBER: 5, 6 +package testPackCase5 import libPackage.plusAssign -import libPackage.invoke import libPackage.* +import libPackage.invoke + class Case() { class E(val plusAssign: Inv? = null) { - /*operator*/ fun plusAssign(value: Int) {} + operator fun plusAssign(value: Int) {} } class Inv() { - /*operator*/ fun invoke(value: Int) {} + operator fun invoke(value: Int) {} } fun foo(e: E) { - operator fun E.plusAssign(value: Int) {} + operator fun Case.E.plusAssign(value: Int) {} run { - e += 1 + e+=1 } - e += 1 - + e+=1 + e.plusAssign(1) + e.plusAssign?.invoke(1) //ok } } -// FILE: LibCase4.kt -// TESTCASE NUMBER: 4 +// FILE: LibCase7.kt +// TESTCASE NUMBER: 7, 8 package libPackage -import testPackCase4.Case -import testPackCase4.Case.Inv -import testPackCase4.Case.E +import testPackCase8.Case +import testPackCase8.Case.Inv +import testPackCase8.Case.E operator fun Case.E.plusAssign(value: Int) {} operator fun Case.Inv.invoke(i: Int) {} - -// FILE: TestCase4.kt -// TESTCASE NUMBER: 4 -package testPackCase4 +// FILE: TestCase8.kt +// TESTCASE NUMBER: 7, 8 +package testPackCase8 import libPackage.plusAssign import libPackage.* import libPackage.invoke -operator fun Case.E.plusAssign(value: Int) {} - class Case() { class E(val plusAssign: Inv? = null) { - /*operator*/ fun plusAssign(value: Int) {} + operator fun plusAssign(value: Int) {} } class Inv() { - /*operator*/ fun invoke(value: Int) {} + operator fun invoke(value: Int) {} } fun foo(e: E) { @@ -158,48 +183,60 @@ class Case() { run { operator fun E.plusAssign(value: Int) {} - e += 1 + e+=1 } - e += 1 + e+=1 } -} + fun boo(e: E) { + /*operator*/ fun E.plusAssign(value: Int) {} + run { + /*operator*/ fun E.plusAssign(value: Int) {} -// FILE: TestCase5.kt -/* - * TESTCASE NUMBER: 5 - * UNEXPECTED BEHAVIOUR - * ISSUES: KT-36996 - */ -package testPackCase5 -import kotlin.reflect.KProperty - -class Delegate { - /*operator*/ fun getValue(thisRef: Any?, property: KProperty<*>): String { - return "" - } - - /*operator*/ fun setValue(thisRef: Any?, property: KProperty<*>, value: String) { - } -} - -operator fun Delegate.getValue(thisRef: Any?, property: KProperty<*>): String { - return "" -} -operator fun Delegate.setValue(thisRef: Any?, property: KProperty<*>, value: String) {} - -fun case() { - class Test { - var p: String by Delegate() - - operator fun Delegate.getValue(thisRef: Any?, property: KProperty<*>): String { - return "" + e+=1 } - operator fun Delegate.setValue(thisRef: Any?, property: KProperty<*>, value: String) { + e+=1 + } +} + + +// FILE: LibCase9.kt +// TESTCASE NUMBER: 9, 10 +package libPackage +import testPackCase10.Iterable +import testPackCase10.Inv + +operator fun Iterable.iterator() : CharIterator = TODO() +operator fun Inv.invoke() {} + +// FILE: TestCase10.kt +// TESTCASE NUMBER: 9, 10 +package testPackCase10 +import libPackage.iterator +import libPackage.invoke + +class Iterable(iterator: Inv) { + operator fun iterator() : CharIterator = TODO() +} + +class Inv(val c: Char) { + operator fun invoke(): CharIterator = TODO() +} + +operator fun Iterable.iterator() : CharIterator = TODO() + +fun case(){ + operator fun Iterable.iterator() : CharIterator = TODO() + val iterable: Iterable = Iterable(Inv('c')) + + fun foo(){ + iterable.iterator() + for (i in iterable) { + println(i) } } - val test = Test() - test.p = "NEW" - val x = test.p - + iterable.iterator() + for (i in iterable) { + println(i) + } } diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.2.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.2.kt index 61d4af30b45..6f4124e017c 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.2.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.2.kt @@ -14,7 +14,7 @@ */ -// FILE: LibCase1.kt +// FILE: LibCase11.kt // TESTCASE NUMBER: 1 package libPackage import testPackCase1.Case @@ -26,7 +26,7 @@ operator fun Case.E.plus(value: Int) = Inv() operator fun Case.Inv.invoke(i: Int) = 1 -// FILE: TestCase1.kt +// FILE: TestCase11.kt // TESTCASE NUMBER: 1 package testPackCase1 import libPackage.plus @@ -53,7 +53,7 @@ class Case() { } } -// FILE: LibCase1.kt +// FILE: LibCase12.kt // TESTCASE NUMBER: 2 package libPackage import testPackCase2.Case @@ -64,7 +64,7 @@ operator fun Case.E.plus(value: Int) = Inv() operator fun Case.Inv.invoke(i: Int) = 1 -// FILE: TestCase1.kt +// FILE: TestCase12.kt // TESTCASE NUMBER: 2 package testPackCase2 import libPackage.plus diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.3.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.3.fir.kt index ea137d5abf6..2c81293510a 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.3.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.3.fir.kt @@ -1,8 +1,20 @@ // !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION +// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION -EXTENSION_SHADOWED_BY_MEMBER // SKIP_TXT -// FILE: LibCase1.kt +/* + * KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE) + * + * SPEC VERSION: 0.1-268 + * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 2 -> sentence 3 + * PRIMARY LINKS: overload-resolution, building-the-overload-candidate-set-ocs, call-with-an-explicit-receiver -> paragraph 6 -> sentence 3 + * overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 4 -> sentence 1 + * NUMBER: 3 + * DESCRIPTION: Explicitly imported extension callables + */ + + +// FILE: LibCase11.kt // TESTCASE NUMBER: 1 package libPackage1 import testPackCase1.Case @@ -12,7 +24,7 @@ import testPackCase1.Case.E operator fun Case.E.plus(value: Int) = Inv() operator fun Case.Inv.invoke(i: Int) = 1 -// FILE: LibCase1.kt +// FILE: LibCase12.kt // TESTCASE NUMBER: 1 package libPackage2 import testPackCase1.Case @@ -50,7 +62,7 @@ class Case() { } } -// FILE: LibCase2.kt +// FILE: LibCase21.kt // TESTCASE NUMBER: 2 package libPackage1 import testPackCase2.Case @@ -60,7 +72,7 @@ import testPackCase2.Case.E operator fun Case.E.plus(value: Int) = Inv() operator fun Case.Inv.invoke(i: Int) = 1 -// FILE: LibCase2.kt +// FILE: LibCase22.kt // TESTCASE NUMBER: 2 package libPackage2 import testPackCase2.Case diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.3.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.3.kt index 74ba40ea5ad..9b2188007ea 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.3.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.3.kt @@ -14,7 +14,7 @@ */ -// FILE: LibCase1.kt +// FILE: LibCase11.kt // TESTCASE NUMBER: 1 package libPackage1 import testPackCase1.Case @@ -24,7 +24,7 @@ import testPackCase1.Case.E operator fun Case.E.plus(value: Int) = Inv() operator fun Case.Inv.invoke(i: Int) = 1 -// FILE: LibCase1.kt +// FILE: LibCase12.kt // TESTCASE NUMBER: 1 package libPackage2 import testPackCase1.Case @@ -62,7 +62,7 @@ class Case() { } } -// FILE: LibCase2.kt +// FILE: LibCase21.kt // TESTCASE NUMBER: 2 package libPackage1 import testPackCase2.Case @@ -72,7 +72,7 @@ import testPackCase2.Case.E operator fun Case.E.plus(value: Int) = Inv() operator fun Case.Inv.invoke(i: Int) = 1 -// FILE: LibCase2.kt +// FILE: LibCase22.kt // TESTCASE NUMBER: 2 package libPackage2 import testPackCase2.Case diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.4.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.4.fir.kt index a60cb063e41..2fd586d2d0f 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.4.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.4.fir.kt @@ -1,7 +1,19 @@ // !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION +// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION -EXTENSION_SHADOWED_BY_MEMBER // SKIP_TXT +/* + * KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE) + * + * SPEC VERSION: 0.1-268 + * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 2 -> sentence 3 + * PRIMARY LINKS: overload-resolution, building-the-overload-candidate-set-ocs, call-with-an-explicit-receiver -> paragraph 6 -> sentence 4 + * overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 4 -> sentence 1 + * NUMBER: 4 + * DESCRIPTION: Extension callables declared in the package scope + */ + + // FILE: LibCase1.kt // TESTCASE NUMBER: 1 package libPackage @@ -13,7 +25,7 @@ operator fun Case.E.plus(value: Int) = Case().Inv() operator fun Case.Inv.invoke(i: Int) = 1 -// FILE: TestCase1.kt +// FILE: TestCase11.kt // TESTCASE NUMBER: 1 package testPackCase1 import libPackage.* @@ -41,7 +53,7 @@ class Case() { } } -// FILE: Lib1.kt +// FILE: Lib11.kt // TESTCASE NUMBER: 2 package libPackage1 import testPackCase2.Case @@ -52,7 +64,7 @@ operator fun Case.E.plus(value: Int) = Inv() operator fun Case.Inv.invoke(i: Int) = 1 -// FILE: Lib2.kt +// FILE: Lib21.kt // TESTCASE NUMBER: 2 package testPackCase2 import testPackCase2.Case @@ -63,7 +75,7 @@ operator fun Case.E.plus(value: Int) = Inv() operator fun Case.Inv.invoke(i: Int) = 1 -// FILE: TestCase1.kt +// FILE: TestCase12.kt // TESTCASE NUMBER: 2 package testPackCase2 import libPackage1.* @@ -131,7 +143,7 @@ class Case() { } } -// FILE: Lib1.kt +// FILE: Lib12.kt // TESTCASE NUMBER: 4 package libPackage1 import testPackCase4.Case @@ -142,7 +154,7 @@ operator fun Case.E.plusAssign(value: Int) {} operator fun Case.Inv.invoke(i: Int) {} -// FILE: Lib2.kt +// FILE: Lib22.kt // TESTCASE NUMBER: 4 package testPackCase4 import testPackCase4.Case diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.4.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.4.kt index 7d4f72790b0..b498ba9dbbf 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.4.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.4.kt @@ -25,7 +25,7 @@ operator fun Case.E.plus(value: Int) = Case().Inv() operator fun Case.Inv.invoke(i: Int) = 1 -// FILE: TestCase1.kt +// FILE: TestCase11.kt // TESTCASE NUMBER: 1 package testPackCase1 import libPackage.* @@ -53,7 +53,7 @@ class Case() { } } -// FILE: Lib1.kt +// FILE: Lib11.kt // TESTCASE NUMBER: 2 package libPackage1 import testPackCase2.Case @@ -64,7 +64,7 @@ operator fun Case.E.plus(value: Int) = Inv() operator fun Case.Inv.invoke(i: Int) = 1 -// FILE: Lib2.kt +// FILE: Lib21.kt // TESTCASE NUMBER: 2 package testPackCase2 import testPackCase2.Case @@ -75,7 +75,7 @@ operator fun Case.E.plus(value: Int) = Inv() operator fun Case.Inv.invoke(i: Int) = 1 -// FILE: TestCase1.kt +// FILE: TestCase12.kt // TESTCASE NUMBER: 2 package testPackCase2 import libPackage1.* @@ -143,7 +143,7 @@ class Case() { } } -// FILE: Lib1.kt +// FILE: Lib12.kt // TESTCASE NUMBER: 4 package libPackage1 import testPackCase4.Case @@ -154,7 +154,7 @@ operator fun Case.E.plusAssign(value: Int) {} operator fun Case.Inv.invoke(i: Int) {} -// FILE: Lib2.kt +// FILE: Lib22.kt // TESTCASE NUMBER: 4 package testPackCase4 import testPackCase4.Case diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.5.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.5.fir.kt index 3f83f6964ff..e2a605db535 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.5.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.5.fir.kt @@ -1,7 +1,19 @@ // !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION +// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION -EXTENSION_SHADOWED_BY_MEMBER // SKIP_TXT +/* + * KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE) + * + * SPEC VERSION: 0.1-268 + * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 2 -> sentence 3 + * PRIMARY LINKS: overload-resolution, building-the-overload-candidate-set-ocs, call-with-an-explicit-receiver -> paragraph 6 -> sentence 5 + * overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 4 -> sentence 1 + * NUMBER: 5 + * DESCRIPTION: Star-imported extension callables + */ + + // FILE: LibCase1.kt // TESTCASE NUMBER: 1 package libPackage @@ -13,7 +25,7 @@ operator fun Case.E.plus(value: Int) = Inv() operator fun Case.Inv.invoke(i: Int) = 1 -// FILE: TestCase1.kt +// FILE: TestCase11.kt // TESTCASE NUMBER: 1 package testPackCase1 import libPackage.* @@ -44,7 +56,7 @@ package libPackage1 public inline operator fun CharSequence.contains(regex: Regex): Boolean = regex.containsMatchIn(this) -// FILE: TestCase1.kt +// FILE: TestCase12.kt // TESTCASE NUMBER: 2 package testPackCase2 import libPackage1.* diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.5.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.5.kt index 337983bf924..bdec8c27a03 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.5.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.5.kt @@ -25,7 +25,7 @@ operator fun Case.E.plus(value: Int) = Inv() operator fun Case.Inv.invoke(i: Int) = 1 -// FILE: TestCase1.kt +// FILE: TestCase11.kt // TESTCASE NUMBER: 1 package testPackCase1 import libPackage.* @@ -56,7 +56,7 @@ package libPackage1 public inline operator fun CharSequence.contains(regex: Regex): Boolean = regex.containsMatchIn(this) -// FILE: TestCase1.kt +// FILE: TestCase12.kt // TESTCASE NUMBER: 2 package testPackCase2 import libPackage1.* diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.6.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.6.fir.kt index c399a7f0f89..f34c9934d08 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.6.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-2/pos/3.6.fir.kt @@ -2,6 +2,18 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION // SKIP_TXT +/* + * KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE) + * + * SPEC VERSION: 0.1-268 + * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 2 -> sentence 3 + * PRIMARY LINKS: overload-resolution, building-the-overload-candidate-set-ocs, call-with-an-explicit-receiver -> paragraph 6 -> sentence 5 + * overload-resolution, building-the-overload-candidate-set-ocs, operator-call -> paragraph 4 -> sentence 1 + * NUMBER: 6 + * DESCRIPTION: Star-imported extension callables + */ + + // FILE: LibCase1.kt // TESTCASE NUMBER: 1 package libPackage diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-11/pos/4.2.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-11/pos/4.2.fir.kt index b01c02024a4..fbc8bd757ae 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-11/pos/4.2.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-11/pos/4.2.fir.kt @@ -3,7 +3,7 @@ // SKIP_TXT -// FILE: TestCase1.kt +// FILE: TestCase11.kt // TESTCASE NUMBER: 1 package testPackCase1 @@ -28,7 +28,7 @@ private fun Short.boo(x: Short, a: Any = ""): Unit = TODO() //(1.3) private fun Byte.boo(x: Byte, a: Any = "", b: Any = 1): Unit = TODO() //(1.4) private fun Byte.boo(x: Byte, a: Any = ""): Unit = TODO() //(1.4) -// FILE: TestCase1.kt +// FILE: TestCase12.kt // TESTCASE NUMBER: 2 package testPackCase2 import testPackCase2.Case2.Companion.boo @@ -76,7 +76,7 @@ fun case2(case: Case2) { case.run { 1.boo(1, 1) } } -// FILE: TestCase1.kt +// FILE: TestCase13.kt // TESTCASE NUMBER: 3 package testPackCase3 import testPackCase3.Case3.Companion.get diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-11/pos/4.2.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-11/pos/4.2.kt index dc4e94210be..b721b6118f1 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-11/pos/4.2.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-11/pos/4.2.kt @@ -15,7 +15,7 @@ * DESCRIPTION: call with explicit receiver (built-in integer types extesnsion): different built-in integer types and one of them is kotlin.Int */ -// FILE: TestCase1.kt +// FILE: TestCase11.kt // TESTCASE NUMBER: 1 package testPackCase1 @@ -40,7 +40,7 @@ private fun Short.boo(x: Short, a: Any = ""): Unit = TODO() //(1.3) private fun Byte.boo(x: Byte, a: Any = "", b: Any = 1): Unit = TODO() //(1.4) private fun Byte.boo(x: Byte, a: Any = ""): Unit = TODO() //(1.4) -// FILE: TestCase1.kt +// FILE: TestCase12.kt // TESTCASE NUMBER: 2 package testPackCase2 import testPackCase2.Case2.Companion.boo @@ -88,7 +88,7 @@ fun case2(case: Case2) { case.run { 1.boo(1, 1) } } -// FILE: TestCase1.kt +// FILE: TestCase13.kt // TESTCASE NUMBER: 3 package testPackCase3 import testPackCase3.Case3.Companion.get @@ -130,4 +130,4 @@ fun case3(case: Case3) { case.run { 1["1"] } case.run { 1["1"] } -} \ No newline at end of file +} diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-12/pos/2.2.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-12/pos/2.2.fir.kt index bcafafd5692..c45ae1c186e 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-12/pos/2.2.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-12/pos/2.2.fir.kt @@ -3,7 +3,7 @@ // SKIP_TXT -// FILE: TestCase1.kt +// FILE: TestCase11.kt // TESTCASE NUMBER: 1 package testPackCase1 @@ -24,7 +24,7 @@ private fun Long.boo(x: Long): Unit = TODO() //(1.2) private fun Short.boo(x: Short): Unit = TODO() //(1.3) private fun Byte.boo(x: Byte): Unit = TODO() //(1.4) -// FILE: TestCase1.kt +// FILE: TestCase12.kt // TESTCASE NUMBER: 2 package testPackCase2 import testPackCase2.Case2.Companion.boo @@ -68,7 +68,7 @@ fun case2(case: Case2) { case.run { 1.boo(1, 1) } } -// FILE: TestCase1.kt +// FILE: TestCase13.kt // TESTCASE NUMBER: 3 package testPackCase3 import testPackCase3.Case3.Companion.plus diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-12/pos/2.2.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-12/pos/2.2.kt index dc51b026932..197af53f726 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-12/pos/2.2.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-12/pos/2.2.kt @@ -14,7 +14,7 @@ * DESCRIPTION: call with explicit receiver (built-in integer types extesnsion): different built-in integer types and one of them is kotlin.Int */ -// FILE: TestCase1.kt +// FILE: TestCase11.kt // TESTCASE NUMBER: 1 package testPackCase1 @@ -35,7 +35,7 @@ private fun Long.boo(x: Long): Unit = TODO() //(1.2) private fun Short.boo(x: Short): Unit = TODO() //(1.3) private fun Byte.boo(x: Byte): Unit = TODO() //(1.4) -// FILE: TestCase1.kt +// FILE: TestCase12.kt // TESTCASE NUMBER: 2 package testPackCase2 import testPackCase2.Case2.Companion.boo @@ -79,7 +79,7 @@ fun case2(case: Case2) { case.run { 1.boo(1, 1) } } -// FILE: TestCase1.kt +// FILE: TestCase13.kt // TESTCASE NUMBER: 3 package testPackCase3 import testPackCase3.Case3.Companion.plus @@ -117,4 +117,4 @@ fun case3(case: Case3) { case.run { 1+"1" } case.run { 1+"1" } -} \ No newline at end of file +} diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg/2.2.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg/2.2.fir.kt index bb0cc4e3802..84d9c542ca1 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg/2.2.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg/2.2.fir.kt @@ -23,7 +23,7 @@ class B { } class C -// FILE: LibCase1.kt +// FILE: LibCase11.kt package LibPackCase1.b import LibPackCase1.a.* import testPackCase1.B @@ -32,7 +32,7 @@ import testPackCase1.C fun B?.boo( c: ()->C) {} //(2) -// FILE: LibCase1.kt +// FILE: LibCase12.kt package LibPackCase1.a import testPackCase1.B @@ -58,7 +58,7 @@ class B { } class C -// FILE: LibCase2.kt +// FILE: LibCase21.kt package LibPackCase2.b import LibPackCase2.a.* import testPackCase2.B @@ -67,7 +67,7 @@ import testPackCase2.C fun B?.boo( c: ()->C) {} //(2) -// FILE: LibCase2.kt +// FILE: LibCase22.kt package LibPackCase2.a import testPackCase2.B diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg/2.2.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg/2.2.kt index 89fa233de6d..f7ca5439fcb 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg/2.2.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg/2.2.kt @@ -31,7 +31,7 @@ class B { } class C -// FILE: LibCase1.kt +// FILE: LibCase11.kt package LibPackCase1.b import LibPackCase1.a.* import testPackCase1.B @@ -40,7 +40,7 @@ import testPackCase1.C fun B?.boo( c: ()->C) {} //(2) -// FILE: LibCase1.kt +// FILE: LibCase12.kt package LibPackCase1.a import testPackCase1.B @@ -66,7 +66,7 @@ class B { } class C -// FILE: LibCase2.kt +// FILE: LibCase21.kt package LibPackCase2.b import LibPackCase2.a.* import testPackCase2.B @@ -75,7 +75,7 @@ import testPackCase2.C fun B?.boo( c: ()->C) {} //(2) -// FILE: LibCase2.kt +// FILE: LibCase22.kt package LibPackCase2.a import testPackCase2.B diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description/p-2/neg/2.1.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description/p-2/neg/2.1.fir.kt index ef44bdfcb7f..1b7fc5d12b8 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description/p-2/neg/2.1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description/p-2/neg/2.1.fir.kt @@ -22,7 +22,7 @@ class B { } class C -// FILE: LibCase1.kt +// FILE: LibCase11.kt package LibPackCase1.b import LibPackCase1.a.* import testPackCase1.B @@ -31,7 +31,7 @@ import testPackCase1.C fun B?.boo( c: ()->C) {} //(2) -// FILE: LibCase1.kt +// FILE: LibCase12.kt package LibPackCase1.a import testPackCase1.B diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description/p-2/neg/2.1.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description/p-2/neg/2.1.kt index db68d7b68f7..6e1b7bb1212 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description/p-2/neg/2.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/determining-function-applicability-for-a-specific-call/description/p-2/neg/2.1.kt @@ -32,7 +32,7 @@ class B { } class C -// FILE: LibCase1.kt +// FILE: LibCase11.kt package LibPackCase1.b import LibPackCase1.a.* import testPackCase1.B @@ -41,9 +41,9 @@ import testPackCase1.C fun B?.boo( c: ()->C) {} //(2) -// FILE: LibCase1.kt +// FILE: LibCase12.kt package LibPackCase1.a import testPackCase1.B fun B?.boo( c: ()->Int) { //(1) -} \ No newline at end of file +} diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5/pos/2.1.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5/pos/2.1.kt index bf713895f90..8ad89eb918c 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5/pos/2.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5/pos/2.1.kt @@ -14,7 +14,7 @@ * DESCRIPTION: The implicit this receiver has higher priority than phantom static implicit this */ -// FILE: TestCase.kt +// FILE: TestCase1.kt // TESTCASE NUMBER: 1 package testsCase1 @@ -54,7 +54,7 @@ enum class Super_2 { } } -// FILE: TestCase.kt +// FILE: TestCase2.kt // TESTCASE NUMBER: 2 package testsCase2 diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5/pos/3.1.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5/pos/3.1.kt index ff5e15ae057..3d718ce07df 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5/pos/3.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5/pos/3.1.kt @@ -14,7 +14,7 @@ * DESCRIPTION: The phantom static implicit this receiver has higher priority than the current class companion object receiver */ -// FILE: TestCase.kt +// FILE: TestCase1.kt // TESTCASE NUMBER: 1 package testsCase1 @@ -50,7 +50,7 @@ enum class Super_2 { } } -// FILE: TestCase.kt +// FILE: TestCase2.kt // TESTCASE NUMBER: 2 package testsCase2 @@ -87,7 +87,7 @@ enum class Super_2 { } -// FILE: TestCase.kt +// FILE: TestCase3.kt // TESTCASE NUMBER: 3 package testsCase3 @@ -123,7 +123,7 @@ enum class Super_2 { } } -// FILE: TestCase.kt +// FILE: TestCase4.kt // TESTCASE NUMBER: 4 package testsCase4 diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5/pos/5.1.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5/pos/5.1.fir.kt index 6ad38479666..6d4df0c11d0 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5/pos/5.1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5/pos/5.1.fir.kt @@ -2,7 +2,7 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION // SKIP_TXT -// FILE: TestCase.kt +// FILE: TestCase1.kt // TESTCASE NUMBER: 1 package testsCase1 @@ -49,7 +49,7 @@ open class Super_2 : Super_1() { } -// FILE: TestCase.kt +// FILE: TestCase2.kt // TESTCASE NUMBER: 2 package testsCase2 @@ -95,7 +95,7 @@ open class Super_2 : Super_1() { } -// FILE: TestCase.kt +// FILE: TestCase3.kt // TESTCASE NUMBER: 3 package testsCase3 @@ -142,7 +142,7 @@ open class Super_2 : Super_1() { } -// FILE: TestCase.kt +// FILE: TestCase4.kt // TESTCASE NUMBER: 4 package testsCase4 diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5/pos/5.1.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5/pos/5.1.kt index 4110e134aa5..9af4bf2b5dc 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5/pos/5.1.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/receivers/p-5/pos/5.1.kt @@ -13,7 +13,7 @@ * DESCRIPTION: Superclass companion object receivers are prioritized according to the inheritance order */ -// FILE: TestCase.kt +// FILE: TestCase1.kt // TESTCASE NUMBER: 1 package testsCase1 @@ -60,7 +60,7 @@ open class Super_2 : Super_1() { } -// FILE: TestCase.kt +// FILE: TestCase2.kt // TESTCASE NUMBER: 2 package testsCase2 @@ -106,7 +106,7 @@ open class Super_2 : Super_1() { } -// FILE: TestCase.kt +// FILE: TestCase3.kt // TESTCASE NUMBER: 3 package testsCase3 @@ -153,7 +153,7 @@ open class Super_2 : Super_1() { } -// FILE: TestCase.kt +// FILE: TestCase4.kt // TESTCASE NUMBER: 4 package testsCase4 diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/10.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/10.fir.kt index 3e7cde4f5d6..7a69a61bd98 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/10.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/10.fir.kt @@ -284,7 +284,7 @@ fun case_12(value_1: Any?, value_2: Any?) { println(value_2?.toByte()) } if (funWithReturnsFalse(value_1 !is Float? || value_1 == null || value_2 == null)) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) } if (funWithReturnsNotNull(value_1 !is String || value_2 !is Number) == null) { @@ -300,7 +300,7 @@ fun case_12(value_1: Any?, value_2: Any?) { // TESTCASE NUMBER: 13 fun case_13(value_1: Any?, value_2: Any?) { if (!funWithReturnsTrueAndInvertCondition(value_1 is Float? && value_1 != null && value_2 != null)) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) } if (funWithReturnsFalseAndInvertCondition(value_1 is String && value_2 is Number)) { @@ -320,7 +320,7 @@ fun case_13(value_1: Any?, value_2: Any?) { println(value_2?.toByte()) } if (funWithReturnsNotNull(value_1 is Float? && value_1 != null && value_2 != null) == null) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) } if (funWithReturnsNullAndInvertCondition(value_1 is String && value_2 is Number) != null) { @@ -332,7 +332,7 @@ fun case_13(value_1: Any?, value_2: Any?) { println(value_2?.toByte()) } if (funWithReturnsNull(value_1 is Float? && value_1 != null && value_2 != null) != null) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) } } @@ -344,22 +344,22 @@ class case_14_class { fun case_14(value_1: Any?, value_2: Number?) { val o = case_14_class() if (!funWithReturnsTrueAndInvertCondition(value_1 is Float? && value_1 != null && value_2 != null && o.prop_1 != null)) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) println(o.prop_1.plus(3)) } if (funWithReturnsFalse(value_1 !is Float? || value_1 == null || value_2 == null || o.prop_1 == null || this.prop_1 == null)) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) println(o.prop_1.plus(3)) } if (funWithReturnsNotNull(value_1 !is Float? || value_1 == null || value_2 == null || o.prop_1 == null || this.prop_1 == null) == null) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) println(o.prop_1.plus(3)) } if (funWithReturnsNull(value_1 !is Float? || value_1 == null || value_2 == null || o.prop_1 == null || this.prop_1 == null) != null) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) println(o.prop_1.plus(3)) } @@ -413,25 +413,25 @@ class case_17_class { fun case_17(value_1: Any?, value_2: Number?) { val o = case_17_class() if (contracts.case_17_1(value_1, value_2, o.prop_1, this.prop_1)) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) println(o.prop_1.plus(3)) println(this.prop_1.plus(3)) } if (contracts.case_17_2(value_1, value_2, o.prop_1, this.prop_1)) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) println(o.prop_1.plus(3)) println(this.prop_1.plus(3)) } if (contracts.case_17_3(value_1, value_2, o.prop_1, this.prop_1) == null) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) println(o.prop_1.plus(3)) println(this.prop_1.plus(3)) } if (contracts.case_17_4(value_1, value_2, o.prop_1, this.prop_1) != null) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) println(o.prop_1.plus(3)) println(this.prop_1.plus(3)) diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/2.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/2.fir.kt index 71b1dfe97cc..bc29a2981e5 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/2.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/2.fir.kt @@ -26,7 +26,7 @@ fun case_3(value_1: Any?, value_2: Any?) { // TESTCASE NUMBER: 4 fun case_4(value_1: Any?, value_2: Number?) { funWithReturns(value_1 !is Float? || value_1 == null || value_2 == null) - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) } @@ -36,7 +36,7 @@ class case_5_class { fun case_5(value_1: Any?, value_2: Number?) { val o = case_5_class() funWithReturns(value_1 !is Float? || value_1 == null || value_2 == null || o.prop_1 == null) - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) println(o.prop_1.plus(3)) } @@ -105,19 +105,19 @@ fun case_8(value_1: Any?, value_2: Any?) { // TESTCASE NUMBER: 9 fun case_9(value_1: Any?, value_2: Number?) { if (funWithReturnsTrue(value_1 !is Float? || value_1 == null || value_2 == null)) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) } if (!funWithReturnsFalse(value_1 !is Float? || value_1 == null || value_2 == null)) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) } if (funWithReturnsNotNull(value_1 is Float? && value_1 != null && value_2 != null) == null) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) } if (funWithReturnsNull(value_1 is Float? && value_1 != null && value_2 != null) != null) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) } } @@ -129,22 +129,22 @@ class case_10_class { fun case_10(value_1: Any?, value_2: Number?) { val o = case_10_class() if (funWithReturnsTrue(value_1 !is Float? || value_1 == null || value_2 == null || o.prop_1 == null || this.prop_1 == null)) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) println(o.prop_1.plus(3)) } if (!funWithReturnsFalse(value_1 !is Float? || value_1 == null || value_2 == null || o.prop_1 == null || this.prop_1 == null)) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) println(o.prop_1.plus(3)) } if (funWithReturnsNotNull(value_1 !is Float? || value_1 == null || value_2 == null || o.prop_1 == null || this.prop_1 == null) != null) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) println(o.prop_1.plus(3)) } if (funWithReturnsNull(value_1 !is Float? || value_1 == null || value_2 == null || o.prop_1 == null || this.prop_1 == null) == null) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) println(o.prop_1.plus(3)) } @@ -156,5 +156,5 @@ fun case_11(value_1: Any?, value_2: Any?, value_3: Any?) { funWithReturnsAndInvertCondition(value_1 !is String? || value_2 !is Number && value_3 !is Float) println(value_1!!.length) println(value_2.toByte()) - println(value_3.dec()) + println(value_3.dec()) } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/3.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/3.fir.kt index 8601a996205..65b309dbade 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/3.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/3.fir.kt @@ -103,7 +103,7 @@ class case_3_class { fun case_3(value_1: Any?, value_2: Number?) { val o = case_3_class() contracts.case_3(value_1, value_2, o.prop_1, this.prop_1) - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) println(o.prop_1.plus(3)) } @@ -156,22 +156,22 @@ class case_6_class { fun case_6(value_1: Any?, value_2: Number?) { val o = case_6_class() if (contracts.case_6_1(value_1, value_2, o.prop_1, this.prop_1)) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) println(o.prop_1.plus(3)) } if (!contracts.case_6_2(value_1, value_2, o.prop_1, this.prop_1)) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) println(o.prop_1.plus(3)) } if (contracts.case_6_3(value_1, value_2, o.prop_1, this.prop_1) == null) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) println(o.prop_1.plus(3)) } if (contracts.case_6_4(value_1, value_2, o.prop_1, this.prop_1) != null) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) println(o.prop_1.plus(3)) } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/3.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/3.fir.kt index a043ccc1007..e67dd1005fc 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/3.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/3.fir.kt @@ -102,7 +102,7 @@ class case_3_class { fun case_3(value_1: Any?, value_2: Number?) { val o = case_3_class() contracts.case_3(value_1, value_2, o.prop_1, this.prop_1) - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) println(o.prop_1.plus(3)) } @@ -154,22 +154,22 @@ class case_6_class { fun case_6(value_1: Any?, value_2: Number?) { val o = case_6_class() if (contracts.case_6_1(value_1, value_2, o.prop_1, this.prop_1)) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) println(o.prop_1.plus(3)) } if (!contracts.case_6_2(value_1, value_2, o.prop_1, this.prop_1)) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) println(o.prop_1.plus(3)) } if (contracts.case_6_3(value_1, value_2, o.prop_1, this.prop_1) != null) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) println(o.prop_1.plus(3)) } if (contracts.case_6_4(value_1, value_2, o.prop_1, this.prop_1) == null) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) println(o.prop_1.plus(3)) } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/5.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/5.fir.kt index 7031f7e570d..fe826fa59ae 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/5.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/5.fir.kt @@ -273,11 +273,11 @@ fun case_11(x: Any?) { */ fun case_12(x: Any?) { if (x is Interface1? && x != null && x is Interface2?) { - x - x.itest1() - x.itest2() + x + x.itest1() + x.itest2() - x.let { it.itest1(); it.itest2() } + x.let { it.itest1(); it.itest2() } } } @@ -293,12 +293,12 @@ fun case_13(x: Any?) { if (x is ClassLevel2? && x is Interface1?) { if (x !is Interface3?) {} else if (false) { if (x != null) { - x - x.itest1() - x.itest2() - x.itest3() - x.test1() - x.test2() + x + x.itest1() + x.itest2() + x.itest3() + x.test1() + x.test2() } } } @@ -341,19 +341,19 @@ fun case_15(x: Any?) { if (x !is ClassLevel2? || x !is ClassLevel1?) else { if (x === null || x !is Interface1?) else { if (x !is Interface2? || x !is Interface3?) {} else { - x - x.itest2() - x.itest1() - x.itest3() - x.test1() - x.test2() + x + x.itest2() + x.itest1() + x.itest3() + x.test1() + x.test2() } } } } // TESTCASE NUMBER: 16 -fun case_16(a: Any?, b: Int = if (a is Number? && a is Int? && a !== null) a else 0) { +fun case_16(a: Any?, b: Int = if (a is Number? && a is Int? && a !== null) a else 0) { a b b.equals(null) @@ -368,7 +368,7 @@ fun case_16(a: Any?, b: Int = if (a is Number? && a is Int? && a !== null) a) { +fun case_17(a: Any?, b: Int = if (a !is Number? || a !is Int? || a == null) 0 else a) { a b b.equals(null) diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/6.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/6.fir.kt index b4a309ba3a0..3f6e10f3772 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/6.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/6.fir.kt @@ -363,17 +363,17 @@ fun case_19(b: Boolean) { } } else z - if (a != z && a.B19 !== z && a.B19.C19 != z && a.B19.C19.D19 != z && a.B19.C19.D19.x !== z) { - a.B19.C19.D19.x - a.B19.C19.D19.x.equals(null) - a.B19.C19.D19.x.propT - a.B19.C19.D19.x.propAny - a.B19.C19.D19.x.propNullableT - a.B19.C19.D19.x.propNullableAny - a.B19.C19.D19.x.funT() - a.B19.C19.D19.x.funAny() - a.B19.C19.D19.x.funNullableT() - a.B19.C19.D19.x.funNullableAny() + if (a != z && a.B19 !== z && a.B19.C19 != z && a.B19.C19.D19 != z && a.B19.C19.D19.x !== z) { + a.B19.C19.D19.x + a.B19.C19.D19.x.equals(null) + a.B19.C19.D19.x.propT + a.B19.C19.D19.x.propAny + a.B19.C19.D19.x.propNullableT + a.B19.C19.D19.x.propNullableAny + a.B19.C19.D19.x.funT() + a.B19.C19.D19.x.funAny() + a.B19.C19.D19.x.funNullableT() + a.B19.C19.D19.x.funNullableAny() } } @@ -422,7 +422,7 @@ fun case_21() { // TESTCASE NUMBER: 22 fun case_22(a: (() -> Unit)?) { if (a != implicitNullableNothingProperty) { - a() + a() ?")!>a.equals(null) ?")!>a.propT ?")!>a.propAny @@ -438,18 +438,18 @@ fun case_22(a: (() -> Unit)?) { // TESTCASE NUMBER: 23 fun case_23(a: ((Float) -> Int?)?, b: Float?, z: Nothing?) { if (a != z && b !== z && b !== z) { - val x = a(b) + val x = a(b) if (x != z || x !== implicitNullableNothingProperty) { - x - x.equals(null) - x.propT - x.propAny - x.propNullableT - x.propNullableAny - x.funT() - x.funAny() - x.funNullableT() - x.funNullableAny() + x + x.equals(null) + x.propT + x.propAny + x.propNullableT + x.propNullableAny + x.funT() + x.funAny() + x.funNullableT() + x.funNullableAny() } } } @@ -489,19 +489,19 @@ fun case_25(b: Boolean, z: Nothing?) { val y = if (b) x else z if (y !== z || y != implicitNullableNothingProperty) { - val z1 = y() + val z1 = ?")!>y() if (z1 != z && implicitNullableNothingProperty !== z1) { - z1.a - z1.equals(null) - z1.propT - z1.propAny - z1.propNullableT - z1.propNullableAny - z1.funT() - z1.funAny() - z1.funNullableT() - z1.funNullableAny() + ?")!>z1.a + ?")!>z1.equals(null) + ?")!>z1.propT + ?")!>z1.propAny + ?")!>z1.propNullableT + ?")!>z1.propNullableAny + ?")!>z1.funT() + ?")!>z1.funAny() + ?")!>z1.funNullableT() + ?")!>z1.funNullableAny() } } } @@ -511,18 +511,18 @@ fun case_26(a: ((Float) -> Int?)?, b: Float?) { var z = null if (a != z == true && b != implicitNullableNothingProperty == true) { - val x = a(b) + val x = a(b) if (x != implicitNullableNothingProperty == true || z !== x) { - x - x.equals(null) - x.propT - x.propAny - x.propNullableT - x.propNullableAny - x.funT() - x.funAny() - x.funNullableT() - x.funNullableAny() + x + x.equals(null) + x.propT + x.propAny + x.propNullableT + x.propNullableAny + x.funT() + x.funAny() + x.funNullableT() + x.funNullableAny() } } } @@ -575,19 +575,19 @@ fun case_29(x: Boolean) { val y = if (x) z else null if (false || false || false || false || y !== v) { - val t = y() + val t = ?")!>y() if (z !== t || false) { - t.a - t.equals(null) - t.propT - t.propAny - t.propNullableT - t.propNullableAny - t.funT() - t.funAny() - t.funNullableT() - t.funNullableAny() + ?")!>t.a + ?")!>t.equals(null) + ?")!>t.propT + ?")!>t.propAny + ?")!>t.propNullableT + ?")!>t.propNullableAny + ?")!>t.funT() + ?")!>t.funAny() + ?")!>t.funNullableT() + ?")!>t.funNullableAny() } } } @@ -595,18 +595,18 @@ fun case_29(x: Boolean) { // TESTCASE NUMBER: 30 fun case_30(a: ((Float) -> Int?)?, b: Float?) { if (implicitNullableNothingProperty != a == true && b != implicitNullableNothingProperty == true || false || false || false || false || false || false || false || false || false) { - val x = a(b) + val x = a(b) if (false || implicitNullableNothingProperty != x == true) { - x - x.equals(null) - x.propT - x.propAny - x.propNullableT - x.propNullableAny - x.funT() - x.funAny() - x.funNullableT() - x.funNullableAny() + x + x.equals(null) + x.propT + x.propAny + x.propNullableT + x.propNullableAny + x.funT() + x.funAny() + x.funNullableT() + x.funNullableAny() } } } @@ -651,20 +651,20 @@ fun case_33(a: ((Float) -> Int?)?, b: Float?, c: Boolean?) { if (true && a == z == true || b == null == true) { } else { - val x = a(b) + val x = a(b) if (x == z == true && x === z || (c != z && !c)) { } else { - x - x.equals(null) - x.propT - x.propAny - x.propNullableT - x.propNullableAny - x.funT() - x.funAny() - x.funNullableT() - x.funNullableAny() + x + x.equals(null) + x.propT + x.propAny + x.propNullableT + x.propNullableAny + x.funT() + x.funAny() + x.funNullableT() + x.funNullableAny() } } } @@ -714,7 +714,7 @@ fun case_36(x: Any) { if (x == z) { x - x.java + x.java } } @@ -736,7 +736,7 @@ fun case_38() { if (Object.prop_2 != z) else { Object.prop_2 - Object.prop_2.java + Object.prop_2.java } } @@ -953,9 +953,9 @@ fun case_54(b: Boolean) { val z = null - if (a != z && a.B54 !== a.z && a.B54.C54 != a.z && a.B54.C54.D54 != a.z && a.B54.C54.D54.x === a.z) { - a.B54.C54.D54.x - a.B54.C54.D54.x.hashCode() + if (a != z && a.B54 !== a.z && a.B54.C54 != a.z && a.B54.C54.D54 != a.z && a.B54.C54.D54.x === a.z) { + a.B54.C54.D54.x + a.B54.C54.D54.x.hashCode() } } @@ -994,7 +994,7 @@ fun case_57(a: (() -> Unit)) { if (a == z) { ")!>a - ")!>a.java + ")!>a.java } } @@ -1008,7 +1008,7 @@ fun case_58(a: ((Float) -> Int?)?, b: Float?, z: Nothing?) { b if (a != z) { ?")!>a - ?")!>a.java + ?")!>a.java } } } @@ -1054,10 +1054,10 @@ fun case_60(b: Boolean) { val y = if (b) x else nullableNothingProperty if (y != nullableNothingProperty) { - val z = y() + val z = ?")!>y() if (z == nullableNothingProperty) { - z + ?")!>z } } } @@ -1296,11 +1296,11 @@ fun case_71(t: Any?) { if (t is Interface2?) { if (t != z2) { t - t.itest1() - t.itest2() - t.itest() + t.itest1() + t.itest2() + t.itest() - t.let { it.itest1(); it.itest2() } + t.let { it.itest1(); it.itest2() } } } } @@ -1317,12 +1317,12 @@ fun case_72(t: Any?, z1: Nothing?) { var z2 = null if (t is Interface1? && t != z1 ?: z2 && t is Interface2?) { - t - t.itest1() - t.itest2() - t.itest() + t + t.itest1() + t.itest2() + t.itest() - t.let { it.itest1(); it.itest2() } + t.let { it.itest1(); it.itest2() } } } @@ -1341,12 +1341,12 @@ fun case_73(t: Any?) { if (t is ClassLevel2? && t is Interface1?) { if (t !is Interface3?) {} else if (false) { if (t != `null`) { - t.itest2() - t.itest1() - t.itest() - t.test1() - t.test2() - t + t.itest2() + t.itest1() + t.itest() + t.test1() + t.test2() + t } } } @@ -1366,11 +1366,11 @@ fun case_74(t: Any?) { if (t == implicitNullableNothingProperty || t === implicitNullableNothingProperty || t !is Interface1?) else { if (t is ClassLevel2?) { if (t is Interface3?) { - t.itest2() - t.itest1() - t.itest() - t.test1() - t.test2() + t.itest2() + t.itest1() + t.itest() + t.test1() + t.test2() t } } @@ -1389,19 +1389,19 @@ fun case_75(t: Any?, z: Nothing?) { if (t !is ClassLevel2? || t !is ClassLevel1?) else { if (t === ((((((z)))))) || t !is Interface1?) else { if (t !is Interface2? || t !is Interface3?) {} else { - t.itest2() - t.itest1() - t.itest() - t.test1() - t.test2() - t + t.itest2() + t.itest1() + t.itest() + t.test1() + t.test2() + t } } } } // TESTCASE NUMBER: 76 -fun case_76(a: Any?, b: Int = if (a !is Number? === true || a !is Int? == true || a != null == false == true) 0 else a) { +fun case_76(a: Any?, b: Int = if (a !is Number? === true || a !is Int? == true || a != null == false == true) 0 else a) { a b b.equals(null) diff --git a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/checkers/AbstractFirDiagnosticsTestSpec.kt b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/checkers/AbstractFirDiagnosticsTestSpec.kt deleted file mode 100644 index 49e5b419abf..00000000000 --- a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/checkers/AbstractFirDiagnosticsTestSpec.kt +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package org.jetbrains.kotlin.spec.checkers - -import org.jetbrains.kotlin.fir.AbstractFirOldFrontendDiagnosticsTest -import org.jetbrains.kotlin.psi.KtFile -import org.jetbrains.kotlin.spec.utils.models.AbstractSpecTest -import org.jetbrains.kotlin.spec.utils.parsers.CommonParser -import org.jetbrains.kotlin.test.ConfigurationKind -import java.io.File - -abstract class AbstractFirDiagnosticsTestSpec : AbstractFirOldFrontendDiagnosticsTest() { - private lateinit var specTest: AbstractSpecTest - - override fun extractConfigurationKind(files: List): ConfigurationKind { - return ConfigurationKind.ALL - } - - override fun getKtFiles(testFiles: List, includeExtras: Boolean): List { - val ktFiles = super.getKtFiles(testFiles, includeExtras) as MutableList - - ktFiles.addAll(AbstractDiagnosticsTestSpec.additionalKtFiles(specTest, project)) - - return ktFiles - } - - override fun analyzeAndCheck(testDataFile: File, files: List) { - val testFilePath = testDataFile.canonicalPath - val testWithMetaInfoPath = if (!testFilePath.contains(".fir.kt")) testFilePath else testFilePath.replace(".fir.kt", ".kt") - specTest = CommonParser.parseSpecTest(testWithMetaInfoPath, files.associate { Pair(it.fileName, it.clearText) }).first - - super.analyzeAndCheck(testDataFile, files) - } -} diff --git a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/tasks/GenerateSpecTests.kt b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/tasks/GenerateSpecTests.kt index 4ce74268fda..a83fc325d09 100644 --- a/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/tasks/GenerateSpecTests.kt +++ b/compiler/tests-spec/tests/org/jetbrains/kotlin/spec/utils/tasks/GenerateSpecTests.kt @@ -7,7 +7,6 @@ package org.jetbrains.kotlin.spec.utils.tasks import org.jetbrains.kotlin.generators.impl.generateTestGroupSuite import org.jetbrains.kotlin.spec.checkers.AbstractDiagnosticsTestSpec -import org.jetbrains.kotlin.spec.checkers.AbstractFirDiagnosticsTestSpec import org.jetbrains.kotlin.spec.codegen.AbstractBlackBoxCodegenTestSpec import org.jetbrains.kotlin.spec.parsing.AbstractParsingTestSpec import org.jetbrains.kotlin.spec.utils.GeneralConfiguration.SPEC_TESTDATA_PATH @@ -15,6 +14,8 @@ import org.jetbrains.kotlin.spec.utils.GeneralConfiguration.SPEC_TEST_PATH import org.jetbrains.kotlin.spec.utils.GeneralConfiguration.TESTS_MAP_FILENAME import org.jetbrains.kotlin.spec.utils.SectionsJsonMapGenerator import org.jetbrains.kotlin.spec.utils.TestsJsonMapGenerator +import org.jetbrains.kotlin.test.generators.generateTestGroupSuiteWithJUnit5 +import org.jetbrains.kotlin.test.runners.AbstractFirDiagnosticTestSpec import java.io.File import java.nio.file.Files @@ -49,14 +50,6 @@ fun generateTests() { ) } - testClass { - model( - "diagnostics", - excludeDirs = listOf("helpers") + detectDirsWithTestsMapFileOnly("diagnostics"), - excludedPattern = excludedFirTestdataPattern - ) - } - testClass { model( relativeRootPath = "psi", @@ -69,6 +62,18 @@ fun generateTests() { } } } + + generateTestGroupSuiteWithJUnit5 { + testGroup(testsRoot = "compiler/fir/analysis-tests/tests-gen", testDataRoot = SPEC_TESTDATA_PATH) { + testClass { + model( + "diagnostics", + excludeDirs = listOf("helpers") + detectDirsWithTestsMapFileOnly("diagnostics"), + excludedPattern = excludedFirTestdataPattern + ) + } + } + } } fun main() { From e928448e006b732e6f98da9c1edb49bf6985ac71 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Mon, 25 Jan 2021 13:01:19 +0300 Subject: [PATCH 022/212] [Test] Fix default jps `[JSP] Fast FIR tests` run configuration --- gradle/jps.gradle.kts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/gradle/jps.gradle.kts b/gradle/jps.gradle.kts index e2ba0d0ab35..7b6c38acc4d 100644 --- a/gradle/jps.gradle.kts +++ b/gradle/jps.gradle.kts @@ -64,16 +64,16 @@ fun setupGenerateAllTestsRunConfiguration() { fun setupFirRunConfiguration() { val tests = listOf( - "org\\.jetbrains\\.kotlin\\.fir((?!\\.lightTree\\.benchmark)(\\.\\w+)*)\\.((?!(TreesCompareTest|TotalKotlinTest|RawFirBuilderTotalKotlinTestCase))\\w+)", - "org\\.jetbrains\\.kotlin\\.codegen\\.ir\\.FirBlackBoxCodegenTestGenerated", - "org\\.jetbrains\\.kotlin\\.spec\\.checkers\\.FirDiagnosticsTestSpecGenerated", - "org\\.jetbrains\\.kotlin\\.codegen\\.ir\\.FirBytecodeTextTestGenerated", - "org\\.jetbrains\\.kotlin\\.codegen\\.ir\\.FirBlackBoxAgainstJavaCodegenTestGenerated", - "org\\.jetbrains\\.kotlin\\.codegen\\.ir\\.FirBlackBoxInlineCodegenTestGenerated" + "org\\.jetbrains\\.kotlin\\.test\\.runners\\.FirDiagnosticsWithLightTreeTestGenerated", + "org\\.jetbrains\\.kotlin\\.test\\.runners\\.FirDiagnosticTestGenerated", + "org\\.jetbrains\\.kotlin\\.test\\.runners\\.FirDiagnosticTestSpecGenerated", + "org\\.jetbrains\\.kotlin\\.test\\.runners\\.FirOldFrontendDiagnosticsTestGenerated", + "org\\.jetbrains\\.kotlin\\.test\\.runners\\.ir\\.Fir2IrTextTestGenerated", + "org\\.jetbrains\\.kotlin\\.test\\.runners\\.codegen\\.FirBlackBoxCodegenTestGenerated" ) val junit = JUnit("_stub").apply { configureForKotlin("2048m") } - junit.moduleName = "kotlin.compiler.tests-spec.test" + junit.moduleName = "kotlin.compiler.fir.analysis-tests.test" junit.pattern = tests.joinToString(separator = "|", prefix = "^(", postfix = ")\$") junit.vmParameters = junit.vmParameters.replace(rootDir.absolutePath, "\$PROJECT_DIR\$") junit.workingDirectory = junit.workingDirectory.replace(rootDir.absolutePath, "\$PROJECT_DIR\$") @@ -85,7 +85,7 @@ fun setupFirRunConfiguration() { | | | | | From f61a318c9d815bc7ca5b16814a2a0ff405c7133c Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Mon, 25 Jan 2021 14:40:14 +0300 Subject: [PATCH 023/212] [Test] Migrate AbstractBytecodeTextTest to new test infrastructure --- .../FirBytecodeTextTestGenerated.java | 1540 ++++++++++------ .../kotlin/codegen/BytecodeTextUtils.kt | 144 ++ .../coroutines/internalInlineSuspend.kt | 6 +- .../bytecodeText/inlineJavaStaticFields.kt | 3 +- .../bytecodeText/jvmStaticInternalMangling.kt | 4 +- .../dontGenerateOnJvmOverloads.kt | 3 +- .../preEvaluateInlineJavaStaticFields.kt | 3 +- .../bytecodeText/sam/samWrapperRawTypes.kt | 4 +- .../stringOperations/kt42457_old.kt | 3 +- .../codegen/BytecodeTextTestGenerated.java | 1555 +++++++++++------ .../codegen}/IrBytecodeTextTestGenerated.java | 1540 ++++++++++------ .../backend/handlers/BytecodeTextHandler.kt | 63 + .../test/directives/CodegenTestDirectives.kt | 5 + .../codegen/AbstractBytecodeTextTest.kt | 101 ++ .../AbstractJvmBlackBoxCodegenTestBase.kt | 34 +- .../codegen/BaseCodegenConfiguration.kt | 51 + .../codegen/AbstractBytecodeTextTest.kt | 137 +- ...AbstractTopLevelMembersInvocationTest.java | 6 +- .../AbstractComposeLikeIrBytecodeTextTest.kt | 2 + .../codegen/ir/AbstractFirBytecodeTextTest.kt | 18 - .../codegen/ir/AbstractIrBytecodeTextTest.kt | 13 - .../kotlin/test/JvmCompilationUtils.kt | 21 +- .../generators/GenerateJUnit3CompilerTests.kt | 12 - .../generators/GenerateJUnit5CompilerTests.kt | 16 +- .../kotlin/codegen/CustomBytecodeTextTest.kt | 2 + .../test/AbstractAndroidBytecodeShapeTest.kt | 7 +- 26 files changed, 3556 insertions(+), 1737 deletions(-) rename compiler/fir/{fir2ir/tests-gen/org/jetbrains/kotlin/codegen/ir => analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen}/FirBytecodeTextTestGenerated.java (88%) create mode 100644 compiler/test-infrastructure-utils/tests/org/jetbrains/kotlin/codegen/BytecodeTextUtils.kt rename compiler/{tests-gen/org/jetbrains/kotlin => tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners}/codegen/BytecodeTextTestGenerated.java (89%) rename compiler/{tests-gen/org/jetbrains/kotlin/codegen/ir => tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen}/IrBytecodeTextTestGenerated.java (90%) create mode 100644 compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/BytecodeTextHandler.kt create mode 100644 compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/codegen/AbstractBytecodeTextTest.kt create mode 100644 compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/codegen/BaseCodegenConfiguration.kt delete mode 100644 compiler/tests-common/tests/org/jetbrains/kotlin/codegen/ir/AbstractFirBytecodeTextTest.kt delete mode 100644 compiler/tests-common/tests/org/jetbrains/kotlin/codegen/ir/AbstractIrBytecodeTextTest.kt diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/ir/FirBytecodeTextTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBytecodeTextTestGenerated.java similarity index 88% rename from compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/ir/FirBytecodeTextTestGenerated.java rename to compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBytecodeTextTestGenerated.java index 5aab02dcb1e..164c8ac8a44 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/ir/FirBytecodeTextTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBytecodeTextTestGenerated.java @@ -3,739 +3,843 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.codegen.ir; +package org.jetbrains.kotlin.test.runners.codegen; import com.intellij.testFramework.TestDataPath; -import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; -import org.jetbrains.kotlin.test.KotlinTestUtils; import org.jetbrains.kotlin.test.util.KtTestUtil; import org.jetbrains.kotlin.test.TargetBackend; import org.jetbrains.kotlin.test.TestMetadata; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; import java.io.File; import java.util.regex.Pattern; -/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ +/** This class is generated by {@link GenerateNewCompilerTests.kt}. DO NOT MODIFY MANUALLY */ @SuppressWarnings("all") @TestMetadata("compiler/testData/codegen/bytecodeText") @TestDataPath("$PROJECT_ROOT") -@RunWith(JUnit3RunnerWithInners.class) public class FirBytecodeTextTestGenerated extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + @Test @TestMetadata("accessorForOverridenVal.kt") public void testAccessorForOverridenVal() throws Exception { runTest("compiler/testData/codegen/bytecodeText/accessorForOverridenVal.kt"); } + @Test @TestMetadata("accessorForProtected.kt") public void testAccessorForProtected() throws Exception { runTest("compiler/testData/codegen/bytecodeText/accessorForProtected.kt"); } + @Test @TestMetadata("accessorNaming.kt") public void testAccessorNaming() throws Exception { runTest("compiler/testData/codegen/bytecodeText/accessorNaming.kt"); } + @Test public void testAllFilesPresentInBytecodeText() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true, "oldLanguageVersions"); } + @Test @TestMetadata("annotationDefaultValue.kt") public void testAnnotationDefaultValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/annotationDefaultValue.kt"); } + @Test @TestMetadata("annotationJavaRetentionPolicyRuntime.kt") public void testAnnotationJavaRetentionPolicyRuntime() throws Exception { runTest("compiler/testData/codegen/bytecodeText/annotationJavaRetentionPolicyRuntime.kt"); } + @Test @TestMetadata("annotationRetentionPolicyClass.kt") public void testAnnotationRetentionPolicyClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/annotationRetentionPolicyClass.kt"); } + @Test @TestMetadata("annotationRetentionPolicyRuntime.kt") public void testAnnotationRetentionPolicyRuntime() throws Exception { runTest("compiler/testData/codegen/bytecodeText/annotationRetentionPolicyRuntime.kt"); } + @Test @TestMetadata("annotationRetentionPolicySource.kt") public void testAnnotationRetentionPolicySource() throws Exception { runTest("compiler/testData/codegen/bytecodeText/annotationRetentionPolicySource.kt"); } + @Test @TestMetadata("boxedNotNumberTypeOnUnboxing.kt") public void testBoxedNotNumberTypeOnUnboxing() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxedNotNumberTypeOnUnboxing.kt"); } + @Test @TestMetadata("bridgeForFakeOverride.kt") public void testBridgeForFakeOverride() throws Exception { runTest("compiler/testData/codegen/bytecodeText/bridgeForFakeOverride.kt"); } + @Test @TestMetadata("charConstant.kt") public void testCharConstant() throws Exception { runTest("compiler/testData/codegen/bytecodeText/charConstant.kt"); } + @Test @TestMetadata("collectionStubs.kt") public void testCollectionStubs() throws Exception { runTest("compiler/testData/codegen/bytecodeText/collectionStubs.kt"); } + @Test @TestMetadata("componentEvaluatesOnlyOnce.kt") public void testComponentEvaluatesOnlyOnce() throws Exception { runTest("compiler/testData/codegen/bytecodeText/componentEvaluatesOnlyOnce.kt"); } + @Test @TestMetadata("constClosureOptimization.kt") public void testConstClosureOptimization() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constClosureOptimization.kt"); } + @Test @TestMetadata("defaultMethodBody.kt") public void testDefaultMethodBody() throws Exception { runTest("compiler/testData/codegen/bytecodeText/defaultMethodBody.kt"); } + @Test @TestMetadata("doNotStoreNullForTmpInDestructuring.kt") public void testDoNotStoreNullForTmpInDestructuring() throws Exception { runTest("compiler/testData/codegen/bytecodeText/doNotStoreNullForTmpInDestructuring.kt"); } + @Test @TestMetadata("doNotStoreNullsForCapturedVars.kt") public void testDoNotStoreNullsForCapturedVars() throws Exception { runTest("compiler/testData/codegen/bytecodeText/doNotStoreNullsForCapturedVars.kt"); } + @Test @TestMetadata("falseSmartCast.kt") public void testFalseSmartCast() throws Exception { runTest("compiler/testData/codegen/bytecodeText/falseSmartCast.kt"); } + @Test @TestMetadata("flagsInMultiFileInherit.kt") public void testFlagsInMultiFileInherit() throws Exception { runTest("compiler/testData/codegen/bytecodeText/flagsInMultiFileInherit.kt"); } + @Test @TestMetadata("iincGeneration.kt") public void testIincGeneration() throws Exception { runTest("compiler/testData/codegen/bytecodeText/iincGeneration.kt"); } + @Test @TestMetadata("inheritedPropertyAnnotations.kt") public void testInheritedPropertyAnnotations() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inheritedPropertyAnnotations.kt"); } + @Test @TestMetadata("inlineFromOtherModule.kt") public void testInlineFromOtherModule() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineFromOtherModule.kt"); } + @Test @TestMetadata("inlineJavaConstantFromSubclass.kt") public void testInlineJavaConstantFromSubclass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineJavaConstantFromSubclass.kt"); } + @Test @TestMetadata("inlineJavaStaticFields.kt") public void testInlineJavaStaticFields() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineJavaStaticFields.kt"); } + @Test @TestMetadata("inlineProtectedJavaConstantFromOtherPackage.kt") public void testInlineProtectedJavaConstantFromOtherPackage() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineProtectedJavaConstantFromOtherPackage.kt"); } + @Test @TestMetadata("intConstantNotNull.kt") public void testIntConstantNotNull() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intConstantNotNull.kt"); } + @Test @TestMetadata("intConstantNullable.kt") public void testIntConstantNullable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intConstantNullable.kt"); } + @Test @TestMetadata("intConstantNullableSafeCall.kt") public void testIntConstantNullableSafeCall() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intConstantNullableSafeCall.kt"); } + @Test @TestMetadata("intConstantSafeCall.kt") public void testIntConstantSafeCall() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intConstantSafeCall.kt"); } + @Test @TestMetadata("intProgressionNoBoxing.kt") public void testIntProgressionNoBoxing() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intProgressionNoBoxing.kt"); } + @Test @TestMetadata("intRangeNoBoxing.kt") public void testIntRangeNoBoxing() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intRangeNoBoxing.kt"); } + @Test @TestMetadata("interfaceDefaultImpl.kt") public void testInterfaceDefaultImpl() throws Exception { runTest("compiler/testData/codegen/bytecodeText/interfaceDefaultImpl.kt"); } + @Test @TestMetadata("isArrayOf.kt") public void testIsArrayOf() throws Exception { runTest("compiler/testData/codegen/bytecodeText/isArrayOf.kt"); } + @Test @TestMetadata("javaExtensionPropertyIntrinsic.kt") public void testJavaExtensionPropertyIntrinsic() throws Exception { runTest("compiler/testData/codegen/bytecodeText/javaExtensionPropertyIntrinsic.kt"); } + @Test @TestMetadata("javaFields.kt") public void testJavaFields() throws Exception { runTest("compiler/testData/codegen/bytecodeText/javaFields.kt"); } + @Test @TestMetadata("javaFieldsWithIntersectionTypes.kt") public void testJavaFieldsWithIntersectionTypes() throws Exception { runTest("compiler/testData/codegen/bytecodeText/javaFieldsWithIntersectionTypes.kt"); } + @Test @TestMetadata("javaStatics.kt") public void testJavaStatics() throws Exception { runTest("compiler/testData/codegen/bytecodeText/javaStatics.kt"); } + @Test @TestMetadata("jvmField.kt") public void testJvmField() throws Exception { runTest("compiler/testData/codegen/bytecodeText/jvmField.kt"); } + @Test @TestMetadata("jvmStaticInternalMangling.kt") public void testJvmStaticInternalMangling() throws Exception { runTest("compiler/testData/codegen/bytecodeText/jvmStaticInternalMangling.kt"); } + @Test @TestMetadata("kt10259.kt") public void testKt10259() throws Exception { runTest("compiler/testData/codegen/bytecodeText/kt10259.kt"); } + @Test @TestMetadata("kt10259_2.kt") public void testKt10259_2() throws Exception { runTest("compiler/testData/codegen/bytecodeText/kt10259_2.kt"); } + @Test @TestMetadata("kt10259_3.kt") public void testKt10259_3() throws Exception { runTest("compiler/testData/codegen/bytecodeText/kt10259_3.kt"); } + @Test @TestMetadata("kt2202.kt") public void testKt2202() throws Exception { runTest("compiler/testData/codegen/bytecodeText/kt2202.kt"); } + @Test @TestMetadata("kt2887.kt") public void testKt2887() throws Exception { runTest("compiler/testData/codegen/bytecodeText/kt2887.kt"); } + @Test @TestMetadata("kt3845.kt") public void testKt3845() throws Exception { runTest("compiler/testData/codegen/bytecodeText/kt3845.kt"); } + @Test @TestMetadata("kt5016.kt") public void testKt5016() throws Exception { runTest("compiler/testData/codegen/bytecodeText/kt5016.kt"); } + @Test @TestMetadata("kt5016int.kt") public void testKt5016int() throws Exception { runTest("compiler/testData/codegen/bytecodeText/kt5016int.kt"); } + @Test @TestMetadata("kt5016intOrNull.kt") public void testKt5016intOrNull() throws Exception { runTest("compiler/testData/codegen/bytecodeText/kt5016intOrNull.kt"); } + @Test @TestMetadata("kt7188.kt") public void testKt7188() throws Exception { runTest("compiler/testData/codegen/bytecodeText/kt7188.kt"); } + @Test @TestMetadata("kt7769.kt") public void testKt7769() throws Exception { runTest("compiler/testData/codegen/bytecodeText/kt7769.kt"); } + @Test @TestMetadata("kt9603.kt") public void testKt9603() throws Exception { runTest("compiler/testData/codegen/bytecodeText/kt9603.kt"); } + @Test @TestMetadata("mapGetOrDefault.kt") public void testMapGetOrDefault() throws Exception { runTest("compiler/testData/codegen/bytecodeText/mapGetOrDefault.kt"); } + @Test @TestMetadata("maxStackAfterOptimizations.kt") public void testMaxStackAfterOptimizations() throws Exception { runTest("compiler/testData/codegen/bytecodeText/maxStackAfterOptimizations.kt"); } + @Test @TestMetadata("noAccessorForProtectedInSamePackageCrossinline.kt") public void testNoAccessorForProtectedInSamePackageCrossinline() throws Exception { runTest("compiler/testData/codegen/bytecodeText/noAccessorForProtectedInSamePackageCrossinline.kt"); } + @Test @TestMetadata("noFlagAnnotations.kt") public void testNoFlagAnnotations() throws Exception { runTest("compiler/testData/codegen/bytecodeText/noFlagAnnotations.kt"); } + @Test @TestMetadata("noNumberCheckCast.kt") public void testNoNumberCheckCast() throws Exception { runTest("compiler/testData/codegen/bytecodeText/noNumberCheckCast.kt"); } + @Test @TestMetadata("noSuperCheckInDefaultConstuctor.kt") public void testNoSuperCheckInDefaultConstuctor() throws Exception { runTest("compiler/testData/codegen/bytecodeText/noSuperCheckInDefaultConstuctor.kt"); } + @Test @TestMetadata("noSyntheticAccessorForPrivateCompanionObjectWhenNotRequired.kt") public void testNoSyntheticAccessorForPrivateCompanionObjectWhenNotRequired() throws Exception { runTest("compiler/testData/codegen/bytecodeText/noSyntheticAccessorForPrivateCompanionObjectWhenNotRequired.kt"); } + @Test @TestMetadata("noWrapperForMethodReturningPrimitive.kt") public void testNoWrapperForMethodReturningPrimitive() throws Exception { runTest("compiler/testData/codegen/bytecodeText/noWrapperForMethodReturningPrimitive.kt"); } + @Test @TestMetadata("nopsInDoWhile.kt") public void testNopsInDoWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nopsInDoWhile.kt"); } + @Test @TestMetadata("partMembersCall.kt") public void testPartMembersCall() throws Exception { runTest("compiler/testData/codegen/bytecodeText/partMembersCall.kt"); } + @Test @TestMetadata("partMembersInline.kt") public void testPartMembersInline() throws Exception { runTest("compiler/testData/codegen/bytecodeText/partMembersInline.kt"); } + @Test @TestMetadata("preEvaluateInlineJavaStaticFields.kt") public void testPreEvaluateInlineJavaStaticFields() throws Exception { runTest("compiler/testData/codegen/bytecodeText/preEvaluateInlineJavaStaticFields.kt"); } + @Test @TestMetadata("prefixIntVarIncrement.kt") public void testPrefixIntVarIncrement() throws Exception { runTest("compiler/testData/codegen/bytecodeText/prefixIntVarIncrement.kt"); } + @Test @TestMetadata("privateDefaultArgs.kt") public void testPrivateDefaultArgs() throws Exception { runTest("compiler/testData/codegen/bytecodeText/privateDefaultArgs.kt"); } + @Test @TestMetadata("redundantGotoRemoving.kt") public void testRedundantGotoRemoving() throws Exception { runTest("compiler/testData/codegen/bytecodeText/redundantGotoRemoving.kt"); } + @Test @TestMetadata("redundantInitializer.kt") public void testRedundantInitializer() throws Exception { runTest("compiler/testData/codegen/bytecodeText/redundantInitializer.kt"); } + @Test @TestMetadata("redundantInitializerNumber.kt") public void testRedundantInitializerNumber() throws Exception { runTest("compiler/testData/codegen/bytecodeText/redundantInitializerNumber.kt"); } + @Test @TestMetadata("redundantValInitializer.kt") public void testRedundantValInitializer() throws Exception { runTest("compiler/testData/codegen/bytecodeText/redundantValInitializer.kt"); } + @Test @TestMetadata("redundantValInitializerInObject.kt") public void testRedundantValInitializerInObject() throws Exception { runTest("compiler/testData/codegen/bytecodeText/redundantValInitializerInObject.kt"); } + @Test @TestMetadata("redundantVarInitializer.kt") public void testRedundantVarInitializer() throws Exception { runTest("compiler/testData/codegen/bytecodeText/redundantVarInitializer.kt"); } + @Test @TestMetadata("redundantVarInitializerInObject.kt") public void testRedundantVarInitializerInObject() throws Exception { runTest("compiler/testData/codegen/bytecodeText/redundantVarInitializerInObject.kt"); } + @Test @TestMetadata("reifiedAsCheck.kt") public void testReifiedAsCheck() throws Exception { runTest("compiler/testData/codegen/bytecodeText/reifiedAsCheck.kt"); } + @Test @TestMetadata("reifiedAsCheckWithNullable.kt") public void testReifiedAsCheckWithNullable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/reifiedAsCheckWithNullable.kt"); } + @Test @TestMetadata("reifiedIsCheck.kt") public void testReifiedIsCheck() throws Exception { runTest("compiler/testData/codegen/bytecodeText/reifiedIsCheck.kt"); } + @Test @TestMetadata("reifiedIsCheckWithNullable.kt") public void testReifiedIsCheckWithNullable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/reifiedIsCheckWithNullable.kt"); } + @Test @TestMetadata("reifiedSafeAsCheck.kt") public void testReifiedSafeAsCheck() throws Exception { runTest("compiler/testData/codegen/bytecodeText/reifiedSafeAsCheck.kt"); } + @Test @TestMetadata("safeAsWithMutable.kt") public void testSafeAsWithMutable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/safeAsWithMutable.kt"); } + @Test @TestMetadata("superFlagInMultiFileFacade.kt") public void testSuperFlagInMultiFileFacade() throws Exception { runTest("compiler/testData/codegen/bytecodeText/superFlagInMultiFileFacade.kt"); } + @Test @TestMetadata("superToString.kt") public void testSuperToString() throws Exception { runTest("compiler/testData/codegen/bytecodeText/superToString.kt"); } + @Test @TestMetadata("suspendCoroutineUninterceptedOrReturn.kt") public void testSuspendCoroutineUninterceptedOrReturn() throws Exception { runTest("compiler/testData/codegen/bytecodeText/suspendCoroutineUninterceptedOrReturn.kt"); } + @Test @TestMetadata("topLevelFunWithDefaultArgs.kt") public void testTopLevelFunWithDefaultArgs() throws Exception { runTest("compiler/testData/codegen/bytecodeText/topLevelFunWithDefaultArgs.kt"); } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/argumentOrder") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ArgumentOrder extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class ArgumentOrder extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInArgumentOrder() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/argumentOrder"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("sameOrder.kt") public void testSameOrder() throws Exception { runTest("compiler/testData/codegen/bytecodeText/argumentOrder/sameOrder.kt"); } + @Test @TestMetadata("sameOrderWithDefault.kt") public void testSameOrderWithDefault() throws Exception { runTest("compiler/testData/codegen/bytecodeText/argumentOrder/sameOrderWithDefault.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/assert") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Assert extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class Assert extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInAssert() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/assert"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("jvmCrossinline.kt") public void testJvmCrossinline() throws Exception { runTest("compiler/testData/codegen/bytecodeText/assert/jvmCrossinline.kt"); } + @Test @TestMetadata("jvmCrossinlineAssertInLambda.kt") public void testJvmCrossinlineAssertInLambda() throws Exception { runTest("compiler/testData/codegen/bytecodeText/assert/jvmCrossinlineAssertInLambda.kt"); } + @Test @TestMetadata("jvmInline.kt") public void testJvmInline() throws Exception { runTest("compiler/testData/codegen/bytecodeText/assert/jvmInline.kt"); } + @Test @TestMetadata("jvmInlineLambda.kt") public void testJvmInlineLambda() throws Exception { runTest("compiler/testData/codegen/bytecodeText/assert/jvmInlineLambda.kt"); } + @Test @TestMetadata("jvmNestedClass.kt") public void testJvmNestedClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/assert/jvmNestedClass.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/boxing") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Boxing extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class Boxing extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInBoxing() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/boxing"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("crossinlineSuspend.kt") public void testCrossinlineSuspend() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxing/crossinlineSuspend.kt"); } + @Test @TestMetadata("inlineSuspend.kt") public void testInlineSuspend() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxing/inlineSuspend.kt"); } + @Test @TestMetadata("suspend.kt") public void testSuspend() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxing/suspend.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/boxingOptimization") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class BoxingOptimization extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class BoxingOptimization extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInBoxingOptimization() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/boxingOptimization"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("boxingAndEquals.kt") public void testBoxingAndEquals() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/boxingAndEquals.kt"); } + @Test @TestMetadata("casts.kt") public void testCasts() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/casts.kt"); } + @Test @TestMetadata("checkcastAndInstanceOf.kt") public void testCheckcastAndInstanceOf() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/checkcastAndInstanceOf.kt"); } + @Test @TestMetadata("fold.kt") public void testFold() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/fold.kt"); } + @Test @TestMetadata("inlineClassesAndInlinedLambda.kt") public void testInlineClassesAndInlinedLambda() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/inlineClassesAndInlinedLambda.kt"); } + @Test @TestMetadata("intCompareTo.kt") public void testIntCompareTo() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/intCompareTo.kt"); } + @Test @TestMetadata("kClassInAnnotation.kt") public void testKClassInAnnotation() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/kClassInAnnotation.kt"); } + @Test @TestMetadata("kClassInAnnotationEscaping.kt") public void testKClassInAnnotationEscaping() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/kClassInAnnotationEscaping.kt"); } + @Test @TestMetadata("kt15862.kt") public void testKt15862() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/kt15862.kt"); } + @Test @TestMetadata("kt15862_2.kt") public void testKt15862_2() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/kt15862_2.kt"); } + @Test @TestMetadata("kt6842.kt") public void testKt6842() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/kt6842.kt"); } + @Test @TestMetadata("kt7224.kt") public void testKt7224() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/kt7224.kt"); } + @Test @TestMetadata("maxMinByOrNull.kt") public void testMaxMinByOrNull() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/maxMinByOrNull.kt"); } + @Test @TestMetadata("nullCheck.kt") public void testNullCheck() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/nullCheck.kt"); } + @Test @TestMetadata("progressions.kt") public void testProgressions() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/progressions.kt"); } + @Test @TestMetadata("safeCallToPrimitiveEquality.kt") public void testSafeCallToPrimitiveEquality() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/safeCallToPrimitiveEquality.kt"); } + @Test @TestMetadata("safeCallWithElvis.kt") public void testSafeCallWithElvis() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/safeCallWithElvis.kt"); } + @Test @TestMetadata("severalInlines.kt") public void testSeveralInlines() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/severalInlines.kt"); } + @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/simple.kt"); } + @Test @TestMetadata("simpleUninitializedMerge.kt") public void testSimpleUninitializedMerge() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/simpleUninitializedMerge.kt"); } + @Test @TestMetadata("unsafeRemoving.kt") public void testUnsafeRemoving() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/unsafeRemoving.kt"); } + @Test @TestMetadata("unsignedRangeIteratorSpecialization.kt") public void testUnsignedRangeIteratorSpecialization() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/unsignedRangeIteratorSpecialization.kt"); } + @Test @TestMetadata("variableClash.kt") public void testVariableClash() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/variableClash.kt"); } + @Test @TestMetadata("variables.kt") public void testVariables() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/variables.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/builtinFunctions") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class BuiltinFunctions extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class BuiltinFunctions extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInBuiltinFunctions() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/builtinFunctions"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("charSequence.kt") public void testCharSequence() throws Exception { runTest("compiler/testData/codegen/bytecodeText/builtinFunctions/charSequence.kt"); } + @Test @TestMetadata("contains.kt") public void testContains() throws Exception { runTest("compiler/testData/codegen/bytecodeText/builtinFunctions/contains.kt"); } + @Test @TestMetadata("removeAt.kt") public void testRemoveAt() throws Exception { runTest("compiler/testData/codegen/bytecodeText/builtinFunctions/removeAt.kt"); } + @Test @TestMetadata("size.kt") public void testSize() throws Exception { runTest("compiler/testData/codegen/bytecodeText/builtinFunctions/size.kt"); } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/builtinFunctions/genericParameterBridge") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class GenericParameterBridge extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class GenericParameterBridge extends AbstractFirBytecodeTextTest { + @Test @TestMetadata("abstractList.kt") public void testAbstractList() throws Exception { runTest("compiler/testData/codegen/bytecodeText/builtinFunctions/genericParameterBridge/abstractList.kt"); } + @Test public void testAllFilesPresentInGenericParameterBridge() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/builtinFunctions/genericParameterBridge"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("IntMC.kt") public void testIntMC() throws Exception { runTest("compiler/testData/codegen/bytecodeText/builtinFunctions/genericParameterBridge/IntMC.kt"); } + @Test @TestMetadata("mutableCollection.kt") public void testMutableCollection() throws Exception { runTest("compiler/testData/codegen/bytecodeText/builtinFunctions/genericParameterBridge/mutableCollection.kt"); } + @Test @TestMetadata("mutableSetInterfaces.kt") public void testMutableSetInterfaces() throws Exception { runTest("compiler/testData/codegen/bytecodeText/builtinFunctions/genericParameterBridge/mutableSetInterfaces.kt"); } + @Test @TestMetadata("notNullAnyMC.kt") public void testNotNullAnyMC() throws Exception { runTest("compiler/testData/codegen/bytecodeText/builtinFunctions/genericParameterBridge/notNullAnyMC.kt"); } + @Test @TestMetadata("notNullParamMC.kt") public void testNotNullParamMC() throws Exception { runTest("compiler/testData/codegen/bytecodeText/builtinFunctions/genericParameterBridge/notNullParamMC.kt"); } + @Test @TestMetadata("nullableAnyMC.kt") public void testNullableAnyMC() throws Exception { runTest("compiler/testData/codegen/bytecodeText/builtinFunctions/genericParameterBridge/nullableAnyMC.kt"); @@ -743,993 +847,1091 @@ public class FirBytecodeTextTestGenerated extends AbstractFirBytecodeTextTest { } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/callableReference") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class CallableReference extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class CallableReference extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInCallableReference() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/callableReference"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("boundFieldReferenceInInline.kt") public void testBoundFieldReferenceInInline() throws Exception { runTest("compiler/testData/codegen/bytecodeText/callableReference/boundFieldReferenceInInline.kt"); } + @Test @TestMetadata("boundFunReferenceInInline.kt") public void testBoundFunReferenceInInline() throws Exception { runTest("compiler/testData/codegen/bytecodeText/callableReference/boundFunReferenceInInline.kt"); } + @Test @TestMetadata("boundPropertyReferenceInInline.kt") public void testBoundPropertyReferenceInInline() throws Exception { runTest("compiler/testData/codegen/bytecodeText/callableReference/boundPropertyReferenceInInline.kt"); } + @Test @TestMetadata("kt36975.kt") public void testKt36975() throws Exception { runTest("compiler/testData/codegen/bytecodeText/callableReference/kt36975.kt"); } + @Test @TestMetadata("kt39612.kt") public void testKt39612() throws Exception { runTest("compiler/testData/codegen/bytecodeText/callableReference/kt39612.kt"); } + @Test @TestMetadata("nameIntrinsicWithImplicitThis.kt") public void testNameIntrinsicWithImplicitThis() throws Exception { runTest("compiler/testData/codegen/bytecodeText/callableReference/nameIntrinsicWithImplicitThis.kt"); } + @Test @TestMetadata("unboundFieldReferenceInInline.kt") public void testUnboundFieldReferenceInInline() throws Exception { runTest("compiler/testData/codegen/bytecodeText/callableReference/unboundFieldReferenceInInline.kt"); } + @Test @TestMetadata("unboundFunReferenceInInline.kt") public void testUnboundFunReferenceInInline() throws Exception { runTest("compiler/testData/codegen/bytecodeText/callableReference/unboundFunReferenceInInline.kt"); } + @Test @TestMetadata("unboundPropertyReferenceInInline.kt") public void testUnboundPropertyReferenceInInline() throws Exception { runTest("compiler/testData/codegen/bytecodeText/callableReference/unboundPropertyReferenceInInline.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/capturedVarsOptimization") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class CapturedVarsOptimization extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class CapturedVarsOptimization extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInCapturedVarsOptimization() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/capturedVarsOptimization"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("capturedInChainOfInlineFuns.kt") public void testCapturedInChainOfInlineFuns() throws Exception { runTest("compiler/testData/codegen/bytecodeText/capturedVarsOptimization/capturedInChainOfInlineFuns.kt"); } + @Test @TestMetadata("capturedInInlineOnly.kt") public void testCapturedInInlineOnly() throws Exception { runTest("compiler/testData/codegen/bytecodeText/capturedVarsOptimization/capturedInInlineOnly.kt"); } + @Test @TestMetadata("capturedInLocalObject.kt") public void testCapturedInLocalObject() throws Exception { runTest("compiler/testData/codegen/bytecodeText/capturedVarsOptimization/capturedInLocalObject.kt"); } + @Test @TestMetadata("capturedInNoInlineOnly.kt") public void testCapturedInNoInlineOnly() throws Exception { runTest("compiler/testData/codegen/bytecodeText/capturedVarsOptimization/capturedInNoInlineOnly.kt"); } + @Test @TestMetadata("capturedInNoInlneInsideChainOfInlineFuns.kt") public void testCapturedInNoInlneInsideChainOfInlineFuns() throws Exception { runTest("compiler/testData/codegen/bytecodeText/capturedVarsOptimization/capturedInNoInlneInsideChainOfInlineFuns.kt"); } + @Test @TestMetadata("capturedValInLambdaInitializedInside.kt") public void testCapturedValInLambdaInitializedInside() throws Exception { runTest("compiler/testData/codegen/bytecodeText/capturedVarsOptimization/capturedValInLambdaInitializedInside.kt"); } + @Test @TestMetadata("capturedValInLambdaInitializedOutside.kt") public void testCapturedValInLambdaInitializedOutside() throws Exception { runTest("compiler/testData/codegen/bytecodeText/capturedVarsOptimization/capturedValInLambdaInitializedOutside.kt"); } + @Test @TestMetadata("capturedVarsOfSize2.kt") public void testCapturedVarsOfSize2() throws Exception { runTest("compiler/testData/codegen/bytecodeText/capturedVarsOptimization/capturedVarsOfSize2.kt"); } + @Test @TestMetadata("sharedSlotsWithCapturedVars.kt") public void testSharedSlotsWithCapturedVars() throws Exception { runTest("compiler/testData/codegen/bytecodeText/capturedVarsOptimization/sharedSlotsWithCapturedVars.kt"); } + @Test @TestMetadata("withStackNormalization.kt") public void testWithStackNormalization() throws Exception { runTest("compiler/testData/codegen/bytecodeText/capturedVarsOptimization/withStackNormalization.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/checkcast") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Checkcast extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class Checkcast extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInCheckcast() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/checkcast"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("kt14811.kt") public void testKt14811() throws Exception { runTest("compiler/testData/codegen/bytecodeText/checkcast/kt14811.kt"); } + @Test @TestMetadata("kt14963.kt") public void testKt14963() throws Exception { runTest("compiler/testData/codegen/bytecodeText/checkcast/kt14963.kt"); } + @Test @TestMetadata("kt15411.kt") public void testKt15411() throws Exception { runTest("compiler/testData/codegen/bytecodeText/checkcast/kt15411.kt"); } + @Test @TestMetadata("kt22714.kt") public void testKt22714() throws Exception { runTest("compiler/testData/codegen/bytecodeText/checkcast/kt22714.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/coercionToUnitOptimization") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class CoercionToUnitOptimization extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class CoercionToUnitOptimization extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInCoercionToUnitOptimization() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/coercionToUnitOptimization"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("inRangeCheckWithConst.kt") public void testInRangeCheckWithConst() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coercionToUnitOptimization/inRangeCheckWithConst.kt"); } + @Test @TestMetadata("kt14360.kt") public void testKt14360() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coercionToUnitOptimization/kt14360.kt"); } + @Test @TestMetadata("largeMethodWithCoercionToUnit.kt") public void testLargeMethodWithCoercionToUnit() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coercionToUnitOptimization/largeMethodWithCoercionToUnit.kt"); } + @Test @TestMetadata("nopInlineFuns.kt") public void testNopInlineFuns() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coercionToUnitOptimization/nopInlineFuns.kt"); } + @Test @TestMetadata("returnsUnit.kt") public void testReturnsUnit() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coercionToUnitOptimization/returnsUnit.kt"); } + @Test @TestMetadata("safeCall.kt") public void testSafeCall() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coercionToUnitOptimization/safeCall.kt"); } + @Test @TestMetadata("safeCallWithReturnValue.kt") public void testSafeCallWithReturnValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coercionToUnitOptimization/safeCallWithReturnValue.kt"); } + @Test @TestMetadata("safeLet.kt") public void testSafeLet() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coercionToUnitOptimization/safeLet.kt"); } + @Test @TestMetadata("tryInlined.kt") public void testTryInlined() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coercionToUnitOptimization/tryInlined.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/companion") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Companion extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class Companion extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInCompanion() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/companion"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("directAccessToBackingField.kt") public void testDirectAccessToBackingField() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/directAccessToBackingField.kt"); } + @Test @TestMetadata("floatingPointCompanionAccess.kt") public void testFloatingPointCompanionAccess() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/floatingPointCompanionAccess.kt"); } + @Test @TestMetadata("inlineFunctionCompanionPropertyAccess.kt") public void testInlineFunctionCompanionPropertyAccess() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/inlineFunctionCompanionPropertyAccess.kt"); } + @Test @TestMetadata("inlineFunctionObjectCompanionPropertyAccess.kt") public void testInlineFunctionObjectCompanionPropertyAccess() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/inlineFunctionObjectCompanionPropertyAccess.kt"); } + @Test @TestMetadata("kt14258_1.kt") public void testKt14258_1() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/kt14258_1.kt"); } + @Test @TestMetadata("kt14258_2.kt") public void testKt14258_2() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/kt14258_2.kt"); } + @Test @TestMetadata("kt14258_3.kt") public void testKt14258_3() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/kt14258_3.kt"); } + @Test @TestMetadata("kt14258_4.kt") public void testKt14258_4() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/kt14258_4.kt"); } + @Test @TestMetadata("kt14258_5.kt") public void testKt14258_5() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/kt14258_5.kt"); } + @Test @TestMetadata("nonDefaultAccessors.kt") public void testNonDefaultAccessors() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/nonDefaultAccessors.kt"); } + @Test @TestMetadata("privateCompanionObjectAccessors_after.kt") public void testPrivateCompanionObjectAccessors_after() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/privateCompanionObjectAccessors_after.kt"); } + @Test @TestMetadata("privateCompanionObjectAccessors_before.kt") public void testPrivateCompanionObjectAccessors_before() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/privateCompanionObjectAccessors_before.kt"); } + @Test @TestMetadata("protectedCompanionObjectAccessors_after.kt") public void testProtectedCompanionObjectAccessors_after() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/protectedCompanionObjectAccessors_after.kt"); } + @Test @TestMetadata("protectedCompanionObjectAccessors_before.kt") public void testProtectedCompanionObjectAccessors_before() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/protectedCompanionObjectAccessors_before.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/conditions") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Conditions extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class Conditions extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInConditions() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/conditions"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("conjunction.kt") public void testConjunction() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/conjunction.kt"); } + @Test @TestMetadata("conjunctionInDoWhile.kt") public void testConjunctionInDoWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/conjunctionInDoWhile.kt"); } + @Test @TestMetadata("conjunctionInWhile.kt") public void testConjunctionInWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/conjunctionInWhile.kt"); } + @Test @TestMetadata("disjunction.kt") public void testDisjunction() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/disjunction.kt"); } + @Test @TestMetadata("negatedConjuction.kt") public void testNegatedConjuction() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/negatedConjuction.kt"); } + @Test @TestMetadata("negatedDisjunction.kt") public void testNegatedDisjunction() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/negatedDisjunction.kt"); } + @Test @TestMetadata("negatedNonZeroCompareInDoWhile.kt") public void testNegatedNonZeroCompareInDoWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/negatedNonZeroCompareInDoWhile.kt"); } + @Test @TestMetadata("negatedNonZeroCompareInIf.kt") public void testNegatedNonZeroCompareInIf() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/negatedNonZeroCompareInIf.kt"); } + @Test @TestMetadata("negatedNonZeroCompareInWhile.kt") public void testNegatedNonZeroCompareInWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/negatedNonZeroCompareInWhile.kt"); } + @Test @TestMetadata("negatedNullCompareInDoWhile.kt") public void testNegatedNullCompareInDoWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/negatedNullCompareInDoWhile.kt"); } + @Test @TestMetadata("negatedNullCompareInIf.kt") public void testNegatedNullCompareInIf() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/negatedNullCompareInIf.kt"); } + @Test @TestMetadata("negatedNullCompareInWhile.kt") public void testNegatedNullCompareInWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/negatedNullCompareInWhile.kt"); } + @Test @TestMetadata("negatedZeroCompareInDoWhile.kt") public void testNegatedZeroCompareInDoWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/negatedZeroCompareInDoWhile.kt"); } + @Test @TestMetadata("negatedZeroCompareInIf.kt") public void testNegatedZeroCompareInIf() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/negatedZeroCompareInIf.kt"); } + @Test @TestMetadata("negatedZeroCompareInWhile.kt") public void testNegatedZeroCompareInWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/negatedZeroCompareInWhile.kt"); } + @Test @TestMetadata("noBoxingForBoxedEqPrimitive.kt") public void testNoBoxingForBoxedEqPrimitive() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/noBoxingForBoxedEqPrimitive.kt"); } + @Test @TestMetadata("noBoxingForPrimitiveEqBoxed.kt") public void testNoBoxingForPrimitiveEqBoxed() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/noBoxingForPrimitiveEqBoxed.kt"); } + @Test @TestMetadata("noBoxingForPrimitiveEqObject.kt") public void testNoBoxingForPrimitiveEqObject() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/noBoxingForPrimitiveEqObject.kt"); } + @Test @TestMetadata("nonZeroCompareInDoWhile.kt") public void testNonZeroCompareInDoWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/nonZeroCompareInDoWhile.kt"); } + @Test @TestMetadata("nonZeroCompareInIf.kt") public void testNonZeroCompareInIf() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/nonZeroCompareInIf.kt"); } + @Test @TestMetadata("nonZeroCompareInWhile.kt") public void testNonZeroCompareInWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/nonZeroCompareInWhile.kt"); } + @Test @TestMetadata("nullCompareConst.kt") public void testNullCompareConst() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/nullCompareConst.kt"); } + @Test @TestMetadata("nullCompareInDoWhile.kt") public void testNullCompareInDoWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/nullCompareInDoWhile.kt"); } + @Test @TestMetadata("nullCompareInIf.kt") public void testNullCompareInIf() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/nullCompareInIf.kt"); } + @Test @TestMetadata("nullCompareInWhile.kt") public void testNullCompareInWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/nullCompareInWhile.kt"); } + @Test @TestMetadata("zeroCompareInDoWhile.kt") public void testZeroCompareInDoWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/zeroCompareInDoWhile.kt"); } + @Test @TestMetadata("zeroCompareInIf.kt") public void testZeroCompareInIf() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/zeroCompareInIf.kt"); } + @Test @TestMetadata("zeroCompareInWhile.kt") public void testZeroCompareInWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/zeroCompareInWhile.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/constProperty") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ConstProperty extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class ConstProperty extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInConstProperty() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/constProperty"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("noAccessorsForPrivateConstants.kt") public void testNoAccessorsForPrivateConstants() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constProperty/noAccessorsForPrivateConstants.kt"); } + @Test @TestMetadata("noInline.kt") public void testNoInline() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constProperty/noInline.kt"); } + @Test @TestMetadata("noInlineInCmp.kt") public void testNoInlineInCmp() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constProperty/noInlineInCmp.kt"); } + @Test @TestMetadata("nonConstValHasNoDefaultValue_after.kt") public void testNonConstValHasNoDefaultValue_after() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constProperty/nonConstValHasNoDefaultValue_after.kt"); } + @Test @TestMetadata("nonConstValHasNoDefaultValue_before.kt") public void testNonConstValHasNoDefaultValue_before() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constProperty/nonConstValHasNoDefaultValue_before.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/constantConditions") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ConstantConditions extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class ConstantConditions extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInConstantConditions() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/constantConditions"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("cmpIntWith0.kt") public void testCmpIntWith0() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constantConditions/cmpIntWith0.kt"); } + @Test @TestMetadata("constantFlag.kt") public void testConstantFlag() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constantConditions/constantFlag.kt"); } + @Test @TestMetadata("constantInt.kt") public void testConstantInt() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constantConditions/constantInt.kt"); } + @Test @TestMetadata("inlineIfFalse.kt") public void testInlineIfFalse() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constantConditions/inlineIfFalse.kt"); } + @Test @TestMetadata("kt3098.kt") public void testKt3098() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constantConditions/kt3098.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/constants") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Constants extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class Constants extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInConstants() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/constants"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("byte.kt") public void testByte() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constants/byte.kt"); } + @Test @TestMetadata("comparisonFalse.kt") public void testComparisonFalse() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constants/comparisonFalse.kt"); } + @Test @TestMetadata("comparisonTrue.kt") public void testComparisonTrue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constants/comparisonTrue.kt"); } + @Test @TestMetadata("floatingPoints.kt") public void testFloatingPoints() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constants/floatingPoints.kt"); } + @Test @TestMetadata("inlineUnsignedIntConstant.kt") public void testInlineUnsignedIntConstant() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constants/inlineUnsignedIntConstant.kt"); } + @Test @TestMetadata("kt9532.kt") public void testKt9532() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constants/kt9532.kt"); } + @Test @TestMetadata("noInlineNonConst.kt") public void testNoInlineNonConst() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constants/noInlineNonConst.kt"); } + @Test @TestMetadata("noInlineNonStaticJavaField.kt") public void testNoInlineNonStaticJavaField() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constants/noInlineNonStaticJavaField.kt"); } + @Test @TestMetadata("noInlineNonStaticJavaField_lv10.kt") public void testNoInlineNonStaticJavaField_lv10() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constants/noInlineNonStaticJavaField_lv10.kt"); } + @Test @TestMetadata("nullableByteAndShort.kt") public void testNullableByteAndShort() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constants/nullableByteAndShort.kt"); } + @Test @TestMetadata("partialString.kt") public void testPartialString() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constants/partialString.kt"); } + @Test @TestMetadata("short.kt") public void testShort() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constants/short.kt"); } + @Test @TestMetadata("string.kt") public void testString() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constants/string.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/constructors") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Constructors extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class Constructors extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInConstructors() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/constructors"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("enumPrimaryDefaults.kt") public void testEnumPrimaryDefaults() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constructors/enumPrimaryDefaults.kt"); } + @Test @TestMetadata("inlineArgumentPrimaryDefaults.kt") public void testInlineArgumentPrimaryDefaults() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constructors/inlineArgumentPrimaryDefaults.kt"); } + @Test @TestMetadata("inlinePrimaryDefaults.kt") public void testInlinePrimaryDefaults() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constructors/inlinePrimaryDefaults.kt"); } + @Test @TestMetadata("innerPrimaryDefaults.kt") public void testInnerPrimaryDefaults() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constructors/innerPrimaryDefaults.kt"); } + @Test @TestMetadata("internalPrimaryDefaults.kt") public void testInternalPrimaryDefaults() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constructors/internalPrimaryDefaults.kt"); } + @Test @TestMetadata("localPrimaryDefaults.kt") public void testLocalPrimaryDefaults() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constructors/localPrimaryDefaults.kt"); } + @Test @TestMetadata("parameterlessPrimary.kt") public void testParameterlessPrimary() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constructors/parameterlessPrimary.kt"); } + @Test @TestMetadata("privatePrimaryDefaults.kt") public void testPrivatePrimaryDefaults() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constructors/privatePrimaryDefaults.kt"); } + @Test @TestMetadata("protectedPrimaryDefaults.kt") public void testProtectedPrimaryDefaults() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constructors/protectedPrimaryDefaults.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/controlStructures") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ControlStructures extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class ControlStructures extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInControlStructures() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/controlStructures"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("ifConsts.kt") public void testIfConsts() throws Exception { runTest("compiler/testData/codegen/bytecodeText/controlStructures/ifConsts.kt"); } + @Test @TestMetadata("kt17110.kt") public void testKt17110() throws Exception { runTest("compiler/testData/codegen/bytecodeText/controlStructures/kt17110.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/coroutines") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Coroutines extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class Coroutines extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInCoroutines() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/coroutines"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("crossinlineSuspendContinuation_1_3.kt") public void testCrossinlineSuspendContinuation_1_3() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/crossinlineSuspendContinuation_1_3.kt"); } + @Test @TestMetadata("doNotReassignContinuation.kt") public void testDoNotReassignContinuation() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/doNotReassignContinuation.kt"); } + @Test @TestMetadata("effectivelyInlineOnly.kt") public void testEffectivelyInlineOnly() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/effectivelyInlineOnly.kt"); } + @Test @TestMetadata("internalInlineSuspend.kt") public void testInternalInlineSuspend() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/internalInlineSuspend.kt"); } + @Test @TestMetadata("mergeLvt.kt") public void testMergeLvt() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/mergeLvt.kt"); } + @Test @TestMetadata("nonLocalReturn.kt") public void testNonLocalReturn() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/nonLocalReturn.kt"); } + @Test @TestMetadata("returnUnitInLambda.kt") public void testReturnUnitInLambda() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/returnUnitInLambda.kt"); } + @Test @TestMetadata("suspendMain.kt") public void testSuspendMain() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/suspendMain.kt"); } + @Test @TestMetadata("throwOnFailure.kt") public void testThrowOnFailure() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/throwOnFailure.kt"); } + @Test @TestMetadata("varValueConflictsWithTable.kt") public void testVarValueConflictsWithTable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/varValueConflictsWithTable.kt"); } + @Test @TestMetadata("varValueConflictsWithTableSameSort.kt") public void testVarValueConflictsWithTableSameSort() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/varValueConflictsWithTableSameSort.kt"); } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/coroutines/cleanup") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Cleanup extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class Cleanup extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInCleanup() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/coroutines/cleanup"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("backEdge.kt") public void testBackEdge() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/cleanup/backEdge.kt"); } + @Test @TestMetadata("if.kt") public void testIf() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/cleanup/if.kt"); } + @Test @TestMetadata("nullCleanup.kt") public void testNullCleanup() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/cleanup/nullCleanup.kt"); } + @Test @TestMetadata("nullNotSpill.kt") public void testNullNotSpill() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/cleanup/nullNotSpill.kt"); } + @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/cleanup/simple.kt"); } + @Test @TestMetadata("twoRefs.kt") public void testTwoRefs() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/cleanup/twoRefs.kt"); } + @Test @TestMetadata("unusedParamNotSpill.kt") public void testUnusedParamNotSpill() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/cleanup/unusedParamNotSpill.kt"); } + @Test @TestMetadata("when.kt") public void testWhen() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/cleanup/when.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/coroutines/debug") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Debug extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class Debug extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInDebug() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/coroutines/debug"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("continuationInLvt.kt") public void testContinuationInLvt() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/debug/continuationInLvt.kt"); } + @Test @TestMetadata("localVariableCorrectLabel.kt") public void testLocalVariableCorrectLabel() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/debug/localVariableCorrectLabel.kt"); } + @Test @TestMetadata("probeCoroutineSuspended.kt") public void testProbeCoroutineSuspended() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/debug/probeCoroutineSuspended.kt"); } + @Test @TestMetadata("shrinkLvtTopLevel.kt") public void testShrinkLvtTopLevel() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/debug/shrinkLvtTopLevel.kt"); } + @Test @TestMetadata("thisAndResultInLvt.kt") public void testThisAndResultInLvt() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/debug/thisAndResultInLvt.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/coroutines/destructuringInLambda") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class DestructuringInLambda extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class DestructuringInLambda extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInDestructuringInLambda() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/coroutines/destructuringInLambda"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("inlineSeparateFiles.kt") public void testInlineSeparateFiles() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/destructuringInLambda/inlineSeparateFiles.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/coroutines/inlineClasses") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class InlineClasses extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class InlineClasses extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInInlineClasses() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/coroutines/inlineClasses"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("inlineClassBoxingInSuspendFunReturn_Primitive.kt") public void testInlineClassBoxingInSuspendFunReturn_Primitive() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/inlineClasses/inlineClassBoxingInSuspendFunReturn_Primitive.kt"); } + @Test @TestMetadata("noInlineClassBoxingInSuspendFunReturn_Any.kt") public void testNoInlineClassBoxingInSuspendFunReturn_Any() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/inlineClasses/noInlineClassBoxingInSuspendFunReturn_Any.kt"); } + @Test @TestMetadata("noInlineClassBoxingInSuspendFunReturn_InlineAny.kt") public void testNoInlineClassBoxingInSuspendFunReturn_InlineAny() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/inlineClasses/noInlineClassBoxingInSuspendFunReturn_InlineAny.kt"); } + @Test @TestMetadata("noInlineClassBoxingInSuspendFunReturn_SameJvmType.kt") public void testNoInlineClassBoxingInSuspendFunReturn_SameJvmType() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/inlineClasses/noInlineClassBoxingInSuspendFunReturn_SameJvmType.kt"); } + @Test @TestMetadata("noInlineClassBoxingInSuspendFunReturn_String.kt") public void testNoInlineClassBoxingInSuspendFunReturn_String() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/inlineClasses/noInlineClassBoxingInSuspendFunReturn_String.kt"); } + @Test @TestMetadata("returnResult.kt") public void testReturnResult() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/inlineClasses/returnResult.kt"); } + @Test @TestMetadata("returnStringOverride.kt") public void testReturnStringOverride() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/inlineClasses/returnStringOverride.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class IntLikeVarSpilling extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class IntLikeVarSpilling extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInIntLikeVarSpilling() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("complicatedMerge.kt") public void testComplicatedMerge() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/complicatedMerge.kt"); } + @Test @TestMetadata("i2bResult.kt") public void testI2bResult() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/i2bResult.kt"); } + @Test @TestMetadata("loadFromBooleanArray.kt") public void testLoadFromBooleanArray() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/loadFromBooleanArray.kt"); } + @Test @TestMetadata("loadFromByteArray.kt") public void testLoadFromByteArray() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/loadFromByteArray.kt"); } + @Test @TestMetadata("noVariableInTable.kt") public void testNoVariableInTable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/noVariableInTable.kt"); } + @Test @TestMetadata("sameIconst1ManyVars.kt") public void testSameIconst1ManyVars() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/sameIconst1ManyVars.kt"); } + @Test @TestMetadata("usedInArrayStore.kt") public void testUsedInArrayStore() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInArrayStore.kt"); } + @Test @TestMetadata("usedInMethodCall.kt") public void testUsedInMethodCall() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInMethodCall.kt"); } + @Test @TestMetadata("usedInPutfield.kt") public void testUsedInPutfield() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInPutfield.kt"); } + @Test @TestMetadata("usedInVarStore.kt") public void testUsedInVarStore() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInVarStore.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/coroutines/stateMachine") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class StateMachine extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class StateMachine extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInStateMachine() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/coroutines/stateMachine"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("kt25893.kt") public void testKt25893() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/stateMachine/kt25893.kt"); } + @Test @TestMetadata("withTypeParameter.kt") public void testWithTypeParameter() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/stateMachine/withTypeParameter.kt"); @@ -1737,1058 +1939,1169 @@ public class FirBytecodeTextTestGenerated extends AbstractFirBytecodeTextTest { } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/deadCodeElimination") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class DeadCodeElimination extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class DeadCodeElimination extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInDeadCodeElimination() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/deadCodeElimination"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("arrayConstructor.kt") public void testArrayConstructor() throws Exception { runTest("compiler/testData/codegen/bytecodeText/deadCodeElimination/arrayConstructor.kt"); } + @Test @TestMetadata("boxing.kt") public void testBoxing() throws Exception { runTest("compiler/testData/codegen/bytecodeText/deadCodeElimination/boxing.kt"); } + @Test @TestMetadata("boxingNotOptimizable.kt") public void testBoxingNotOptimizable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/deadCodeElimination/boxingNotOptimizable.kt"); } + @Test @TestMetadata("emptyVariableRange.kt") public void testEmptyVariableRange() throws Exception { runTest("compiler/testData/codegen/bytecodeText/deadCodeElimination/emptyVariableRange.kt"); } + @Test @TestMetadata("kt14357.kt") public void testKt14357() throws Exception { runTest("compiler/testData/codegen/bytecodeText/deadCodeElimination/kt14357.kt"); } + @Test @TestMetadata("lastReturn.kt") public void testLastReturn() throws Exception { runTest("compiler/testData/codegen/bytecodeText/deadCodeElimination/lastReturn.kt"); } + @Test @TestMetadata("literal.kt") public void testLiteral() throws Exception { runTest("compiler/testData/codegen/bytecodeText/deadCodeElimination/literal.kt"); } + @Test @TestMetadata("simpleConstructor.kt") public void testSimpleConstructor() throws Exception { runTest("compiler/testData/codegen/bytecodeText/deadCodeElimination/simpleConstructor.kt"); } + @Test @TestMetadata("simpleConstructorNotRedundant.kt") public void testSimpleConstructorNotRedundant() throws Exception { runTest("compiler/testData/codegen/bytecodeText/deadCodeElimination/simpleConstructorNotRedundant.kt"); } + @Test @TestMetadata("simpleConstructorNotRedundantNotOptimizable.kt") public void testSimpleConstructorNotRedundantNotOptimizable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/deadCodeElimination/simpleConstructorNotRedundantNotOptimizable.kt"); } + @Test @TestMetadata("unusedPrimitiveAndObjectEquals.kt") public void testUnusedPrimitiveAndObjectEquals() throws Exception { runTest("compiler/testData/codegen/bytecodeText/deadCodeElimination/unusedPrimitiveAndObjectEquals.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/defaultArguments") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class DefaultArguments extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class DefaultArguments extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInDefaultArguments() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/defaultArguments"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("inheritedInterfaceFunction.kt") public void testInheritedInterfaceFunction() throws Exception { runTest("compiler/testData/codegen/bytecodeText/defaultArguments/inheritedInterfaceFunction.kt"); } + @Test @TestMetadata("kt11962.kt") public void testKt11962() throws Exception { runTest("compiler/testData/codegen/bytecodeText/defaultArguments/kt11962.kt"); } + @Test @TestMetadata("localVariablesInInlinedDefaultStubs.kt") public void testLocalVariablesInInlinedDefaultStubs() throws Exception { runTest("compiler/testData/codegen/bytecodeText/defaultArguments/localVariablesInInlinedDefaultStubs.kt"); } + @Test @TestMetadata("maskAndArgumentElimination.kt") public void testMaskAndArgumentElimination() throws Exception { runTest("compiler/testData/codegen/bytecodeText/defaultArguments/maskAndArgumentElimination.kt"); } + @Test @TestMetadata("maskCheckSequence.kt") public void testMaskCheckSequence() throws Exception { runTest("compiler/testData/codegen/bytecodeText/defaultArguments/maskCheckSequence.kt"); } + @Test @TestMetadata("methodHandlerElimination.kt") public void testMethodHandlerElimination() throws Exception { runTest("compiler/testData/codegen/bytecodeText/defaultArguments/methodHandlerElimination.kt"); } + @Test @TestMetadata("noAccessorForDefault.kt") public void testNoAccessorForDefault() throws Exception { runTest("compiler/testData/codegen/bytecodeText/defaultArguments/noAccessorForDefault.kt"); } + @Test @TestMetadata("noAnonymousObjectRegenerationInDefaultStub.kt") public void testNoAnonymousObjectRegenerationInDefaultStub() throws Exception { runTest("compiler/testData/codegen/bytecodeText/defaultArguments/noAnonymousObjectRegenerationInDefaultStub.kt"); } + @Test @TestMetadata("noEmptyArray.kt") public void testNoEmptyArray() throws Exception { runTest("compiler/testData/codegen/bytecodeText/defaultArguments/noEmptyArray.kt"); } + @Test @TestMetadata("noSyntheticParameters.kt") public void testNoSyntheticParameters() throws Exception { runTest("compiler/testData/codegen/bytecodeText/defaultArguments/noSyntheticParameters.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/directInvoke") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class DirectInvoke extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class DirectInvoke extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInDirectInvoke() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/directInvoke"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("callableReference.kt") public void testCallableReference() throws Exception { runTest("compiler/testData/codegen/bytecodeText/directInvoke/callableReference.kt"); } + @Test @TestMetadata("inplaceClosure.kt") public void testInplaceClosure() throws Exception { runTest("compiler/testData/codegen/bytecodeText/directInvoke/inplaceClosure.kt"); } + @Test @TestMetadata("localFun.kt") public void testLocalFun() throws Exception { runTest("compiler/testData/codegen/bytecodeText/directInvoke/localFun.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/disabledOptimizations") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class DisabledOptimizations extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class DisabledOptimizations extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInDisabledOptimizations() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/disabledOptimizations"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("noJumpInLastBranch.kt") public void testNoJumpInLastBranch() throws Exception { runTest("compiler/testData/codegen/bytecodeText/disabledOptimizations/noJumpInLastBranch.kt"); } + @Test @TestMetadata("noJumpInSingleBranch.kt") public void testNoJumpInSingleBranch() throws Exception { runTest("compiler/testData/codegen/bytecodeText/disabledOptimizations/noJumpInSingleBranch.kt"); } + @Test @TestMetadata("noObjectCastAfterReification.kt") public void testNoObjectCastAfterReification() throws Exception { runTest("compiler/testData/codegen/bytecodeText/disabledOptimizations/noObjectCastAfterReification.kt"); } + @Test @TestMetadata("noUnitInstanceInDefaultParameterInitialization.kt") public void testNoUnitInstanceInDefaultParameterInitialization() throws Exception { runTest("compiler/testData/codegen/bytecodeText/disabledOptimizations/noUnitInstanceInDefaultParameterInitialization.kt"); } + @Test @TestMetadata("noUnitInstanceOnVoidFunctionCall.kt") public void testNoUnitInstanceOnVoidFunctionCall() throws Exception { runTest("compiler/testData/codegen/bytecodeText/disabledOptimizations/noUnitInstanceOnVoidFunctionCall.kt"); } + @Test @TestMetadata("noUnusedLabel.kt") public void testNoUnusedLabel() throws Exception { runTest("compiler/testData/codegen/bytecodeText/disabledOptimizations/noUnusedLabel.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/enum") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Enum extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class Enum extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInEnum() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/enum"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("constructorAccessors.kt") public void testConstructorAccessors() throws Exception { runTest("compiler/testData/codegen/bytecodeText/enum/constructorAccessors.kt"); } + @Test @TestMetadata("enumCheckcasts.kt") public void testEnumCheckcasts() throws Exception { runTest("compiler/testData/codegen/bytecodeText/enum/enumCheckcasts.kt"); } + @Test @TestMetadata("kt18731.kt") public void testKt18731() throws Exception { runTest("compiler/testData/codegen/bytecodeText/enum/kt18731.kt"); } + @Test @TestMetadata("kt18731_2.kt") public void testKt18731_2() throws Exception { runTest("compiler/testData/codegen/bytecodeText/enum/kt18731_2.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/exclExcl") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ExclExcl extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class ExclExcl extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInExclExcl() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/exclExcl"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("primitive.kt") public void testPrimitive() throws Exception { runTest("compiler/testData/codegen/bytecodeText/exclExcl/primitive.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/fieldsForCapturedValues") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class FieldsForCapturedValues extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class FieldsForCapturedValues extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInFieldsForCapturedValues() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/fieldsForCapturedValues"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("extensionLambdaExtensionReceiver.kt") public void testExtensionLambdaExtensionReceiver() throws Exception { runTest("compiler/testData/codegen/bytecodeText/fieldsForCapturedValues/extensionLambdaExtensionReceiver.kt"); } + @Test @TestMetadata("extensionReceiver.kt") public void testExtensionReceiver() throws Exception { runTest("compiler/testData/codegen/bytecodeText/fieldsForCapturedValues/extensionReceiver.kt"); } + @Test @TestMetadata("innerAndOuterThis.kt") public void testInnerAndOuterThis() throws Exception { runTest("compiler/testData/codegen/bytecodeText/fieldsForCapturedValues/innerAndOuterThis.kt"); } + @Test @TestMetadata("labeledExtensionLambdaExtensionReceiver.kt") public void testLabeledExtensionLambdaExtensionReceiver() throws Exception { runTest("compiler/testData/codegen/bytecodeText/fieldsForCapturedValues/labeledExtensionLambdaExtensionReceiver.kt"); } + @Test @TestMetadata("multipleExtensionReceivers.kt") public void testMultipleExtensionReceivers() throws Exception { runTest("compiler/testData/codegen/bytecodeText/fieldsForCapturedValues/multipleExtensionReceivers.kt"); } + @Test @TestMetadata("outerThis.kt") public void testOuterThis() throws Exception { runTest("compiler/testData/codegen/bytecodeText/fieldsForCapturedValues/outerThis.kt"); } + @Test @TestMetadata("outerThisInInnerConstructor.kt") public void testOuterThisInInnerConstructor() throws Exception { runTest("compiler/testData/codegen/bytecodeText/fieldsForCapturedValues/outerThisInInnerConstructor.kt"); } + @Test @TestMetadata("outerThisInInnerInitBlock.kt") public void testOuterThisInInnerInitBlock() throws Exception { runTest("compiler/testData/codegen/bytecodeText/fieldsForCapturedValues/outerThisInInnerInitBlock.kt"); } + @Test @TestMetadata("this.kt") public void testThis() throws Exception { runTest("compiler/testData/codegen/bytecodeText/fieldsForCapturedValues/this.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/forLoop") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ForLoop extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class ForLoop extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInForLoop() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/forLoop"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("forInCharSequence.kt") public void testForInCharSequence() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInCharSequence.kt"); } + @Test @TestMetadata("forInCharSequenceTypeParameter.kt") public void testForInCharSequenceTypeParameter() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInCharSequenceTypeParameter.kt"); } + @Test @TestMetadata("forInDownToCharMinValue.kt") public void testForInDownToCharMinValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInDownToCharMinValue.kt"); } + @Test @TestMetadata("forInDownToIntMinValue.kt") public void testForInDownToIntMinValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInDownToIntMinValue.kt"); } + @Test @TestMetadata("forInDownToLongMinValue.kt") public void testForInDownToLongMinValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInDownToLongMinValue.kt"); } + @Test @TestMetadata("forInObjectArray.kt") public void testForInObjectArray() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInObjectArray.kt"); } + @Test @TestMetadata("forInPrimitiveArray.kt") public void testForInPrimitiveArray() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInPrimitiveArray.kt"); } + @Test @TestMetadata("forInRangeSpecializedToUntil.kt") public void testForInRangeSpecializedToUntil() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeSpecializedToUntil.kt"); } + @Test @TestMetadata("forInRangeToCharConst.kt") public void testForInRangeToCharConst() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeToCharConst.kt"); } + @Test @TestMetadata("forInRangeToCharMaxValue.kt") public void testForInRangeToCharMaxValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeToCharMaxValue.kt"); } + @Test @TestMetadata("forInRangeToConst.kt") public void testForInRangeToConst() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeToConst.kt"); } + @Test @TestMetadata("forInRangeToIntMaxValue.kt") public void testForInRangeToIntMaxValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeToIntMaxValue.kt"); } + @Test @TestMetadata("forInRangeToLongConst.kt") public void testForInRangeToLongConst() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeToLongConst.kt"); } + @Test @TestMetadata("forInRangeToLongMaxValue.kt") public void testForInRangeToLongMaxValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeToLongMaxValue.kt"); } + @Test @TestMetadata("forInRangeToQualifiedConst.kt") public void testForInRangeToQualifiedConst() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeToQualifiedConst.kt"); } + @Test @TestMetadata("forInRangeWithImplicitReceiver.kt") public void testForInRangeWithImplicitReceiver() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeWithImplicitReceiver.kt"); } + @Test @TestMetadata("forInStringSpecialized.kt") public void testForInStringSpecialized() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInStringSpecialized.kt"); } + @Test @TestMetadata("forIntInDownTo.kt") public void testForIntInDownTo() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forIntInDownTo.kt"); } + @Test @TestMetadata("iincGeneration.kt") public void testIincGeneration() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/iincGeneration.kt"); } + @Test @TestMetadata("intrinsicArrayConstructorsUseCounterLoop.kt") public void testIntrinsicArrayConstructorsUseCounterLoop() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/intrinsicArrayConstructorsUseCounterLoop.kt"); } + @Test @TestMetadata("loopVarInterval.kt") public void testLoopVarInterval() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/loopVarInterval.kt"); } + @Test @TestMetadata("primitiveLiteralRange1.kt") public void testPrimitiveLiteralRange1() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/primitiveLiteralRange1.kt"); } + @Test @TestMetadata("primitiveLiteralRange2.kt") public void testPrimitiveLiteralRange2() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/primitiveLiteralRange2.kt"); } + @Test @TestMetadata("primitiveProgression.kt") public void testPrimitiveProgression() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/primitiveProgression.kt"); } + @Test @TestMetadata("primitiveRange.kt") public void testPrimitiveRange() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/primitiveRange.kt"); } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/forLoop/forInArrayWithIndex") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ForInArrayWithIndex extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class ForInArrayWithIndex extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInForInArrayWithIndex() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/forLoop/forInArrayWithIndex"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("forInArrayWithIndexNoElementVar.kt") public void testForInArrayWithIndexNoElementVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInArrayWithIndex/forInArrayWithIndexNoElementVar.kt"); } + @Test @TestMetadata("forInArrayWithIndexNoIndexVar.kt") public void testForInArrayWithIndexNoIndexVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInArrayWithIndex/forInArrayWithIndexNoIndexVar.kt"); } + @Test @TestMetadata("forInEmptyArrayWithIndex.kt") public void testForInEmptyArrayWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInArrayWithIndex/forInEmptyArrayWithIndex.kt"); } + @Test @TestMetadata("forInIntArrayWithIndex.kt") public void testForInIntArrayWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInArrayWithIndex/forInIntArrayWithIndex.kt"); } + @Test @TestMetadata("forInObjectArrayWithIndex.kt") public void testForInObjectArrayWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInArrayWithIndex/forInObjectArrayWithIndex.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/forLoop/forInCharSequenceWithIndex") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ForInCharSequenceWithIndex extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class ForInCharSequenceWithIndex extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInForInCharSequenceWithIndex() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/forLoop/forInCharSequenceWithIndex"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("forInCharSequenceWithIndex.kt") public void testForInCharSequenceWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInCharSequenceWithIndex/forInCharSequenceWithIndex.kt"); } + @Test @TestMetadata("forInEmptyStringWithIndex.kt") public void testForInEmptyStringWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInCharSequenceWithIndex/forInEmptyStringWithIndex.kt"); } + @Test @TestMetadata("forInStringWithIndex.kt") public void testForInStringWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInCharSequenceWithIndex/forInStringWithIndex.kt"); } + @Test @TestMetadata("forInStringWithIndexNoElementVar.kt") public void testForInStringWithIndexNoElementVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInCharSequenceWithIndex/forInStringWithIndexNoElementVar.kt"); } + @Test @TestMetadata("forInStringWithIndexNoIndexVar.kt") public void testForInStringWithIndexNoIndexVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInCharSequenceWithIndex/forInStringWithIndexNoIndexVar.kt"); } + @Test @TestMetadata("forInStringWithIndexWithExplicitlyTypedIndexVariable.kt") public void testForInStringWithIndexWithExplicitlyTypedIndexVariable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInCharSequenceWithIndex/forInStringWithIndexWithExplicitlyTypedIndexVariable.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/forLoop/forInIndices") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ForInIndices extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class ForInIndices extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInForInIndices() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/forLoop/forInIndices"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("forInArrayListIndices.kt") public void testForInArrayListIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIndices/forInArrayListIndices.kt"); } + @Test @TestMetadata("forInCharSequenceIndices.kt") public void testForInCharSequenceIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIndices/forInCharSequenceIndices.kt"); } + @Test @TestMetadata("forInCharSequenceTypeParameterIndices.kt") public void testForInCharSequenceTypeParameterIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIndices/forInCharSequenceTypeParameterIndices.kt"); } + @Test @TestMetadata("forInCollectionImplicitReceiverIndices.kt") public void testForInCollectionImplicitReceiverIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIndices/forInCollectionImplicitReceiverIndices.kt"); } + @Test @TestMetadata("forInCollectionIndices.kt") public void testForInCollectionIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIndices/forInCollectionIndices.kt"); } + @Test @TestMetadata("forInCollectionTypeParameterIndices.kt") public void testForInCollectionTypeParameterIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIndices/forInCollectionTypeParameterIndices.kt"); } + @Test @TestMetadata("forInNonOptimizedIndices.kt") public void testForInNonOptimizedIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIndices/forInNonOptimizedIndices.kt"); } + @Test @TestMetadata("forInObjectArrayIndices.kt") public void testForInObjectArrayIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIndices/forInObjectArrayIndices.kt"); } + @Test @TestMetadata("forInPrimitiveArrayIndices.kt") public void testForInPrimitiveArrayIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIndices/forInPrimitiveArrayIndices.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/forLoop/forInIterableWithIndex") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ForInIterableWithIndex extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class ForInIterableWithIndex extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInForInIterableWithIndex() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/forLoop/forInIterableWithIndex"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("forInEmptyListWithIndex.kt") public void testForInEmptyListWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIterableWithIndex/forInEmptyListWithIndex.kt"); } + @Test @TestMetadata("forInIterableTypeParameterWithIndex.kt") public void testForInIterableTypeParameterWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIterableWithIndex/forInIterableTypeParameterWithIndex.kt"); } + @Test @TestMetadata("forInListWithIndex.kt") public void testForInListWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIterableWithIndex/forInListWithIndex.kt"); } + @Test @TestMetadata("forInListWithIndexNoElementVar.kt") public void testForInListWithIndexNoElementVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIterableWithIndex/forInListWithIndexNoElementVar.kt"); } + @Test @TestMetadata("forInListWithIndexNoIndexVar.kt") public void testForInListWithIndexNoIndexVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIterableWithIndex/forInListWithIndexNoIndexVar.kt"); } + @Test @TestMetadata("forInListWithIndexWithExplicitlyTypedIndexVariable.kt") public void testForInListWithIndexWithExplicitlyTypedIndexVariable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIterableWithIndex/forInListWithIndexWithExplicitlyTypedIndexVariable.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ForInProgressionWithIndex extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class ForInProgressionWithIndex extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInForInProgressionWithIndex() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("forInDownToWithIndex.kt") public void testForInDownToWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInDownToWithIndex.kt"); } + @Test @TestMetadata("forInIndicesWithIndex.kt") public void testForInIndicesWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInIndicesWithIndex.kt"); } + @Test @TestMetadata("forInRangeToWithIndex.kt") public void testForInRangeToWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInRangeToWithIndex.kt"); } + @Test @TestMetadata("forInReversedStepWithIndex.kt") public void testForInReversedStepWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInReversedStepWithIndex.kt"); } + @Test @TestMetadata("forInReversedWithIndex.kt") public void testForInReversedWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInReversedWithIndex.kt"); } + @Test @TestMetadata("forInStepReversedWithIndex.kt") public void testForInStepReversedWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInStepReversedWithIndex.kt"); } + @Test @TestMetadata("forInStepWithIndex.kt") public void testForInStepWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInStepWithIndex.kt"); } + @Test @TestMetadata("forInUntilWithIndex.kt") public void testForInUntilWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInUntilWithIndex.kt"); } + @Test @TestMetadata("forInWithIndexNoIndexOrElementVar.kt") public void testForInWithIndexNoIndexOrElementVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInWithIndexNoIndexOrElementVar.kt"); } + @Test @TestMetadata("forInWithIndexNotDestructured.kt") public void testForInWithIndexNotDestructured() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInWithIndexNotDestructured.kt"); } + @Test @TestMetadata("forInWithIndexReversed.kt") public void testForInWithIndexReversed() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInWithIndexReversed.kt"); } + @Test @TestMetadata("forInWithIndexWithIndex.kt") public void testForInWithIndexWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInWithIndexWithIndex.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/forLoop/forInReversed") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ForInReversed extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class ForInReversed extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInForInReversed() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/forLoop/forInReversed"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("forInReversedArrayIndices.kt") public void testForInReversedArrayIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInReversed/forInReversedArrayIndices.kt"); } + @Test @TestMetadata("forInReversedCharSequenceIndices.kt") public void testForInReversedCharSequenceIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInReversed/forInReversedCharSequenceIndices.kt"); } + @Test @TestMetadata("forInReversedCollectionIndices.kt") public void testForInReversedCollectionIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInReversed/forInReversedCollectionIndices.kt"); } + @Test @TestMetadata("forInReversedDownTo.kt") public void testForInReversedDownTo() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInReversed/forInReversedDownTo.kt"); } + @Test @TestMetadata("forInReversedEmptyRangeLiteral.kt") public void testForInReversedEmptyRangeLiteral() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInReversed/forInReversedEmptyRangeLiteral.kt"); } + @Test @TestMetadata("forInReversedRange.kt") public void testForInReversedRange() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInReversed/forInReversedRange.kt"); } + @Test @TestMetadata("forInReversedRangeLiteral.kt") public void testForInReversedRangeLiteral() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInReversed/forInReversedRangeLiteral.kt"); } + @Test @TestMetadata("forInReversedReversedArrayIndices.kt") public void testForInReversedReversedArrayIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInReversed/forInReversedReversedArrayIndices.kt"); } + @Test @TestMetadata("forInReversedReversedDownTo.kt") public void testForInReversedReversedDownTo() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInReversed/forInReversedReversedDownTo.kt"); } + @Test @TestMetadata("ForInReversedReversedRange.kt") public void testForInReversedReversedRange() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInReversed/ForInReversedReversedRange.kt"); } + @Test @TestMetadata("forInReversedReversedReversedRange.kt") public void testForInReversedReversedReversedRange() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInReversed/forInReversedReversedReversedRange.kt"); } + @Test @TestMetadata("forInReversedReversedUntil.kt") public void testForInReversedReversedUntil() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInReversed/forInReversedReversedUntil.kt"); } + @Test @TestMetadata("forInReversedUntil.kt") public void testForInReversedUntil() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInReversed/forInReversedUntil.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/forLoop/forInSequenceWithIndex") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ForInSequenceWithIndex extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class ForInSequenceWithIndex extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInForInSequenceWithIndex() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/forLoop/forInSequenceWithIndex"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("forInEmptySequenceWithIndex.kt") public void testForInEmptySequenceWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInSequenceWithIndex/forInEmptySequenceWithIndex.kt"); } + @Test @TestMetadata("forInSequenceTypeParameterWithIndex.kt") public void testForInSequenceTypeParameterWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInSequenceWithIndex/forInSequenceTypeParameterWithIndex.kt"); } + @Test @TestMetadata("forInSequenceWithIndex.kt") public void testForInSequenceWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInSequenceWithIndex/forInSequenceWithIndex.kt"); } + @Test @TestMetadata("forInSequenceWithIndexNoElementVar.kt") public void testForInSequenceWithIndexNoElementVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInSequenceWithIndex/forInSequenceWithIndexNoElementVar.kt"); } + @Test @TestMetadata("forInSequenceWithIndexNoIndexVar.kt") public void testForInSequenceWithIndexNoIndexVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInSequenceWithIndex/forInSequenceWithIndexNoIndexVar.kt"); } + @Test @TestMetadata("forInSequenceWithIndexThrowsCME.kt") public void testForInSequenceWithIndexThrowsCME() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInSequenceWithIndex/forInSequenceWithIndexThrowsCME.kt"); } + @Test @TestMetadata("forInSequenceWithIndexWithExplicitlyTypedIndexVariable.kt") public void testForInSequenceWithIndexWithExplicitlyTypedIndexVariable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInSequenceWithIndex/forInSequenceWithIndexWithExplicitlyTypedIndexVariable.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/forLoop/forInUntil") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ForInUntil extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class ForInUntil extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInForInUntil() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/forLoop/forInUntil"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("forInUntilChar.kt") public void testForInUntilChar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInUntil/forInUntilChar.kt"); } + @Test @TestMetadata("forInUntilCharMaxValue.kt") public void testForInUntilCharMaxValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInUntil/forInUntilCharMaxValue.kt"); } + @Test @TestMetadata("forInUntilCharMinValue.kt") public void testForInUntilCharMinValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInUntil/forInUntilCharMinValue.kt"); } + @Test @TestMetadata("forInUntilInt.kt") public void testForInUntilInt() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInUntil/forInUntilInt.kt"); } + @Test @TestMetadata("forInUntilIntMaxValue.kt") public void testForInUntilIntMaxValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInUntil/forInUntilIntMaxValue.kt"); } + @Test @TestMetadata("forInUntilIntMinValue.kt") public void testForInUntilIntMinValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInUntil/forInUntilIntMinValue.kt"); } + @Test @TestMetadata("forInUntilLong.kt") public void testForInUntilLong() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInUntil/forInUntilLong.kt"); } + @Test @TestMetadata("forInUntilLongMaxValue.kt") public void testForInUntilLongMaxValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInUntil/forInUntilLongMaxValue.kt"); } + @Test @TestMetadata("forInUntilLongMinValue.kt") public void testForInUntilLongMinValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInUntil/forInUntilLongMinValue.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/forLoop/stepped") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Stepped extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class Stepped extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInStepped() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/forLoop/stepped"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("illegalStepConst.kt") public void testIllegalStepConst() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/stepped/illegalStepConst.kt"); } + @Test @TestMetadata("reversedThenStep.kt") public void testReversedThenStep() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/stepped/reversedThenStep.kt"); } + @Test @TestMetadata("stepConst.kt") public void testStepConst() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/stepped/stepConst.kt"); } + @Test @TestMetadata("stepConstOnNonLiteralProgression.kt") public void testStepConstOnNonLiteralProgression() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/stepped/stepConstOnNonLiteralProgression.kt"); } + @Test @TestMetadata("stepNonConst.kt") public void testStepNonConst() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/stepped/stepNonConst.kt"); } + @Test @TestMetadata("stepNonConstOnNonLiteralProgression.kt") public void testStepNonConstOnNonLiteralProgression() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/stepped/stepNonConstOnNonLiteralProgression.kt"); } + @Test @TestMetadata("stepOnNonLiteralRange.kt") public void testStepOnNonLiteralRange() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/stepped/stepOnNonLiteralRange.kt"); } + @Test @TestMetadata("stepOne.kt") public void testStepOne() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/stepped/stepOne.kt"); } + @Test @TestMetadata("stepOneThenStepOne.kt") public void testStepOneThenStepOne() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/stepped/stepOneThenStepOne.kt"); } + @Test @TestMetadata("stepThenDifferentStep.kt") public void testStepThenDifferentStep() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/stepped/stepThenDifferentStep.kt"); } + @Test @TestMetadata("stepThenReversed.kt") public void testStepThenReversed() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/stepped/stepThenReversed.kt"); } + @Test @TestMetadata("stepThenSameStep.kt") public void testStepThenSameStep() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/stepped/stepThenSameStep.kt"); } + @Test @TestMetadata("stepThenStepNonConst.kt") public void testStepThenStepNonConst() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/stepped/stepThenStepNonConst.kt"); } + @Test @TestMetadata("stepThenStepOne.kt") public void testStepThenStepOne() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/stepped/stepThenStepOne.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/forLoop/unsigned") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Unsigned extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class Unsigned extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInUnsigned() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/forLoop/unsigned"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("forInDownToUIntMinValue.kt") public void testForInDownToUIntMinValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInDownToUIntMinValue.kt"); } + @Test @TestMetadata("forInDownToULongMinValue.kt") public void testForInDownToULongMinValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInDownToULongMinValue.kt"); } + @Test @TestMetadata("forInOptimizableUnsignedRange.kt") public void testForInOptimizableUnsignedRange() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInOptimizableUnsignedRange.kt"); } + @Test @TestMetadata("forInRangeToUIntMaxValue.kt") public void testForInRangeToUIntMaxValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInRangeToUIntMaxValue.kt"); } + @Test @TestMetadata("forInRangeToULongMaxValue.kt") public void testForInRangeToULongMaxValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInRangeToULongMaxValue.kt"); } + @Test @TestMetadata("forInUntilUIntMaxValue.kt") public void testForInUntilUIntMaxValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInUntilUIntMaxValue.kt"); } + @Test @TestMetadata("forInUntilUIntMinValue.kt") public void testForInUntilUIntMinValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInUntilUIntMinValue.kt"); } + @Test @TestMetadata("forInUntilULongMaxValue.kt") public void testForInUntilULongMaxValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInUntilULongMaxValue.kt"); } + @Test @TestMetadata("forInUntilULongMinValue.kt") public void testForInUntilULongMinValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInUntilULongMinValue.kt"); } + @Test @TestMetadata("illegalStepConst.kt") public void testIllegalStepConst() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/illegalStepConst.kt"); } + @Test @TestMetadata("reversedThenStep.kt") public void testReversedThenStep() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/reversedThenStep.kt"); } + @Test @TestMetadata("stepConstOnNonLiteralProgression.kt") public void testStepConstOnNonLiteralProgression() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/stepConstOnNonLiteralProgression.kt"); } + @Test @TestMetadata("stepNonConstOnNonLiteralProgression.kt") public void testStepNonConstOnNonLiteralProgression() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/stepNonConstOnNonLiteralProgression.kt"); } + @Test @TestMetadata("stepOnNonLiteralRange.kt") public void testStepOnNonLiteralRange() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/stepOnNonLiteralRange.kt"); } + @Test @TestMetadata("stepThenDifferentStep.kt") public void testStepThenDifferentStep() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/stepThenDifferentStep.kt"); @@ -2796,201 +3109,219 @@ public class FirBytecodeTextTestGenerated extends AbstractFirBytecodeTextTest { } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/hashCode") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class HashCode extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class HashCode extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInHashCode() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/hashCode"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("hashCode.kt") public void testHashCode() throws Exception { runTest("compiler/testData/codegen/bytecodeText/hashCode/hashCode.kt"); } + @Test @TestMetadata("interfaceHashCode.kt") public void testInterfaceHashCode() throws Exception { runTest("compiler/testData/codegen/bytecodeText/hashCode/interfaceHashCode.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/ieee754") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Ieee754 extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class Ieee754 extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInIeee754() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/ieee754"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("nullableDoubleEquals.kt") public void testNullableDoubleEquals() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ieee754/nullableDoubleEquals.kt"); } + @Test @TestMetadata("nullableDoubleNotEquals.kt") public void testNullableDoubleNotEquals() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ieee754/nullableDoubleNotEquals.kt"); } + @Test @TestMetadata("nullableFloatEquals.kt") public void testNullableFloatEquals() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ieee754/nullableFloatEquals.kt"); } + @Test @TestMetadata("nullableFloatNotEquals.kt") public void testNullableFloatNotEquals() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ieee754/nullableFloatNotEquals.kt"); } + @Test @TestMetadata("smartCastsForDouble.kt") public void testSmartCastsForDouble() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ieee754/smartCastsForDouble.kt"); } + @Test @TestMetadata("smartCastsForFloat.kt") public void testSmartCastsForFloat() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ieee754/smartCastsForFloat.kt"); } + @Test @TestMetadata("when.kt") public void testWhen() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ieee754/when.kt"); } + @Test @TestMetadata("whenNullableSmartCast.kt") public void testWhenNullableSmartCast() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ieee754/whenNullableSmartCast.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/inline") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Inline extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class Inline extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInInline() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/inline"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("deleteClassOnTransformation.kt") public void testDeleteClassOnTransformation() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/deleteClassOnTransformation.kt"); } + @Test @TestMetadata("finallyMarkers.kt") public void testFinallyMarkers() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/finallyMarkers.kt"); } + @Test @TestMetadata("inlineArgumentSlots.kt") public void testInlineArgumentSlots() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/inlineArgumentSlots.kt"); } + @Test @TestMetadata("inlineReturnsNothing1.kt") public void testInlineReturnsNothing1() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/inlineReturnsNothing1.kt"); } + @Test @TestMetadata("inlineReturnsNothing2.kt") public void testInlineReturnsNothing2() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/inlineReturnsNothing2.kt"); } + @Test @TestMetadata("inlineReturnsNothing3.kt") public void testInlineReturnsNothing3() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/inlineReturnsNothing3.kt"); } + @Test @TestMetadata("inlineSuspendReifiedNoSpilling.kt") public void testInlineSuspendReifiedNoSpilling() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/inlineSuspendReifiedNoSpilling.kt"); } + @Test @TestMetadata("interfaceDefaultMethod.kt") public void testInterfaceDefaultMethod() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/interfaceDefaultMethod.kt"); } + @Test @TestMetadata("linenumberForOneParametersArgumentCall.kt") public void testLinenumberForOneParametersArgumentCall() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/linenumberForOneParametersArgumentCall.kt"); } + @Test @TestMetadata("noSynAccessor.kt") public void testNoSynAccessor() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/noSynAccessor.kt"); } + @Test @TestMetadata("noSynAccessorToDirectFieldAccess.kt") public void testNoSynAccessorToDirectFieldAccess() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/noSynAccessorToDirectFieldAccess.kt"); } + @Test @TestMetadata("noSynAccessorToSuper.kt") public void testNoSynAccessorToSuper() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/noSynAccessorToSuper.kt"); } + @Test @TestMetadata("notSplitedExceptionTable.kt") public void testNotSplitedExceptionTable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/notSplitedExceptionTable.kt"); } + @Test @TestMetadata("reifiedSafeAsWithMutable.kt") public void testReifiedSafeAsWithMutable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/reifiedSafeAsWithMutable.kt"); } + @Test @TestMetadata("remappedLocalVar.kt") public void testRemappedLocalVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/remappedLocalVar.kt"); } + @Test @TestMetadata("removedFinallyMarkers.kt") public void testRemovedFinallyMarkers() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/removedFinallyMarkers.kt"); } + @Test @TestMetadata("specialEnumFunction.kt") public void testSpecialEnumFunction() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/specialEnumFunction.kt"); } + @Test @TestMetadata("splitedExceptionTable.kt") public void testSplitedExceptionTable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/splitedExceptionTable.kt"); } + @Test @TestMetadata("whenMappingOnCallSite.kt") public void testWhenMappingOnCallSite() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/whenMappingOnCallSite.kt"); } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/inline/property") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Property extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class Property extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInProperty() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/inline/property"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/property/simple.kt"); @@ -2998,646 +3329,714 @@ public class FirBytecodeTextTestGenerated extends AbstractFirBytecodeTextTest { } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/inlineClasses") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class InlineClasses extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class InlineClasses extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInInlineClasses() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/inlineClasses"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("asCastForInlineClass.kt") public void testAsCastForInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/asCastForInlineClass.kt"); } + @Test @TestMetadata("assertionsForParametersOfInlineClassTypes.kt") public void testAssertionsForParametersOfInlineClassTypes() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/assertionsForParametersOfInlineClassTypes.kt"); } + @Test @TestMetadata("boxInlineClassInsideElvisWithNullConstant.kt") public void testBoxInlineClassInsideElvisWithNullConstant() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/boxInlineClassInsideElvisWithNullConstant.kt"); } + @Test @TestMetadata("boxInlineClassesOnPassingToVarargs.kt") public void testBoxInlineClassesOnPassingToVarargs() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/boxInlineClassesOnPassingToVarargs.kt"); } + @Test @TestMetadata("boxMethodCalledByInlineClass.kt") public void testBoxMethodCalledByInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/boxMethodCalledByInlineClass.kt"); } + @Test @TestMetadata("boxResultAfterConstructorCall.kt") public void testBoxResultAfterConstructorCall() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/boxResultAfterConstructorCall.kt"); } + @Test @TestMetadata("boxResultInlineClassOfConstructorCall.kt") public void testBoxResultInlineClassOfConstructorCall() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/boxResultInlineClassOfConstructorCall.kt"); } + @Test @TestMetadata("boxThisOfInlineClass.kt") public void testBoxThisOfInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/boxThisOfInlineClass.kt"); } + @Test @TestMetadata("boxUnboxInlineClassFromMethodReturnType.kt") public void testBoxUnboxInlineClassFromMethodReturnType() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/boxUnboxInlineClassFromMethodReturnType.kt"); } + @Test @TestMetadata("boxUnboxInsideLambdaAsLastExpression.kt") public void testBoxUnboxInsideLambdaAsLastExpression() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/boxUnboxInsideLambdaAsLastExpression.kt"); } + @Test @TestMetadata("boxUnboxOfInlineClassesWithFunctionalTypes.kt") public void testBoxUnboxOfInlineClassesWithFunctionalTypes() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/boxUnboxOfInlineClassesWithFunctionalTypes.kt"); } + @Test @TestMetadata("boxUnboxOnInlinedParameters.kt") public void testBoxUnboxOnInlinedParameters() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/boxUnboxOnInlinedParameters.kt"); } + @Test @TestMetadata("boxingForNonLocalAndLabeledReturnsOfInlineClasses.kt") public void testBoxingForNonLocalAndLabeledReturnsOfInlineClasses() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/boxingForNonLocalAndLabeledReturnsOfInlineClasses.kt"); } + @Test @TestMetadata("callMemberMethodsInsideInlineClass.kt") public void testCallMemberMethodsInsideInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/callMemberMethodsInsideInlineClass.kt"); } + @Test @TestMetadata("checkBoxingInInlineClass.kt") public void testCheckBoxingInInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/checkBoxingInInlineClass.kt"); } + @Test @TestMetadata("checkOuterInlineFunctionCall.kt") public void testCheckOuterInlineFunctionCall() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/checkOuterInlineFunctionCall.kt"); } + @Test @TestMetadata("constructorBridge.kt") public void testConstructorBridge() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/constructorBridge.kt"); } + @Test @TestMetadata("constructorWithDefaultArguments.kt") public void testConstructorWithDefaultArguments() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/constructorWithDefaultArguments.kt"); } + @Test @TestMetadata("defaultParametersDontBox.kt") public void testDefaultParametersDontBox() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/defaultParametersDontBox.kt"); } + @Test @TestMetadata("delegatedPropertyMangling.kt") public void testDelegatedPropertyMangling() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/delegatedPropertyMangling.kt"); } + @Test @TestMetadata("equalsDoesNotBox.kt") public void testEqualsDoesNotBox() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/equalsDoesNotBox.kt"); } + @Test @TestMetadata("equalsIsCalledByInlineClass.kt") public void testEqualsIsCalledByInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/equalsIsCalledByInlineClass.kt"); } + @Test @TestMetadata("factoryMethodForSecondaryConstructorsCalledByInlineClass.kt") public void testFactoryMethodForSecondaryConstructorsCalledByInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/factoryMethodForSecondaryConstructorsCalledByInlineClass.kt"); } + @Test @TestMetadata("functionsWithInlineClassParametersHaveStableMangledNames.kt") public void testFunctionsWithInlineClassParametersHaveStableMangledNames() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/functionsWithInlineClassParametersHaveStableMangledNames.kt"); } + @Test @TestMetadata("generationOfAccessorToUnderlyingValue.kt") public void testGenerationOfAccessorToUnderlyingValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/generationOfAccessorToUnderlyingValue.kt"); } + @Test @TestMetadata("hashCodeIsCalledByInlineClass.kt") public void testHashCodeIsCalledByInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/hashCodeIsCalledByInlineClass.kt"); } + @Test @TestMetadata("inlineClassBoxingOnAssignment.kt") public void testInlineClassBoxingOnAssignment() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/inlineClassBoxingOnAssignment.kt"); } + @Test @TestMetadata("inlineClassBoxingOnFunctionCall.kt") public void testInlineClassBoxingOnFunctionCall() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/inlineClassBoxingOnFunctionCall.kt"); } + @Test @TestMetadata("inlineClassBoxingUnboxingInsideInlinedLambda.kt") public void testInlineClassBoxingUnboxingInsideInlinedLambda() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/inlineClassBoxingUnboxingInsideInlinedLambda.kt"); } + @Test @TestMetadata("inlineClassInGeneratedToString.kt") public void testInlineClassInGeneratedToString() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/inlineClassInGeneratedToString.kt"); } + @Test @TestMetadata("inlineClassInStringTemplate.kt") public void testInlineClassInStringTemplate() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/inlineClassInStringTemplate.kt"); } + @Test @TestMetadata("inlineClassesUnboxingAfterAssertionOperator.kt") public void testInlineClassesUnboxingAfterAssertionOperator() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/inlineClassesUnboxingAfterAssertionOperator.kt"); } + @Test @TestMetadata("interfaceDefaultImplStubs.kt") public void testInterfaceDefaultImplStubs() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/interfaceDefaultImplStubs.kt"); } + @Test @TestMetadata("interfaceJvmDefaultImplStubs.kt") public void testInterfaceJvmDefaultImplStubs() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/interfaceJvmDefaultImplStubs.kt"); } + @Test @TestMetadata("isCheckForInlineClass.kt") public void testIsCheckForInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/isCheckForInlineClass.kt"); } + @Test @TestMetadata("mangledInlineClassInterfaceImplementation.kt") public void testMangledInlineClassInterfaceImplementation() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/mangledInlineClassInterfaceImplementation.kt"); } + @Test @TestMetadata("noActualCallsOfInlineFunctionsOfInlineClass.kt") public void testNoActualCallsOfInlineFunctionsOfInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/noActualCallsOfInlineFunctionsOfInlineClass.kt"); } + @Test @TestMetadata("noAssertionsForInlineClassesBasedOnNullableTypes.kt") public void testNoAssertionsForInlineClassesBasedOnNullableTypes() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/noAssertionsForInlineClassesBasedOnNullableTypes.kt"); } + @Test @TestMetadata("noBoxingInMethod.kt") public void testNoBoxingInMethod() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/noBoxingInMethod.kt"); } + @Test @TestMetadata("noBoxingOnCastOperations.kt") public void testNoBoxingOnCastOperations() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/noBoxingOnCastOperations.kt"); } + @Test @TestMetadata("noBoxingOperationsOnNonTrivialSpread.kt") public void testNoBoxingOperationsOnNonTrivialSpread() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/noBoxingOperationsOnNonTrivialSpread.kt"); } + @Test @TestMetadata("noBoxingUnboxingInAccessorsForDelegatedPropertyWithInlineClassDelegate.kt") public void testNoBoxingUnboxingInAccessorsForDelegatedPropertyWithInlineClassDelegate() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/noBoxingUnboxingInAccessorsForDelegatedPropertyWithInlineClassDelegate.kt"); } + @Test @TestMetadata("noManglingForFunctionsWithJvmName.kt") public void testNoManglingForFunctionsWithJvmName() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/noManglingForFunctionsWithJvmName.kt"); } + @Test @TestMetadata("noReturnTypeMangling.kt") public void testNoReturnTypeMangling() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/noReturnTypeMangling.kt"); } + @Test @TestMetadata("nonOverridingMethodsAreCalledByInlineClass.kt") public void testNonOverridingMethodsAreCalledByInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/nonOverridingMethodsAreCalledByInlineClass.kt"); } + @Test @TestMetadata("overridingMethodsAreCalledByInlineClass.kt") public void testOverridingMethodsAreCalledByInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/overridingMethodsAreCalledByInlineClass.kt"); } + @Test @TestMetadata("passInlineClassesWithSpreadOperatorToVarargs.kt") public void testPassInlineClassesWithSpreadOperatorToVarargs() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/passInlineClassesWithSpreadOperatorToVarargs.kt"); } + @Test @TestMetadata("primaryConstructorCalledByInlineClass.kt") public void testPrimaryConstructorCalledByInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/primaryConstructorCalledByInlineClass.kt"); } + @Test @TestMetadata("propertyAccessorsAreCalledByInlineClass.kt") public void testPropertyAccessorsAreCalledByInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/propertyAccessorsAreCalledByInlineClass.kt"); } + @Test @TestMetadata("propertySetterWithInlineClassTypeArgument.kt") public void testPropertySetterWithInlineClassTypeArgument() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/propertySetterWithInlineClassTypeArgument.kt"); } + @Test @TestMetadata("resultApiDoesntCallSpecializedEquals.kt") public void testResultApiDoesntCallSpecializedEquals() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/resultApiDoesntCallSpecializedEquals.kt"); } + @Test @TestMetadata("resultApiDoesntUseBox.kt") public void testResultApiDoesntUseBox() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/resultApiDoesntUseBox.kt"); } + @Test @TestMetadata("resultApiEqualsDoesntBox.kt") public void testResultApiEqualsDoesntBox() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/resultApiEqualsDoesntBox.kt"); } + @Test @TestMetadata("resultApiRunCatchingDoesntBox.kt") public void testResultApiRunCatchingDoesntBox() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/resultApiRunCatchingDoesntBox.kt"); } + @Test @TestMetadata("resultApiStringInterpolationDoesntBox.kt") public void testResultApiStringInterpolationDoesntBox() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/resultApiStringInterpolationDoesntBox.kt"); } + @Test @TestMetadata("resultMangling.kt") public void testResultMangling() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/resultMangling.kt"); } + @Test @TestMetadata("skipCallToUnderlyingValueOfInlineClass.kt") public void testSkipCallToUnderlyingValueOfInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/skipCallToUnderlyingValueOfInlineClass.kt"); } + @Test @TestMetadata("suspendFunctionMangling.kt") public void testSuspendFunctionMangling() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/suspendFunctionMangling.kt"); } + @Test @TestMetadata("toStringOfInlineClassValue.kt") public void testToStringOfInlineClassValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/toStringOfInlineClassValue.kt"); } + @Test @TestMetadata("toStringOfReferenceInlineClassValue.kt") public void testToStringOfReferenceInlineClassValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/toStringOfReferenceInlineClassValue.kt"); } + @Test @TestMetadata("uIntArrayIteratorWithoutBoxing.kt") public void testUIntArrayIteratorWithoutBoxing() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/uIntArrayIteratorWithoutBoxing.kt"); } + @Test @TestMetadata("uIntArraySwapBoxing.kt") public void testUIntArraySwapBoxing() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/uIntArraySwapBoxing.kt"); } + @Test @TestMetadata("unboxInlineClassAfterElvis.kt") public void testUnboxInlineClassAfterElvis() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/unboxInlineClassAfterElvis.kt"); } + @Test @TestMetadata("unboxInlineClassAfterSafeCall.kt") public void testUnboxInlineClassAfterSafeCall() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/unboxInlineClassAfterSafeCall.kt"); } + @Test @TestMetadata("unboxInlineClassFromParameterizedType.kt") public void testUnboxInlineClassFromParameterizedType() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/unboxInlineClassFromParameterizedType.kt"); } + @Test @TestMetadata("unboxInlineClassesAfterSmartCasts.kt") public void testUnboxInlineClassesAfterSmartCasts() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/unboxInlineClassesAfterSmartCasts.kt"); } + @Test @TestMetadata("unboxMethodCalledByInlineClass.kt") public void testUnboxMethodCalledByInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/unboxMethodCalledByInlineClass.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/innerClasses") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class InnerClasses extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class InnerClasses extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInInnerClasses() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/innerClasses"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("nestedClassInAnnotationArgument.kt") public void testNestedClassInAnnotationArgument() throws Exception { runTest("compiler/testData/codegen/bytecodeText/innerClasses/nestedClassInAnnotationArgument.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/interfaces") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Interfaces extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class Interfaces extends AbstractFirBytecodeTextTest { + @Test @TestMetadata("addedInterfaceBridge.kt") public void testAddedInterfaceBridge() throws Exception { runTest("compiler/testData/codegen/bytecodeText/interfaces/addedInterfaceBridge.kt"); } + @Test public void testAllFilesPresentInInterfaces() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/interfaces"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("firstInheritedMethodIsAbstract.kt") public void testFirstInheritedMethodIsAbstract() throws Exception { runTest("compiler/testData/codegen/bytecodeText/interfaces/firstInheritedMethodIsAbstract.kt"); } + @Test @TestMetadata("noAnyMethodsOnInterfaceInheritance.kt") public void testNoAnyMethodsOnInterfaceInheritance() throws Exception { runTest("compiler/testData/codegen/bytecodeText/interfaces/noAnyMethodsOnInterfaceInheritance.kt"); } + @Test @TestMetadata("noPrivateMemberInJavaInterface.kt") public void testNoPrivateMemberInJavaInterface() throws Exception { runTest("compiler/testData/codegen/bytecodeText/interfaces/noPrivateMemberInJavaInterface.kt"); } + @Test @TestMetadata("traitImplGeneratedOnce.kt") public void testTraitImplGeneratedOnce() throws Exception { runTest("compiler/testData/codegen/bytecodeText/interfaces/traitImplGeneratedOnce.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/intrinsics") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Intrinsics extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class Intrinsics extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInIntrinsics() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/intrinsics"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("javaObjectType.kt") public void testJavaObjectType() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsics/javaObjectType.kt"); } + @Test @TestMetadata("javaPrimitiveType.kt") public void testJavaPrimitiveType() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsics/javaPrimitiveType.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/intrinsicsCompare") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class IntrinsicsCompare extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class IntrinsicsCompare extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInIntrinsicsCompare() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/intrinsicsCompare"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("byteSmartCast_after.kt") public void testByteSmartCast_after() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsicsCompare/byteSmartCast_after.kt"); } + @Test @TestMetadata("byteSmartCast_before.kt") public void testByteSmartCast_before() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsicsCompare/byteSmartCast_before.kt"); } + @Test @TestMetadata("charSmartCast.kt") public void testCharSmartCast() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsicsCompare/charSmartCast.kt"); } + @Test @TestMetadata("differentTypes_after.kt") public void testDifferentTypes_after() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsicsCompare/differentTypes_after.kt"); } + @Test @TestMetadata("differentTypes_before.kt") public void testDifferentTypes_before() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsicsCompare/differentTypes_before.kt"); } + @Test @TestMetadata("intSmartCast_after.kt") public void testIntSmartCast_after() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsicsCompare/intSmartCast_after.kt"); } + @Test @TestMetadata("intSmartCast_before.kt") public void testIntSmartCast_before() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsicsCompare/intSmartCast_before.kt"); } + @Test @TestMetadata("longSmartCast.kt") public void testLongSmartCast() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsicsCompare/longSmartCast.kt"); } + @Test @TestMetadata("shortSmartCast_after.kt") public void testShortSmartCast_after() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsicsCompare/shortSmartCast_after.kt"); } + @Test @TestMetadata("shortSmartCast_before.kt") public void testShortSmartCast_before() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsicsCompare/shortSmartCast_before.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/intrinsicsTrim") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class IntrinsicsTrim extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class IntrinsicsTrim extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInIntrinsicsTrim() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/intrinsicsTrim"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("trimIndentNegative.kt") public void testTrimIndentNegative() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsicsTrim/trimIndentNegative.kt"); } + @Test @TestMetadata("trimIndentPositive.kt") public void testTrimIndentPositive() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsicsTrim/trimIndentPositive.kt"); } + @Test @TestMetadata("trimMarginNegative.kt") public void testTrimMarginNegative() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsicsTrim/trimMarginNegative.kt"); } + @Test @TestMetadata("trimMarginPositive.kt") public void testTrimMarginPositive() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsicsTrim/trimMarginPositive.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/jvm8") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Jvm8 extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class Jvm8 extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInJvm8() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/jvm8"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/jvm8/hashCode") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class HashCode extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class HashCode extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInHashCode() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/jvm8/hashCode"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("dataClass.kt") public void testDataClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/jvm8/hashCode/dataClass.kt"); } + @Test @TestMetadata("hashCode.kt") public void testHashCode() throws Exception { runTest("compiler/testData/codegen/bytecodeText/jvm8/hashCode/hashCode.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class JvmDefault extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class JvmDefault extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInJvmDefault() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault/allCompatibility") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class AllCompatibility extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class AllCompatibility extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInAllCompatibility() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault/allCompatibility"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("defaultArgs.kt") public void testDefaultArgs() throws Exception { runTest("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault/allCompatibility/defaultArgs.kt"); } + @Test @TestMetadata("simpleDiamond.kt") public void testSimpleDiamond() throws Exception { runTest("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault/allCompatibility/simpleDiamond.kt"); } + @Test @TestMetadata("simpleFunction.kt") public void testSimpleFunction() throws Exception { runTest("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault/allCompatibility/simpleFunction.kt"); } + @Test @TestMetadata("simpleFunctionWithAbstractOverride.kt") public void testSimpleFunctionWithAbstractOverride() throws Exception { runTest("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault/allCompatibility/simpleFunctionWithAbstractOverride.kt"); } + @Test @TestMetadata("simpleProperty.kt") public void testSimpleProperty() throws Exception { runTest("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault/allCompatibility/simpleProperty.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault/compatibility") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Compatibility extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class Compatibility extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInCompatibility() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault/compatibility"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("defaultArgs.kt") public void testDefaultArgs() throws Exception { runTest("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault/compatibility/defaultArgs.kt"); } + @Test @TestMetadata("simpleDiamond.kt") public void testSimpleDiamond() throws Exception { runTest("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault/compatibility/simpleDiamond.kt"); } + @Test @TestMetadata("simpleFunction.kt") public void testSimpleFunction() throws Exception { runTest("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault/compatibility/simpleFunction.kt"); } + @Test @TestMetadata("simpleFunctionWithAbstractOverride.kt") public void testSimpleFunctionWithAbstractOverride() throws Exception { runTest("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault/compatibility/simpleFunctionWithAbstractOverride.kt"); } + @Test @TestMetadata("simpleProperty.kt") public void testSimpleProperty() throws Exception { runTest("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault/compatibility/simpleProperty.kt"); @@ -3646,498 +4045,553 @@ public class FirBytecodeTextTestGenerated extends AbstractFirBytecodeTextTest { } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/lazyCodegen") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class LazyCodegen extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class LazyCodegen extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInLazyCodegen() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/lazyCodegen"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("inlineConstInsideComparison.kt") public void testInlineConstInsideComparison() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lazyCodegen/inlineConstInsideComparison.kt"); } + @Test @TestMetadata("negateConst.kt") public void testNegateConst() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lazyCodegen/negateConst.kt"); } + @Test @TestMetadata("negateConstantCompare.kt") public void testNegateConstantCompare() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lazyCodegen/negateConstantCompare.kt"); } + @Test @TestMetadata("negateObjectComp.kt") public void testNegateObjectComp() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lazyCodegen/negateObjectComp.kt"); } + @Test @TestMetadata("negateObjectCompChaing.kt") public void testNegateObjectCompChaing() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lazyCodegen/negateObjectCompChaing.kt"); } + @Test @TestMetadata("negateVar.kt") public void testNegateVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lazyCodegen/negateVar.kt"); } + @Test @TestMetadata("negateVarChain.kt") public void testNegateVarChain() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lazyCodegen/negateVarChain.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/lineNumbers") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class LineNumbers extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class LineNumbers extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInLineNumbers() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/lineNumbers"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("ifConsts.kt") public void testIfConsts() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lineNumbers/ifConsts.kt"); } + @Test @TestMetadata("ifElse.kt") public void testIfElse() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lineNumbers/ifElse.kt"); } + @Test @TestMetadata("ifFalse.kt") public void testIfFalse() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lineNumbers/ifFalse.kt"); } + @Test @TestMetadata("ifFalseElse.kt") public void testIfFalseElse() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lineNumbers/ifFalseElse.kt"); } + @Test @TestMetadata("ifTrue.kt") public void testIfTrue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lineNumbers/ifTrue.kt"); } + @Test @TestMetadata("ifTrueElse.kt") public void testIfTrueElse() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lineNumbers/ifTrueElse.kt"); } + @Test @TestMetadata("inlineCondition.kt") public void testInlineCondition() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lineNumbers/inlineCondition.kt"); } + @Test @TestMetadata("inlineCondition2.kt") public void testInlineCondition2() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lineNumbers/inlineCondition2.kt"); } + @Test @TestMetadata("inlineLambdaObjectInit.kt") public void testInlineLambdaObjectInit() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lineNumbers/inlineLambdaObjectInit.kt"); } + @Test @TestMetadata("singleThen.kt") public void testSingleThen() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lineNumbers/singleThen.kt"); } + @Test @TestMetadata("tryCatch.kt") public void testTryCatch() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lineNumbers/tryCatch.kt"); } + @Test @TestMetadata("when.kt") public void testWhen() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lineNumbers/when.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/localInitializationLVT") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class LocalInitializationLVT extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class LocalInitializationLVT extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInLocalInitializationLVT() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/localInitializationLVT"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("boxing.kt") public void testBoxing() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/boxing.kt"); } + @Test @TestMetadata("boxingVar.kt") public void testBoxingVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/boxingVar.kt"); } + @Test @TestMetadata("contract.kt") public void testContract() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/contract.kt"); } + @Test @TestMetadata("contractVar.kt") public void testContractVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/contractVar.kt"); } + @Test @TestMetadata("generics.kt") public void testGenerics() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/generics.kt"); } + @Test @TestMetadata("genericsVar.kt") public void testGenericsVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/genericsVar.kt"); } + @Test @TestMetadata("ifStatement.kt") public void testIfStatement() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/ifStatement.kt"); } + @Test @TestMetadata("ifStatementVar.kt") public void testIfStatementVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/ifStatementVar.kt"); } + @Test @TestMetadata("ifStatementWithoutBlock.kt") public void testIfStatementWithoutBlock() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/ifStatementWithoutBlock.kt"); } + @Test @TestMetadata("ifStatementWithoutBlockVar.kt") public void testIfStatementWithoutBlockVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/ifStatementWithoutBlockVar.kt"); } + @Test @TestMetadata("inlineClass.kt") public void testInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/inlineClass.kt"); } + @Test @TestMetadata("inlineClassVar.kt") public void testInlineClassVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/inlineClassVar.kt"); } + @Test @TestMetadata("lateinit.kt") public void testLateinit() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/lateinit.kt"); } + @Test @TestMetadata("run.kt") public void testRun() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/run.kt"); } + @Test @TestMetadata("runVar.kt") public void testRunVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/runVar.kt"); } + @Test @TestMetadata("singleBlock.kt") public void testSingleBlock() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/singleBlock.kt"); } + @Test @TestMetadata("singleBlockVar.kt") public void testSingleBlockVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/singleBlockVar.kt"); } + @Test @TestMetadata("whenStatement.kt") public void testWhenStatement() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/whenStatement.kt"); } + @Test @TestMetadata("whenStatementVar.kt") public void testWhenStatementVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/whenStatementVar.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/mangling") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Mangling extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class Mangling extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInMangling() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/mangling"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("parentheses.kt") public void testParentheses() throws Exception { runTest("compiler/testData/codegen/bytecodeText/mangling/parentheses.kt"); } + @Test @TestMetadata("parenthesesNoSanitize.kt") public void testParenthesesNoSanitize() throws Exception { runTest("compiler/testData/codegen/bytecodeText/mangling/parenthesesNoSanitize.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/multifileClasses") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class MultifileClasses extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class MultifileClasses extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInMultifileClasses() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/multifileClasses"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("defaultFunctionInMultifileClass.kt") public void testDefaultFunctionInMultifileClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/multifileClasses/defaultFunctionInMultifileClass.kt"); } + @Test @TestMetadata("optimizedMultifileClassFacadeMethods.kt") public void testOptimizedMultifileClassFacadeMethods() throws Exception { runTest("compiler/testData/codegen/bytecodeText/multifileClasses/optimizedMultifileClassFacadeMethods.kt"); } + @Test @TestMetadata("privateFunctionName.kt") public void testPrivateFunctionName() throws Exception { runTest("compiler/testData/codegen/bytecodeText/multifileClasses/privateFunctionName.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/notNullAssertions") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class NotNullAssertions extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class NotNullAssertions extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInNotNullAssertions() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/notNullAssertions"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("arrayListGet.kt") public void testArrayListGet() throws Exception { runTest("compiler/testData/codegen/bytecodeText/notNullAssertions/arrayListGet.kt"); } + @Test @TestMetadata("assertionForNotNullCaptured.kt") public void testAssertionForNotNullCaptured() throws Exception { runTest("compiler/testData/codegen/bytecodeText/notNullAssertions/assertionForNotNullCaptured.kt"); } + @Test @TestMetadata("assertionForNotNullTypeParam.kt") public void testAssertionForNotNullTypeParam() throws Exception { runTest("compiler/testData/codegen/bytecodeText/notNullAssertions/assertionForNotNullTypeParam.kt"); } + @Test @TestMetadata("assertionForNotNullTypeParam_1_4.kt") public void testAssertionForNotNullTypeParam_1_4() throws Exception { runTest("compiler/testData/codegen/bytecodeText/notNullAssertions/assertionForNotNullTypeParam_1_4.kt"); } + @Test @TestMetadata("doNotGenerateParamAssertions.kt") public void testDoNotGenerateParamAssertions() throws Exception { runTest("compiler/testData/codegen/bytecodeText/notNullAssertions/doNotGenerateParamAssertions.kt"); } + @Test @TestMetadata("javaMultipleSubstitutions.kt") public void testJavaMultipleSubstitutions() throws Exception { runTest("compiler/testData/codegen/bytecodeText/notNullAssertions/javaMultipleSubstitutions.kt"); } + @Test @TestMetadata("noAssertionForNullableCaptured.kt") public void testNoAssertionForNullableCaptured() throws Exception { runTest("compiler/testData/codegen/bytecodeText/notNullAssertions/noAssertionForNullableCaptured.kt"); } + @Test @TestMetadata("noAssertionForNullableGenericMethod.kt") public void testNoAssertionForNullableGenericMethod() throws Exception { runTest("compiler/testData/codegen/bytecodeText/notNullAssertions/noAssertionForNullableGenericMethod.kt"); } + @Test @TestMetadata("noAssertionForNullableGenericMethodCall.kt") public void testNoAssertionForNullableGenericMethodCall() throws Exception { runTest("compiler/testData/codegen/bytecodeText/notNullAssertions/noAssertionForNullableGenericMethodCall.kt"); } + @Test @TestMetadata("noAssertionForPrivateMethod.kt") public void testNoAssertionForPrivateMethod() throws Exception { runTest("compiler/testData/codegen/bytecodeText/notNullAssertions/noAssertionForPrivateMethod.kt"); } + @Test @TestMetadata("noAssertionsForKotlin.kt") public void testNoAssertionsForKotlin() throws Exception { runTest("compiler/testData/codegen/bytecodeText/notNullAssertions/noAssertionsForKotlin.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/nullCheckOptimization") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class NullCheckOptimization extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class NullCheckOptimization extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInNullCheckOptimization() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/nullCheckOptimization"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("alreadyCheckedForIs.kt") public void testAlreadyCheckedForIs() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/alreadyCheckedForIs.kt"); } + @Test @TestMetadata("alreadyCheckedForNull.kt") public void testAlreadyCheckedForNull() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/alreadyCheckedForNull.kt"); } + @Test @TestMetadata("deterministicNotNullChecks.kt") public void testDeterministicNotNullChecks() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/deterministicNotNullChecks.kt"); } + @Test @TestMetadata("expressionValueIsNotNull.kt") public void testExpressionValueIsNotNull() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/expressionValueIsNotNull.kt"); } + @Test @TestMetadata("expressionValueIsNotNullAfterExclExcl.kt") public void testExpressionValueIsNotNullAfterExclExcl() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/expressionValueIsNotNullAfterExclExcl.kt"); } + @Test @TestMetadata("expressionValueIsNotNullTwice.kt") public void testExpressionValueIsNotNullTwice() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/expressionValueIsNotNullTwice.kt"); } + @Test @TestMetadata("ifNullEqualsNull.kt") public void testIfNullEqualsNull() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/ifNullEqualsNull.kt"); } + @Test @TestMetadata("ifNullEqualsNullInline.kt") public void testIfNullEqualsNullInline() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/ifNullEqualsNullInline.kt"); } + @Test @TestMetadata("ifUnitEqualsNull.kt") public void testIfUnitEqualsNull() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/ifUnitEqualsNull.kt"); } + @Test @TestMetadata("ifUnitEqualsNullInline.kt") public void testIfUnitEqualsNullInline() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/ifUnitEqualsNullInline.kt"); } + @Test @TestMetadata("kt12839.kt") public void testKt12839() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/kt12839.kt"); } + @Test @TestMetadata("multipleExclExcl_1_4.kt") public void testMultipleExclExcl_1_4() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/multipleExclExcl_1_4.kt"); } + @Test @TestMetadata("notNullAsNotNullable.kt") public void testNotNullAsNotNullable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/notNullAsNotNullable.kt"); } + @Test @TestMetadata("notNullExpressionValueTwice_1_4.kt") public void testNotNullExpressionValueTwice_1_4() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/notNullExpressionValueTwice_1_4.kt"); } + @Test @TestMetadata("nullCheckAfterExclExcl_1_4.kt") public void testNullCheckAfterExclExcl_1_4() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/nullCheckAfterExclExcl_1_4.kt"); } + @Test @TestMetadata("nullabilityAssertionOnDispatchReceiver.kt") public void testNullabilityAssertionOnDispatchReceiver() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/nullabilityAssertionOnDispatchReceiver.kt"); } + @Test @TestMetadata("primitiveCheck.kt") public void testPrimitiveCheck() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/primitiveCheck.kt"); } + @Test @TestMetadata("redundantSafeCall.kt") public void testRedundantSafeCall() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/redundantSafeCall.kt"); } + @Test @TestMetadata("redundantSafeCall_1_4.kt") public void testRedundantSafeCall_1_4() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/redundantSafeCall_1_4.kt"); } + @Test @TestMetadata("reifiedIs.kt") public void testReifiedIs() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/reifiedIs.kt"); } + @Test @TestMetadata("reifiedNullIs.kt") public void testReifiedNullIs() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/reifiedNullIs.kt"); } + @Test @TestMetadata("trivialInstanceOf.kt") public void testTrivialInstanceOf() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/trivialInstanceOf.kt"); } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/nullCheckOptimization/localLateinit") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class LocalLateinit extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class LocalLateinit extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInLocalLateinit() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/nullCheckOptimization/localLateinit"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("checkedAlways.kt") public void testCheckedAlways() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/localLateinit/checkedAlways.kt"); } + @Test @TestMetadata("checkedOnce.kt") public void testCheckedOnce() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/localLateinit/checkedOnce.kt"); } + @Test @TestMetadata("initialized.kt") public void testInitialized() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/localLateinit/initialized.kt"); @@ -4145,126 +4599,129 @@ public class FirBytecodeTextTestGenerated extends AbstractFirBytecodeTextTest { } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/optimizedDelegatedProperties") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class OptimizedDelegatedProperties extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class OptimizedDelegatedProperties extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInOptimizedDelegatedProperties() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/optimizedDelegatedProperties"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("definedInSources.kt") public void testDefinedInSources() throws Exception { runTest("compiler/testData/codegen/bytecodeText/optimizedDelegatedProperties/definedInSources.kt"); } + @Test @TestMetadata("inSeparateModule.kt") public void testInSeparateModule() throws Exception { runTest("compiler/testData/codegen/bytecodeText/optimizedDelegatedProperties/inSeparateModule.kt"); } + @Test @TestMetadata("lazy.kt") public void testLazy() throws Exception { runTest("compiler/testData/codegen/bytecodeText/optimizedDelegatedProperties/lazy.kt"); } + @Test @TestMetadata("withNonNullMetadataParameter.kt") public void testWithNonNullMetadataParameter() throws Exception { runTest("compiler/testData/codegen/bytecodeText/optimizedDelegatedProperties/withNonNullMetadataParameter.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/parameterlessMain") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ParameterlessMain extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class ParameterlessMain extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInParameterlessMain() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/parameterlessMain"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("dontGenerateOnExtensionReceiver.kt") public void testDontGenerateOnExtensionReceiver() throws Exception { runTest("compiler/testData/codegen/bytecodeText/parameterlessMain/dontGenerateOnExtensionReceiver.kt"); } + @Test @TestMetadata("dontGenerateOnJvmNameMain.kt") public void testDontGenerateOnJvmNameMain() throws Exception { runTest("compiler/testData/codegen/bytecodeText/parameterlessMain/dontGenerateOnJvmNameMain.kt"); } + @Test @TestMetadata("dontGenerateOnJvmOverloads.kt") public void testDontGenerateOnJvmOverloads() throws Exception { runTest("compiler/testData/codegen/bytecodeText/parameterlessMain/dontGenerateOnJvmOverloads.kt"); } + @Test @TestMetadata("dontGenerateOnMain.kt") public void testDontGenerateOnMain() throws Exception { runTest("compiler/testData/codegen/bytecodeText/parameterlessMain/dontGenerateOnMain.kt"); } + @Test @TestMetadata("dontGenerateOnMainExtension.kt") public void testDontGenerateOnMainExtension() throws Exception { runTest("compiler/testData/codegen/bytecodeText/parameterlessMain/dontGenerateOnMainExtension.kt"); } + @Test @TestMetadata("dontGenerateOnNullableArray.kt") public void testDontGenerateOnNullableArray() throws Exception { runTest("compiler/testData/codegen/bytecodeText/parameterlessMain/dontGenerateOnNullableArray.kt"); } + @Test @TestMetadata("dontGenerateOnVarargsString.kt") public void testDontGenerateOnVarargsString() throws Exception { runTest("compiler/testData/codegen/bytecodeText/parameterlessMain/dontGenerateOnVarargsString.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/properties") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Properties extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class Properties extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInProperties() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/properties"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("dataClass.kt") public void testDataClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/properties/dataClass.kt"); } + @Test @TestMetadata("openDataClass.kt") public void testOpenDataClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/properties/openDataClass.kt"); } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/properties/lateinit") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Lateinit extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class Lateinit extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInLateinit() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/properties/lateinit"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("companionObject.kt") public void testCompanionObject() throws Exception { runTest("compiler/testData/codegen/bytecodeText/properties/lateinit/companionObject.kt"); } + @Test @TestMetadata("companionObjectFromLambda.kt") public void testCompanionObjectFromLambda() throws Exception { runTest("compiler/testData/codegen/bytecodeText/properties/lateinit/companionObjectFromLambda.kt"); @@ -4272,791 +4729,882 @@ public class FirBytecodeTextTestGenerated extends AbstractFirBytecodeTextTest { } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/ranges") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Ranges extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class Ranges extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInRanges() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/ranges"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("ifNotInRange.kt") public void testIfNotInRange() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ranges/ifNotInRange.kt"); } + @Test @TestMetadata("inArrayIndices.kt") public void testInArrayIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ranges/inArrayIndices.kt"); } + @Test @TestMetadata("inCharSequenceIndices.kt") public void testInCharSequenceIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ranges/inCharSequenceIndices.kt"); } + @Test @TestMetadata("inCollectionIndices.kt") public void testInCollectionIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ranges/inCollectionIndices.kt"); } + @Test @TestMetadata("inComparableRangeLiteral.kt") public void testInComparableRangeLiteral() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ranges/inComparableRangeLiteral.kt"); } + @Test @TestMetadata("inMixedUnsignedRange.kt") public void testInMixedUnsignedRange() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ranges/inMixedUnsignedRange.kt"); } + @Test @TestMetadata("inMixedUnsignedRange_2.kt") public void testInMixedUnsignedRange_2() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ranges/inMixedUnsignedRange_2.kt"); } + @Test @TestMetadata("inNonMatchingRangeIntrinsified.kt") public void testInNonMatchingRangeIntrinsified() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ranges/inNonMatchingRangeIntrinsified.kt"); } + @Test @TestMetadata("inOptimizableRange.kt") public void testInOptimizableRange() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ranges/inOptimizableRange.kt"); } + @Test @TestMetadata("inOptimizableUnsignedRange.kt") public void testInOptimizableUnsignedRange() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ranges/inOptimizableUnsignedRange.kt"); } + @Test @TestMetadata("inUntil.kt") public void testInUntil() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ranges/inUntil.kt"); } + @Test @TestMetadata("noDupXForLiteralRangeContains.kt") public void testNoDupXForLiteralRangeContains() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ranges/noDupXForLiteralRangeContains.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/sam") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Sam extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class Sam extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInSam() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/sam"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("samWrapperForNullInitialization.kt") public void testSamWrapperForNullInitialization() throws Exception { runTest("compiler/testData/codegen/bytecodeText/sam/samWrapperForNullInitialization.kt"); } + @Test @TestMetadata("samWrapperForNullableInitialization.kt") public void testSamWrapperForNullableInitialization() throws Exception { runTest("compiler/testData/codegen/bytecodeText/sam/samWrapperForNullableInitialization.kt"); } + @Test @TestMetadata("samWrapperInInlineLambda.kt") public void testSamWrapperInInlineLambda() throws Exception { runTest("compiler/testData/codegen/bytecodeText/sam/samWrapperInInlineLambda.kt"); } + @Test @TestMetadata("samWrapperOfLambda.kt") public void testSamWrapperOfLambda() throws Exception { runTest("compiler/testData/codegen/bytecodeText/sam/samWrapperOfLambda.kt"); } + @Test @TestMetadata("samWrapperOfReference.kt") public void testSamWrapperOfReference() throws Exception { runTest("compiler/testData/codegen/bytecodeText/sam/samWrapperOfReference.kt"); } + @Test @TestMetadata("samWrapperRawTypes.kt") public void testSamWrapperRawTypes() throws Exception { runTest("compiler/testData/codegen/bytecodeText/sam/samWrapperRawTypes.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/statements") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Statements extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class Statements extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInStatements() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/statements"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("ifSingleBranch.kt") public void testIfSingleBranch() throws Exception { runTest("compiler/testData/codegen/bytecodeText/statements/ifSingleBranch.kt"); } + @Test @TestMetadata("ifThenElse.kt") public void testIfThenElse() throws Exception { runTest("compiler/testData/codegen/bytecodeText/statements/ifThenElse.kt"); } + @Test @TestMetadata("ifThenElseEmpty.kt") public void testIfThenElseEmpty() throws Exception { runTest("compiler/testData/codegen/bytecodeText/statements/ifThenElseEmpty.kt"); } + @Test @TestMetadata("labeled.kt") public void testLabeled() throws Exception { runTest("compiler/testData/codegen/bytecodeText/statements/labeled.kt"); } + @Test @TestMetadata("statementsComposition.kt") public void testStatementsComposition() throws Exception { runTest("compiler/testData/codegen/bytecodeText/statements/statementsComposition.kt"); } + @Test @TestMetadata("tryCatchFinally.kt") public void testTryCatchFinally() throws Exception { runTest("compiler/testData/codegen/bytecodeText/statements/tryCatchFinally.kt"); } + @Test @TestMetadata("when.kt") public void testWhen() throws Exception { runTest("compiler/testData/codegen/bytecodeText/statements/when.kt"); } + @Test @TestMetadata("whenSubject.kt") public void testWhenSubject() throws Exception { runTest("compiler/testData/codegen/bytecodeText/statements/whenSubject.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/staticFields") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class StaticFields extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class StaticFields extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInStaticFields() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/staticFields"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("classObject.kt") public void testClassObject() throws Exception { runTest("compiler/testData/codegen/bytecodeText/staticFields/classObject.kt"); } + @Test @TestMetadata("object.kt") public void testObject() throws Exception { runTest("compiler/testData/codegen/bytecodeText/staticFields/object.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/storeStackBeforeInline") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class StoreStackBeforeInline extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class StoreStackBeforeInline extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInStoreStackBeforeInline() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/storeStackBeforeInline"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("differentTypes.kt") public void testDifferentTypes() throws Exception { runTest("compiler/testData/codegen/bytecodeText/storeStackBeforeInline/differentTypes.kt"); } + @Test @TestMetadata("primitiveMerge.kt") public void testPrimitiveMerge() throws Exception { runTest("compiler/testData/codegen/bytecodeText/storeStackBeforeInline/primitiveMerge.kt"); } + @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { runTest("compiler/testData/codegen/bytecodeText/storeStackBeforeInline/simple.kt"); } + @Test @TestMetadata("unreachableMarker.kt") public void testUnreachableMarker() throws Exception { runTest("compiler/testData/codegen/bytecodeText/storeStackBeforeInline/unreachableMarker.kt"); } + @Test @TestMetadata("withLambda.kt") public void testWithLambda() throws Exception { runTest("compiler/testData/codegen/bytecodeText/storeStackBeforeInline/withLambda.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/stringOperations") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class StringOperations extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class StringOperations extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInStringOperations() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/stringOperations"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("concat.kt") public void testConcat() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/concat.kt"); } + @Test @TestMetadata("concatDynamic.kt") public void testConcatDynamic() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/concatDynamic.kt"); } + @Test @TestMetadata("concatDynamic200.kt") public void testConcatDynamic200() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/concatDynamic200.kt"); } + @Test @TestMetadata("concatDynamic201.kt") public void testConcatDynamic201() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/concatDynamic201.kt"); } + @Test @TestMetadata("concatDynamicConstants.kt") public void testConcatDynamicConstants() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/concatDynamicConstants.kt"); } + @Test @TestMetadata("concatDynamicDataClass.kt") public void testConcatDynamicDataClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/concatDynamicDataClass.kt"); } + @Test @TestMetadata("concatDynamicIndy.kt") public void testConcatDynamicIndy() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/concatDynamicIndy.kt"); } + @Test @TestMetadata("concatDynamicIndy201.kt") public void testConcatDynamicIndy201() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/concatDynamicIndy201.kt"); } + @Test @TestMetadata("concatDynamicIndyDataClass.kt") public void testConcatDynamicIndyDataClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/concatDynamicIndyDataClass.kt"); } + @Test @TestMetadata("concatNotDynamic.kt") public void testConcatNotDynamic() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/concatNotDynamic.kt"); } + @Test @TestMetadata("constConcat.kt") public void testConstConcat() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/constConcat.kt"); } + @Test @TestMetadata("constValConcat.kt") public void testConstValConcat() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/constValConcat.kt"); } + @Test @TestMetadata("doNotAppendEmptyString.kt") public void testDoNotAppendEmptyString() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/doNotAppendEmptyString.kt"); } + @Test @TestMetadata("interpolation.kt") public void testInterpolation() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/interpolation.kt"); } + @Test @TestMetadata("kt15235.kt") public void testKt15235() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/kt15235.kt"); } + @Test @TestMetadata("kt19037.kt") public void testKt19037() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/kt19037.kt"); } + @Test @TestMetadata("kt42457_old.kt") public void testKt42457_old() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/kt42457_old.kt"); } + @Test @TestMetadata("multipleNestedConcat.kt") public void testMultipleNestedConcat() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/multipleNestedConcat.kt"); } + @Test @TestMetadata("nestedConcat.kt") public void testNestedConcat() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/nestedConcat.kt"); } + @Test @TestMetadata("nonNullableStringPlus.kt") public void testNonNullableStringPlus() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/nonNullableStringPlus.kt"); } + @Test @TestMetadata("nullableStringPlus.kt") public void testNullableStringPlus() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/nullableStringPlus.kt"); } + @Test @TestMetadata("partiallyConstConcat.kt") public void testPartiallyConstConcat() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/partiallyConstConcat.kt"); } + @Test @TestMetadata("plusAssign.kt") public void testPlusAssign() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/plusAssign.kt"); } + @Test @TestMetadata("primitiveToString.kt") public void testPrimitiveToString() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/primitiveToString.kt"); } + @Test @TestMetadata("primitiveToStringNotOptimizable.kt") public void testPrimitiveToStringNotOptimizable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/primitiveToStringNotOptimizable.kt"); } + @Test @TestMetadata("primitivesAsStringTemplates.kt") public void testPrimitivesAsStringTemplates() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/primitivesAsStringTemplates.kt"); } + @Test @TestMetadata("singleConcat.kt") public void testSingleConcat() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/singleConcat.kt"); } + @Test @TestMetadata("stringBuilderToString.kt") public void testStringBuilderToString() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/stringBuilderToString.kt"); } + @Test @TestMetadata("stringPlus.kt") public void testStringPlus() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/stringPlus.kt"); } + @Test @TestMetadata("useAppendCharForOneCharStringInTemplate.kt") public void testUseAppendCharForOneCharStringInTemplate() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/useAppendCharForOneCharStringInTemplate.kt"); } + @Test @TestMetadata("useAppendCharForOneCharStringInTemplate_2.kt") public void testUseAppendCharForOneCharStringInTemplate_2() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/useAppendCharForOneCharStringInTemplate_2.kt"); } + @Test @TestMetadata("useAppendCharForOneCharStringUsingPlus.kt") public void testUseAppendCharForOneCharStringUsingPlus() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/useAppendCharForOneCharStringUsingPlus.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/toArray") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ToArray extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class ToArray extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInToArray() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/toArray"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("noAccessorForToArray.kt") public void testNoAccessorForToArray() throws Exception { runTest("compiler/testData/codegen/bytecodeText/toArray/noAccessorForToArray.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/unsignedTypes") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class UnsignedTypes extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class UnsignedTypes extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInUnsignedTypes() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/unsignedTypes"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("unsignedIntCompare_before.kt") public void testUnsignedIntCompare_before() throws Exception { runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntCompare_before.kt"); } + @Test @TestMetadata("unsignedIntCompare_jvm18.kt") public void testUnsignedIntCompare_jvm18() throws Exception { runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntCompare_jvm18.kt"); } + @Test @TestMetadata("unsignedIntDivide_jvm18.kt") public void testUnsignedIntDivide_jvm18() throws Exception { runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntDivide_jvm18.kt"); } + @Test @TestMetadata("unsignedIntRemainder_jvm18.kt") public void testUnsignedIntRemainder_jvm18() throws Exception { runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntRemainder_jvm18.kt"); } + @Test @TestMetadata("unsignedIntSmartCasts_jvm18.kt") public void testUnsignedIntSmartCasts_jvm18() throws Exception { runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntSmartCasts_jvm18.kt"); } + @Test @TestMetadata("unsignedIntToString_jvm18.kt") public void testUnsignedIntToString_jvm18() throws Exception { runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntToString_jvm18.kt"); } + @Test @TestMetadata("unsignedLongCompare_jvm18.kt") public void testUnsignedLongCompare_jvm18() throws Exception { runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedLongCompare_jvm18.kt"); } + @Test @TestMetadata("unsignedLongDivide_jvm18.kt") public void testUnsignedLongDivide_jvm18() throws Exception { runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedLongDivide_jvm18.kt"); } + @Test @TestMetadata("unsignedLongRemainder_jvm18.kt") public void testUnsignedLongRemainder_jvm18() throws Exception { runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedLongRemainder_jvm18.kt"); } + @Test @TestMetadata("unsignedLongToString_jvm18.kt") public void testUnsignedLongToString_jvm18() throws Exception { runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedLongToString_jvm18.kt"); } + @Test @TestMetadata("whenByUnsigned.kt") public void testWhenByUnsigned() throws Exception { runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/whenByUnsigned.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/varargs") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Varargs extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class Varargs extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInVarargs() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/varargs"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("doNotCopyImmediatelyCreatedArrays.kt") public void testDoNotCopyImmediatelyCreatedArrays() throws Exception { runTest("compiler/testData/codegen/bytecodeText/varargs/doNotCopyImmediatelyCreatedArrays.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/when") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class When extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class When extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInWhen() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/when"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("edgeCases.kt") public void testEdgeCases() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/edgeCases.kt"); } + @Test @TestMetadata("exhaustiveWhenInitialization.kt") public void testExhaustiveWhenInitialization() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/exhaustiveWhenInitialization.kt"); } + @Test @TestMetadata("exhaustiveWhenReturn.kt") public void testExhaustiveWhenReturn() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/exhaustiveWhenReturn.kt"); } + @Test @TestMetadata("exhaustiveWhenSpecialCases.kt") public void testExhaustiveWhenSpecialCases() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/exhaustiveWhenSpecialCases.kt"); } + @Test @TestMetadata("exhaustiveWhenUnit.kt") public void testExhaustiveWhenUnit() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/exhaustiveWhenUnit.kt"); } + @Test @TestMetadata("exhaustiveWhenUnitStatement.kt") public void testExhaustiveWhenUnitStatement() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/exhaustiveWhenUnitStatement.kt"); } + @Test @TestMetadata("inlineConstValsInsideWhen.kt") public void testInlineConstValsInsideWhen() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/inlineConstValsInsideWhen.kt"); } + @Test @TestMetadata("integralWhenWithNoInlinedConstants.kt") public void testIntegralWhenWithNoInlinedConstants() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/integralWhenWithNoInlinedConstants.kt"); } + @Test @TestMetadata("kt18818.kt") public void testKt18818() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/kt18818.kt"); } + @Test @TestMetadata("lookupSwitch.kt") public void testLookupSwitch() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/lookupSwitch.kt"); } + @Test @TestMetadata("lookupSwitchWithSubjectVal.kt") public void testLookupSwitchWithSubjectVal() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/lookupSwitchWithSubjectVal.kt"); } + @Test @TestMetadata("noBoxingInDefaultWhenWithSpecialCases.kt") public void testNoBoxingInDefaultWhenWithSpecialCases() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/noBoxingInDefaultWhenWithSpecialCases.kt"); } + @Test @TestMetadata("qualifiedConstValsInsideWhen.kt") public void testQualifiedConstValsInsideWhen() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/qualifiedConstValsInsideWhen.kt"); } + @Test @TestMetadata("sealedWhenInitialization.kt") public void testSealedWhenInitialization() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/sealedWhenInitialization.kt"); } + @Test @TestMetadata("simpleConstValsInsideWhen.kt") public void testSimpleConstValsInsideWhen() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/simpleConstValsInsideWhen.kt"); } + @Test @TestMetadata("stringSwitchWithSubjectVal.kt") public void testStringSwitchWithSubjectVal() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/stringSwitchWithSubjectVal.kt"); } + @Test @TestMetadata("subjectValHasLocalVariableSlot.kt") public void testSubjectValHasLocalVariableSlot() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/subjectValHasLocalVariableSlot.kt"); } + @Test @TestMetadata("subjectValInEnumWhenHasLocalVariableSlot.kt") public void testSubjectValInEnumWhenHasLocalVariableSlot() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/subjectValInEnumWhenHasLocalVariableSlot.kt"); } + @Test @TestMetadata("subjectValInIntWhenHasLocalVariableSlot.kt") public void testSubjectValInIntWhenHasLocalVariableSlot() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/subjectValInIntWhenHasLocalVariableSlot.kt"); } + @Test @TestMetadata("subjectValInStringWhenHasLocalVariableSlot.kt") public void testSubjectValInStringWhenHasLocalVariableSlot() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/subjectValInStringWhenHasLocalVariableSlot.kt"); } + @Test @TestMetadata("switchOptimizationDuplicates.kt") public void testSwitchOptimizationDuplicates() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/switchOptimizationDuplicates.kt"); } + @Test @TestMetadata("tableSwitch.kt") public void testTableSwitch() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/tableSwitch.kt"); } + @Test @TestMetadata("tableSwitchWithSubjectVal.kt") public void testTableSwitchWithSubjectVal() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/tableSwitchWithSubjectVal.kt"); } + @Test @TestMetadata("whenNull.kt") public void testWhenNull() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/whenNull.kt"); } + @Test @TestMetadata("whenZero.kt") public void testWhenZero() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/whenZero.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/whenEnumOptimization") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class WhenEnumOptimization extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class WhenEnumOptimization extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInWhenEnumOptimization() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/whenEnumOptimization"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("bigEnum.kt") public void testBigEnum() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/bigEnum.kt"); } + @Test @TestMetadata("differentEnumClasses.kt") public void testDifferentEnumClasses() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/differentEnumClasses.kt"); } + @Test @TestMetadata("differentEnumClasses2.kt") public void testDifferentEnumClasses2() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/differentEnumClasses2.kt"); } + @Test @TestMetadata("duplicatingItems.kt") public void testDuplicatingItems() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/duplicatingItems.kt"); } + @Test @TestMetadata("expression.kt") public void testExpression() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/expression.kt"); } + @Test @TestMetadata("functionLiteralInTopLevel.kt") public void testFunctionLiteralInTopLevel() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/functionLiteralInTopLevel.kt"); } + @Test @TestMetadata("importedEnumEntry.kt") public void testImportedEnumEntry() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/importedEnumEntry.kt"); } + @Test @TestMetadata("kt14597_full.kt") public void testKt14597_full() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/kt14597_full.kt"); } + @Test @TestMetadata("kt14802.kt") public void testKt14802() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/kt14802.kt"); } + @Test @TestMetadata("manyWhensWithinClass.kt") public void testManyWhensWithinClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/manyWhensWithinClass.kt"); } + @Test @TestMetadata("nonConstantEnum.kt") public void testNonConstantEnum() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/nonConstantEnum.kt"); } + @Test @TestMetadata("nullability.kt") public void testNullability() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/nullability.kt"); } + @Test @TestMetadata("subjectAny.kt") public void testSubjectAny() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/subjectAny.kt"); } + @Test @TestMetadata("withoutElse.kt") public void testWithoutElse() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/withoutElse.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/whenStringOptimization") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class WhenStringOptimization extends AbstractFirBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: "); - } - + public class WhenStringOptimization extends AbstractFirBytecodeTextTest { + @Test public void testAllFilesPresentInWhenStringOptimization() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/whenStringOptimization"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("denseHashCode.kt") public void testDenseHashCode() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenStringOptimization/denseHashCode.kt"); } + @Test @TestMetadata("duplicatingItems.kt") public void testDuplicatingItems() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenStringOptimization/duplicatingItems.kt"); } + @Test @TestMetadata("duplicatingItemsSameHashCodeFewBranches.kt") public void testDuplicatingItemsSameHashCodeFewBranches() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenStringOptimization/duplicatingItemsSameHashCodeFewBranches.kt"); } + @Test @TestMetadata("duplicatingItemsSameHashCodeMoreBranches.kt") public void testDuplicatingItemsSameHashCodeMoreBranches() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenStringOptimization/duplicatingItemsSameHashCodeMoreBranches.kt"); } + @Test @TestMetadata("expression.kt") public void testExpression() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenStringOptimization/expression.kt"); } + @Test @TestMetadata("inlineStringConstInsideWhen.kt") public void testInlineStringConstInsideWhen() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenStringOptimization/inlineStringConstInsideWhen.kt"); } + @Test @TestMetadata("nonInlinedConst.kt") public void testNonInlinedConst() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenStringOptimization/nonInlinedConst.kt"); } + @Test @TestMetadata("nullability.kt") public void testNullability() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenStringOptimization/nullability.kt"); } + @Test @TestMetadata("sameHashCode.kt") public void testSameHashCode() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenStringOptimization/sameHashCode.kt"); } + @Test @TestMetadata("statement.kt") public void testStatement() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenStringOptimization/statement.kt"); diff --git a/compiler/test-infrastructure-utils/tests/org/jetbrains/kotlin/codegen/BytecodeTextUtils.kt b/compiler/test-infrastructure-utils/tests/org/jetbrains/kotlin/codegen/BytecodeTextUtils.kt new file mode 100644 index 00000000000..cd4cd783711 --- /dev/null +++ b/compiler/test-infrastructure-utils/tests/org/jetbrains/kotlin/codegen/BytecodeTextUtils.kt @@ -0,0 +1,144 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.codegen + +import com.intellij.openapi.util.text.StringUtil +import org.jetbrains.kotlin.test.Assertions +import org.jetbrains.kotlin.test.TargetBackend +import java.io.File +import java.util.ArrayList +import java.util.regex.Matcher +import java.util.regex.Pattern + +private val AT_OUTPUT_FILE_PATTERN = Pattern.compile("^\\s*//\\s*@(.*):$") +private val EXPECTED_OCCURRENCES_PATTERN = Pattern.compile("^\\s*//\\s*(\\d+)\\s*(.*)$") +private const val JVM_TEMPLATES = "// JVM_TEMPLATES" +private const val JVM_IR_TEMPLATES = "// JVM_IR_TEMPLATES" + +class OccurrenceInfo constructor(private val numberOfOccurrences: Int, private val needle: String, val backend: TargetBackend) { + private val pattern = Pattern.compile("($needle)") + + fun getActualOccurrence(text: String): String { + val actualCount = StringUtil.findMatches(text, pattern).size + return "$actualCount $needle" + } + + override fun toString(): String { + return "$numberOfOccurrences $needle" + } +} + +fun readExpectedOccurrences(filename: String): List { + val lines = File(filename).readLines().dropLastWhile(String::isEmpty) + return readExpectedOccurrences(lines) +} + +fun readExpectedOccurrences(lines: List): List { + val result = ArrayList() + var backend = TargetBackend.ANY + for (line in lines) { + if (line.contains(JVM_TEMPLATES)) backend = TargetBackend.JVM + else if (line.contains(JVM_IR_TEMPLATES)) backend = TargetBackend.JVM_IR + + val matcher = EXPECTED_OCCURRENCES_PATTERN.matcher(line) + if (matcher.matches()) { + result.add(parseOccurrenceInfo(matcher, backend)) + } + } + + return result +} + +fun readExpectedOccurrencesForMultiFileTest( + fileName: String, + fileContent: String, + destination: MutableMap> +) { + var currentOccurrenceInfos: MutableList? = null + var backend = TargetBackend.ANY + for (line in fileContent.split("\n".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()) { + if (line.contains(JVM_TEMPLATES)) backend = TargetBackend.JVM + else if (line.contains(JVM_IR_TEMPLATES)) backend = TargetBackend.JVM_IR + + val atOutputFileMatcher = AT_OUTPUT_FILE_PATTERN.matcher(line) + if (atOutputFileMatcher.matches()) { + val outputFileName = atOutputFileMatcher.group(1) + if (destination.containsKey(outputFileName)) { + throw AssertionError("${fileName}: Expected occurrences for output file $outputFileName were already provided") + } + currentOccurrenceInfos = ArrayList() + destination[outputFileName] = currentOccurrenceInfos + } + + val expectedOccurrencesMatcher = EXPECTED_OCCURRENCES_PATTERN.matcher(line) + if (expectedOccurrencesMatcher.matches()) { + if (currentOccurrenceInfos == null) { + throw AssertionError("${fileName}: Should specify output file with '// @:' before expectations") + } + val occurrenceInfo = parseOccurrenceInfo(expectedOccurrencesMatcher, backend) + currentOccurrenceInfos.add(occurrenceInfo) + } + } +} + +private fun parseOccurrenceInfo(matcher: Matcher, backend: TargetBackend): OccurrenceInfo { + val numberOfOccurrences = Integer.parseInt(matcher.group(1)) + val needle = matcher.group(2) + return OccurrenceInfo(numberOfOccurrences, needle, backend) +} + +fun checkGeneratedTextAgainstExpectedOccurrences( + text: String, + expectedOccurrences: List, + currentBackend: TargetBackend, + reportProblems: Boolean, + assertions: Assertions +) { + val expected = StringBuilder() + val actual = StringBuilder() + var lastBackend = TargetBackend.ANY + for (info in expectedOccurrences) { + if (lastBackend != info.backend) { + when (info.backend) { + TargetBackend.JVM -> JVM_TEMPLATES + TargetBackend.JVM_IR -> JVM_IR_TEMPLATES + else -> error("Common part should be first one: ${expectedOccurrences.joinToString("\n")}") + }.also { + actual.append("\n$it\n") + expected.append("\n$it\n") + } + lastBackend = info.backend + } + + expected.append(info).append("\n") + if (info.backend == TargetBackend.ANY || info.backend == currentBackend) { + actual.append(info.getActualOccurrence(text)).append("\n") + } else { + actual.append(info).append("\n") + } + } + + try { + assertions.assertEquals(expected.toString(), actual.toString()) { text } + } catch (e: Throwable) { + if (reportProblems) { + println(text) + } + throw e + } +} + +fun assertTextWasGenerated(expectedOutputFile: String, generated: Map, assertions: Assertions) { + if (!generated.containsKey(expectedOutputFile)) { + val failMessage = StringBuilder() + failMessage.append("Missing output file ").append(expectedOutputFile).append(", got ").append(generated.size).append(": ") + for (generatedFile in generated.keys) { + failMessage.append(generatedFile).append(" ") + } + assertions.fail { failMessage.toString() } + } +} + diff --git a/compiler/testData/codegen/bytecodeText/coroutines/internalInlineSuspend.kt b/compiler/testData/codegen/bytecodeText/coroutines/internalInlineSuspend.kt index e29e5537329..46e5f0cdc3d 100644 --- a/compiler/testData/codegen/bytecodeText/coroutines/internalInlineSuspend.kt +++ b/compiler/testData/codegen/bytecodeText/coroutines/internalInlineSuspend.kt @@ -7,6 +7,6 @@ class A { } } -// 1 public final g\$test_module\(Lkotlin/coroutines/Continuation;\)Ljava/lang/Object; -// 1 private final g\$test_module\$\$forInline\(Lkotlin/coroutines/Continuation;\)Ljava/lang/Object; -// 0 g\$\$forInline \ No newline at end of file +// 1 public final g\$main\(Lkotlin/coroutines/Continuation;\)Ljava/lang/Object; +// 1 private final g\$main\$\$forInline\(Lkotlin/coroutines/Continuation;\)Ljava/lang/Object; +// 0 g\$\$forInline diff --git a/compiler/testData/codegen/bytecodeText/inlineJavaStaticFields.kt b/compiler/testData/codegen/bytecodeText/inlineJavaStaticFields.kt index f6ae773a90d..55f7e71f971 100644 --- a/compiler/testData/codegen/bytecodeText/inlineJavaStaticFields.kt +++ b/compiler/testData/codegen/bytecodeText/inlineJavaStaticFields.kt @@ -1,6 +1,7 @@ // FILE: JClass.java import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; public class JClass { public final static int PrimitiveInt = 9000; @@ -8,7 +9,7 @@ public class JClass { public final static long PrimitiveLong = 100000; public final static short PrimitiveShort = 901; public final static boolean PrimitiveBool = false; - public final static float PrimitiveFloat = 36.6; + public final static float PrimitiveFloat = 36.6f; public final static double PrimitiveDouble = 42.4242; public final static byte PrimitiveByte = -8; public final static char PrimitiveChar = 'K'; diff --git a/compiler/testData/codegen/bytecodeText/jvmStaticInternalMangling.kt b/compiler/testData/codegen/bytecodeText/jvmStaticInternalMangling.kt index 8bceef53f79..43bd30d9e7e 100644 --- a/compiler/testData/codegen/bytecodeText/jvmStaticInternalMangling.kt +++ b/compiler/testData/codegen/bytecodeText/jvmStaticInternalMangling.kt @@ -10,5 +10,5 @@ fun box(): String { } // Check the names of mangled functions -// 1 public final f\$test_module\(\)Ljava/lang/String; -// 1 public final static f\$test_module\(\)Ljava/lang/String; +// 1 public final f\$main\(\)Ljava/lang/String; +// 1 public final static f\$main\(\)Ljava/lang/String; diff --git a/compiler/testData/codegen/bytecodeText/parameterlessMain/dontGenerateOnJvmOverloads.kt b/compiler/testData/codegen/bytecodeText/parameterlessMain/dontGenerateOnJvmOverloads.kt index 002bd0f8b41..54e43534fe1 100644 --- a/compiler/testData/codegen/bytecodeText/parameterlessMain/dontGenerateOnJvmOverloads.kt +++ b/compiler/testData/codegen/bytecodeText/parameterlessMain/dontGenerateOnJvmOverloads.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM fun main() { println("FAIL") } @@ -8,4 +7,4 @@ fun Array.main(x: Int = 4, y: String = "Test") { println("OK") } -// 0 INVOKESTATIC DontGenerateOnJvmOverloadsKt\.main ()V \ No newline at end of file +// 0 INVOKESTATIC DontGenerateOnJvmOverloadsKt\.main ()V diff --git a/compiler/testData/codegen/bytecodeText/preEvaluateInlineJavaStaticFields.kt b/compiler/testData/codegen/bytecodeText/preEvaluateInlineJavaStaticFields.kt index a1acf41d438..0e47518efd2 100644 --- a/compiler/testData/codegen/bytecodeText/preEvaluateInlineJavaStaticFields.kt +++ b/compiler/testData/codegen/bytecodeText/preEvaluateInlineJavaStaticFields.kt @@ -1,6 +1,7 @@ // FILE: JClass.java import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; public class JClass { public final static int PrimitiveInt = 9000; @@ -8,7 +9,7 @@ public class JClass { public final static long PrimitiveLong = 100000; public final static short PrimitiveShort = 901; public final static boolean PrimitiveBool = false; - public final static float PrimitiveFloat = 36.6; + public final static float PrimitiveFloat = 36.6f; public final static double PrimitiveDouble = 42.4242; public final static byte PrimitiveByte = -8; public final static char PrimitiveChar = 'K'; diff --git a/compiler/testData/codegen/bytecodeText/sam/samWrapperRawTypes.kt b/compiler/testData/codegen/bytecodeText/sam/samWrapperRawTypes.kt index 5e2ee246fed..c8886a50cf1 100644 --- a/compiler/testData/codegen/bytecodeText/sam/samWrapperRawTypes.kt +++ b/compiler/testData/codegen/bytecodeText/sam/samWrapperRawTypes.kt @@ -2,7 +2,7 @@ public class J { public interface F { - public int call(String x) + public int call(String x); } public static void g(F r) { @@ -26,4 +26,4 @@ inline fun inlineFun() { // 0 declaration: void \(kotlin.jvm.functions.Function1<.*, .*>\) // 0 declaration: function extends kotlin.jvm.functions.Function1<.*, .*> // 2 private final synthetic Lkotlin/jvm/functions/Function1; function -// 2 \(Lkotlin/jvm/functions/Function1;\)V \ No newline at end of file +// 2 \(Lkotlin/jvm/functions/Function1;\)V diff --git a/compiler/testData/codegen/bytecodeText/stringOperations/kt42457_old.kt b/compiler/testData/codegen/bytecodeText/stringOperations/kt42457_old.kt index 2f94fa9c7b3..fc5efe96610 100644 --- a/compiler/testData/codegen/bytecodeText/stringOperations/kt42457_old.kt +++ b/compiler/testData/codegen/bytecodeText/stringOperations/kt42457_old.kt @@ -1,4 +1,5 @@ // KOTLIN_CONFIGURATION_FLAGS: STRING_CONCAT=indy-with-constants +// IGNORE_JAVA_ERRORS // JVM_TARGET: 9 // FILE: JavaClass.java @@ -16,4 +17,4 @@ fun box() { // 0 INVOKEDYNAMIC makeConcat // 1 JavaClass.toString // 1 String.valueOf -// 0 append \ No newline at end of file +// 0 append diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BytecodeTextTestGenerated.java similarity index 89% rename from compiler/tests-gen/org/jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java rename to compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BytecodeTextTestGenerated.java index 08d591e4c5e..ee7b88542b0 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BytecodeTextTestGenerated.java @@ -3,739 +3,843 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.codegen; +package org.jetbrains.kotlin.test.runners.codegen; import com.intellij.testFramework.TestDataPath; -import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; -import org.jetbrains.kotlin.test.KotlinTestUtils; import org.jetbrains.kotlin.test.util.KtTestUtil; import org.jetbrains.kotlin.test.TargetBackend; import org.jetbrains.kotlin.test.TestMetadata; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; import java.io.File; import java.util.regex.Pattern; -/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ +/** This class is generated by {@link GenerateNewCompilerTests.kt}. DO NOT MODIFY MANUALLY */ @SuppressWarnings("all") @TestMetadata("compiler/testData/codegen/bytecodeText") @TestDataPath("$PROJECT_ROOT") -@RunWith(JUnit3RunnerWithInners.class) public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + @Test @TestMetadata("accessorForOverridenVal.kt") public void testAccessorForOverridenVal() throws Exception { runTest("compiler/testData/codegen/bytecodeText/accessorForOverridenVal.kt"); } + @Test @TestMetadata("accessorForProtected.kt") public void testAccessorForProtected() throws Exception { runTest("compiler/testData/codegen/bytecodeText/accessorForProtected.kt"); } + @Test @TestMetadata("accessorNaming.kt") public void testAccessorNaming() throws Exception { runTest("compiler/testData/codegen/bytecodeText/accessorNaming.kt"); } + @Test public void testAllFilesPresentInBytecodeText() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("annotationDefaultValue.kt") public void testAnnotationDefaultValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/annotationDefaultValue.kt"); } + @Test @TestMetadata("annotationJavaRetentionPolicyRuntime.kt") public void testAnnotationJavaRetentionPolicyRuntime() throws Exception { runTest("compiler/testData/codegen/bytecodeText/annotationJavaRetentionPolicyRuntime.kt"); } + @Test @TestMetadata("annotationRetentionPolicyClass.kt") public void testAnnotationRetentionPolicyClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/annotationRetentionPolicyClass.kt"); } + @Test @TestMetadata("annotationRetentionPolicyRuntime.kt") public void testAnnotationRetentionPolicyRuntime() throws Exception { runTest("compiler/testData/codegen/bytecodeText/annotationRetentionPolicyRuntime.kt"); } + @Test @TestMetadata("annotationRetentionPolicySource.kt") public void testAnnotationRetentionPolicySource() throws Exception { runTest("compiler/testData/codegen/bytecodeText/annotationRetentionPolicySource.kt"); } + @Test @TestMetadata("boxedNotNumberTypeOnUnboxing.kt") public void testBoxedNotNumberTypeOnUnboxing() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxedNotNumberTypeOnUnboxing.kt"); } + @Test @TestMetadata("bridgeForFakeOverride.kt") public void testBridgeForFakeOverride() throws Exception { runTest("compiler/testData/codegen/bytecodeText/bridgeForFakeOverride.kt"); } + @Test @TestMetadata("charConstant.kt") public void testCharConstant() throws Exception { runTest("compiler/testData/codegen/bytecodeText/charConstant.kt"); } + @Test @TestMetadata("collectionStubs.kt") public void testCollectionStubs() throws Exception { runTest("compiler/testData/codegen/bytecodeText/collectionStubs.kt"); } + @Test @TestMetadata("componentEvaluatesOnlyOnce.kt") public void testComponentEvaluatesOnlyOnce() throws Exception { runTest("compiler/testData/codegen/bytecodeText/componentEvaluatesOnlyOnce.kt"); } + @Test @TestMetadata("constClosureOptimization.kt") public void testConstClosureOptimization() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constClosureOptimization.kt"); } + @Test @TestMetadata("defaultMethodBody.kt") public void testDefaultMethodBody() throws Exception { runTest("compiler/testData/codegen/bytecodeText/defaultMethodBody.kt"); } + @Test @TestMetadata("doNotStoreNullForTmpInDestructuring.kt") public void testDoNotStoreNullForTmpInDestructuring() throws Exception { runTest("compiler/testData/codegen/bytecodeText/doNotStoreNullForTmpInDestructuring.kt"); } + @Test @TestMetadata("doNotStoreNullsForCapturedVars.kt") public void testDoNotStoreNullsForCapturedVars() throws Exception { runTest("compiler/testData/codegen/bytecodeText/doNotStoreNullsForCapturedVars.kt"); } + @Test @TestMetadata("falseSmartCast.kt") public void testFalseSmartCast() throws Exception { runTest("compiler/testData/codegen/bytecodeText/falseSmartCast.kt"); } + @Test @TestMetadata("flagsInMultiFileInherit.kt") public void testFlagsInMultiFileInherit() throws Exception { runTest("compiler/testData/codegen/bytecodeText/flagsInMultiFileInherit.kt"); } + @Test @TestMetadata("iincGeneration.kt") public void testIincGeneration() throws Exception { runTest("compiler/testData/codegen/bytecodeText/iincGeneration.kt"); } + @Test @TestMetadata("inheritedPropertyAnnotations.kt") public void testInheritedPropertyAnnotations() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inheritedPropertyAnnotations.kt"); } + @Test @TestMetadata("inlineFromOtherModule.kt") public void testInlineFromOtherModule() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineFromOtherModule.kt"); } + @Test @TestMetadata("inlineJavaConstantFromSubclass.kt") public void testInlineJavaConstantFromSubclass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineJavaConstantFromSubclass.kt"); } + @Test @TestMetadata("inlineJavaStaticFields.kt") public void testInlineJavaStaticFields() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineJavaStaticFields.kt"); } + @Test @TestMetadata("inlineProtectedJavaConstantFromOtherPackage.kt") public void testInlineProtectedJavaConstantFromOtherPackage() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineProtectedJavaConstantFromOtherPackage.kt"); } + @Test @TestMetadata("intConstantNotNull.kt") public void testIntConstantNotNull() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intConstantNotNull.kt"); } + @Test @TestMetadata("intConstantNullable.kt") public void testIntConstantNullable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intConstantNullable.kt"); } + @Test @TestMetadata("intConstantNullableSafeCall.kt") public void testIntConstantNullableSafeCall() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intConstantNullableSafeCall.kt"); } + @Test @TestMetadata("intConstantSafeCall.kt") public void testIntConstantSafeCall() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intConstantSafeCall.kt"); } + @Test @TestMetadata("intProgressionNoBoxing.kt") public void testIntProgressionNoBoxing() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intProgressionNoBoxing.kt"); } + @Test @TestMetadata("intRangeNoBoxing.kt") public void testIntRangeNoBoxing() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intRangeNoBoxing.kt"); } + @Test @TestMetadata("interfaceDefaultImpl.kt") public void testInterfaceDefaultImpl() throws Exception { runTest("compiler/testData/codegen/bytecodeText/interfaceDefaultImpl.kt"); } + @Test @TestMetadata("isArrayOf.kt") public void testIsArrayOf() throws Exception { runTest("compiler/testData/codegen/bytecodeText/isArrayOf.kt"); } + @Test @TestMetadata("javaExtensionPropertyIntrinsic.kt") public void testJavaExtensionPropertyIntrinsic() throws Exception { runTest("compiler/testData/codegen/bytecodeText/javaExtensionPropertyIntrinsic.kt"); } + @Test @TestMetadata("javaFields.kt") public void testJavaFields() throws Exception { runTest("compiler/testData/codegen/bytecodeText/javaFields.kt"); } + @Test @TestMetadata("javaFieldsWithIntersectionTypes.kt") public void testJavaFieldsWithIntersectionTypes() throws Exception { runTest("compiler/testData/codegen/bytecodeText/javaFieldsWithIntersectionTypes.kt"); } + @Test @TestMetadata("javaStatics.kt") public void testJavaStatics() throws Exception { runTest("compiler/testData/codegen/bytecodeText/javaStatics.kt"); } + @Test @TestMetadata("jvmField.kt") public void testJvmField() throws Exception { runTest("compiler/testData/codegen/bytecodeText/jvmField.kt"); } + @Test @TestMetadata("jvmStaticInternalMangling.kt") public void testJvmStaticInternalMangling() throws Exception { runTest("compiler/testData/codegen/bytecodeText/jvmStaticInternalMangling.kt"); } + @Test @TestMetadata("kt10259.kt") public void testKt10259() throws Exception { runTest("compiler/testData/codegen/bytecodeText/kt10259.kt"); } + @Test @TestMetadata("kt10259_2.kt") public void testKt10259_2() throws Exception { runTest("compiler/testData/codegen/bytecodeText/kt10259_2.kt"); } + @Test @TestMetadata("kt10259_3.kt") public void testKt10259_3() throws Exception { runTest("compiler/testData/codegen/bytecodeText/kt10259_3.kt"); } + @Test @TestMetadata("kt2202.kt") public void testKt2202() throws Exception { runTest("compiler/testData/codegen/bytecodeText/kt2202.kt"); } + @Test @TestMetadata("kt2887.kt") public void testKt2887() throws Exception { runTest("compiler/testData/codegen/bytecodeText/kt2887.kt"); } + @Test @TestMetadata("kt3845.kt") public void testKt3845() throws Exception { runTest("compiler/testData/codegen/bytecodeText/kt3845.kt"); } + @Test @TestMetadata("kt5016.kt") public void testKt5016() throws Exception { runTest("compiler/testData/codegen/bytecodeText/kt5016.kt"); } + @Test @TestMetadata("kt5016int.kt") public void testKt5016int() throws Exception { runTest("compiler/testData/codegen/bytecodeText/kt5016int.kt"); } + @Test @TestMetadata("kt5016intOrNull.kt") public void testKt5016intOrNull() throws Exception { runTest("compiler/testData/codegen/bytecodeText/kt5016intOrNull.kt"); } + @Test @TestMetadata("kt7188.kt") public void testKt7188() throws Exception { runTest("compiler/testData/codegen/bytecodeText/kt7188.kt"); } + @Test @TestMetadata("kt7769.kt") public void testKt7769() throws Exception { runTest("compiler/testData/codegen/bytecodeText/kt7769.kt"); } + @Test @TestMetadata("kt9603.kt") public void testKt9603() throws Exception { runTest("compiler/testData/codegen/bytecodeText/kt9603.kt"); } + @Test @TestMetadata("mapGetOrDefault.kt") public void testMapGetOrDefault() throws Exception { runTest("compiler/testData/codegen/bytecodeText/mapGetOrDefault.kt"); } + @Test @TestMetadata("maxStackAfterOptimizations.kt") public void testMaxStackAfterOptimizations() throws Exception { runTest("compiler/testData/codegen/bytecodeText/maxStackAfterOptimizations.kt"); } + @Test @TestMetadata("noAccessorForProtectedInSamePackageCrossinline.kt") public void testNoAccessorForProtectedInSamePackageCrossinline() throws Exception { runTest("compiler/testData/codegen/bytecodeText/noAccessorForProtectedInSamePackageCrossinline.kt"); } + @Test @TestMetadata("noFlagAnnotations.kt") public void testNoFlagAnnotations() throws Exception { runTest("compiler/testData/codegen/bytecodeText/noFlagAnnotations.kt"); } + @Test @TestMetadata("noNumberCheckCast.kt") public void testNoNumberCheckCast() throws Exception { runTest("compiler/testData/codegen/bytecodeText/noNumberCheckCast.kt"); } + @Test @TestMetadata("noSuperCheckInDefaultConstuctor.kt") public void testNoSuperCheckInDefaultConstuctor() throws Exception { runTest("compiler/testData/codegen/bytecodeText/noSuperCheckInDefaultConstuctor.kt"); } + @Test @TestMetadata("noSyntheticAccessorForPrivateCompanionObjectWhenNotRequired.kt") public void testNoSyntheticAccessorForPrivateCompanionObjectWhenNotRequired() throws Exception { runTest("compiler/testData/codegen/bytecodeText/noSyntheticAccessorForPrivateCompanionObjectWhenNotRequired.kt"); } + @Test @TestMetadata("noWrapperForMethodReturningPrimitive.kt") public void testNoWrapperForMethodReturningPrimitive() throws Exception { runTest("compiler/testData/codegen/bytecodeText/noWrapperForMethodReturningPrimitive.kt"); } + @Test @TestMetadata("nopsInDoWhile.kt") public void testNopsInDoWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nopsInDoWhile.kt"); } + @Test @TestMetadata("partMembersCall.kt") public void testPartMembersCall() throws Exception { runTest("compiler/testData/codegen/bytecodeText/partMembersCall.kt"); } + @Test @TestMetadata("partMembersInline.kt") public void testPartMembersInline() throws Exception { runTest("compiler/testData/codegen/bytecodeText/partMembersInline.kt"); } + @Test @TestMetadata("preEvaluateInlineJavaStaticFields.kt") public void testPreEvaluateInlineJavaStaticFields() throws Exception { runTest("compiler/testData/codegen/bytecodeText/preEvaluateInlineJavaStaticFields.kt"); } + @Test @TestMetadata("prefixIntVarIncrement.kt") public void testPrefixIntVarIncrement() throws Exception { runTest("compiler/testData/codegen/bytecodeText/prefixIntVarIncrement.kt"); } + @Test @TestMetadata("privateDefaultArgs.kt") public void testPrivateDefaultArgs() throws Exception { runTest("compiler/testData/codegen/bytecodeText/privateDefaultArgs.kt"); } + @Test @TestMetadata("redundantGotoRemoving.kt") public void testRedundantGotoRemoving() throws Exception { runTest("compiler/testData/codegen/bytecodeText/redundantGotoRemoving.kt"); } + @Test @TestMetadata("redundantInitializer.kt") public void testRedundantInitializer() throws Exception { runTest("compiler/testData/codegen/bytecodeText/redundantInitializer.kt"); } + @Test @TestMetadata("redundantInitializerNumber.kt") public void testRedundantInitializerNumber() throws Exception { runTest("compiler/testData/codegen/bytecodeText/redundantInitializerNumber.kt"); } + @Test @TestMetadata("redundantValInitializer.kt") public void testRedundantValInitializer() throws Exception { runTest("compiler/testData/codegen/bytecodeText/redundantValInitializer.kt"); } + @Test @TestMetadata("redundantValInitializerInObject.kt") public void testRedundantValInitializerInObject() throws Exception { runTest("compiler/testData/codegen/bytecodeText/redundantValInitializerInObject.kt"); } + @Test @TestMetadata("redundantVarInitializer.kt") public void testRedundantVarInitializer() throws Exception { runTest("compiler/testData/codegen/bytecodeText/redundantVarInitializer.kt"); } + @Test @TestMetadata("redundantVarInitializerInObject.kt") public void testRedundantVarInitializerInObject() throws Exception { runTest("compiler/testData/codegen/bytecodeText/redundantVarInitializerInObject.kt"); } + @Test @TestMetadata("reifiedAsCheck.kt") public void testReifiedAsCheck() throws Exception { runTest("compiler/testData/codegen/bytecodeText/reifiedAsCheck.kt"); } + @Test @TestMetadata("reifiedAsCheckWithNullable.kt") public void testReifiedAsCheckWithNullable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/reifiedAsCheckWithNullable.kt"); } + @Test @TestMetadata("reifiedIsCheck.kt") public void testReifiedIsCheck() throws Exception { runTest("compiler/testData/codegen/bytecodeText/reifiedIsCheck.kt"); } + @Test @TestMetadata("reifiedIsCheckWithNullable.kt") public void testReifiedIsCheckWithNullable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/reifiedIsCheckWithNullable.kt"); } + @Test @TestMetadata("reifiedSafeAsCheck.kt") public void testReifiedSafeAsCheck() throws Exception { runTest("compiler/testData/codegen/bytecodeText/reifiedSafeAsCheck.kt"); } + @Test @TestMetadata("safeAsWithMutable.kt") public void testSafeAsWithMutable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/safeAsWithMutable.kt"); } + @Test @TestMetadata("superFlagInMultiFileFacade.kt") public void testSuperFlagInMultiFileFacade() throws Exception { runTest("compiler/testData/codegen/bytecodeText/superFlagInMultiFileFacade.kt"); } + @Test @TestMetadata("superToString.kt") public void testSuperToString() throws Exception { runTest("compiler/testData/codegen/bytecodeText/superToString.kt"); } + @Test @TestMetadata("suspendCoroutineUninterceptedOrReturn.kt") public void testSuspendCoroutineUninterceptedOrReturn() throws Exception { runTest("compiler/testData/codegen/bytecodeText/suspendCoroutineUninterceptedOrReturn.kt"); } + @Test @TestMetadata("topLevelFunWithDefaultArgs.kt") public void testTopLevelFunWithDefaultArgs() throws Exception { runTest("compiler/testData/codegen/bytecodeText/topLevelFunWithDefaultArgs.kt"); } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/argumentOrder") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ArgumentOrder extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class ArgumentOrder extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInArgumentOrder() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/argumentOrder"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("sameOrder.kt") public void testSameOrder() throws Exception { runTest("compiler/testData/codegen/bytecodeText/argumentOrder/sameOrder.kt"); } + @Test @TestMetadata("sameOrderWithDefault.kt") public void testSameOrderWithDefault() throws Exception { runTest("compiler/testData/codegen/bytecodeText/argumentOrder/sameOrderWithDefault.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/assert") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Assert extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class Assert extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInAssert() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/assert"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("jvmCrossinline.kt") public void testJvmCrossinline() throws Exception { runTest("compiler/testData/codegen/bytecodeText/assert/jvmCrossinline.kt"); } + @Test @TestMetadata("jvmCrossinlineAssertInLambda.kt") public void testJvmCrossinlineAssertInLambda() throws Exception { runTest("compiler/testData/codegen/bytecodeText/assert/jvmCrossinlineAssertInLambda.kt"); } + @Test @TestMetadata("jvmInline.kt") public void testJvmInline() throws Exception { runTest("compiler/testData/codegen/bytecodeText/assert/jvmInline.kt"); } + @Test @TestMetadata("jvmInlineLambda.kt") public void testJvmInlineLambda() throws Exception { runTest("compiler/testData/codegen/bytecodeText/assert/jvmInlineLambda.kt"); } + @Test @TestMetadata("jvmNestedClass.kt") public void testJvmNestedClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/assert/jvmNestedClass.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/boxing") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Boxing extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class Boxing extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInBoxing() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/boxing"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("crossinlineSuspend.kt") public void testCrossinlineSuspend() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxing/crossinlineSuspend.kt"); } + @Test @TestMetadata("inlineSuspend.kt") public void testInlineSuspend() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxing/inlineSuspend.kt"); } + @Test @TestMetadata("suspend.kt") public void testSuspend() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxing/suspend.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/boxingOptimization") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class BoxingOptimization extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class BoxingOptimization extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInBoxingOptimization() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/boxingOptimization"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("boxingAndEquals.kt") public void testBoxingAndEquals() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/boxingAndEquals.kt"); } + @Test @TestMetadata("casts.kt") public void testCasts() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/casts.kt"); } + @Test @TestMetadata("checkcastAndInstanceOf.kt") public void testCheckcastAndInstanceOf() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/checkcastAndInstanceOf.kt"); } + @Test @TestMetadata("fold.kt") public void testFold() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/fold.kt"); } + @Test @TestMetadata("inlineClassesAndInlinedLambda.kt") public void testInlineClassesAndInlinedLambda() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/inlineClassesAndInlinedLambda.kt"); } + @Test @TestMetadata("intCompareTo.kt") public void testIntCompareTo() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/intCompareTo.kt"); } + @Test @TestMetadata("kClassInAnnotation.kt") public void testKClassInAnnotation() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/kClassInAnnotation.kt"); } + @Test @TestMetadata("kClassInAnnotationEscaping.kt") public void testKClassInAnnotationEscaping() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/kClassInAnnotationEscaping.kt"); } + @Test @TestMetadata("kt15862.kt") public void testKt15862() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/kt15862.kt"); } + @Test @TestMetadata("kt15862_2.kt") public void testKt15862_2() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/kt15862_2.kt"); } + @Test @TestMetadata("kt6842.kt") public void testKt6842() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/kt6842.kt"); } + @Test @TestMetadata("kt7224.kt") public void testKt7224() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/kt7224.kt"); } + @Test @TestMetadata("maxMinByOrNull.kt") public void testMaxMinByOrNull() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/maxMinByOrNull.kt"); } + @Test @TestMetadata("nullCheck.kt") public void testNullCheck() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/nullCheck.kt"); } + @Test @TestMetadata("progressions.kt") public void testProgressions() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/progressions.kt"); } + @Test @TestMetadata("safeCallToPrimitiveEquality.kt") public void testSafeCallToPrimitiveEquality() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/safeCallToPrimitiveEquality.kt"); } + @Test @TestMetadata("safeCallWithElvis.kt") public void testSafeCallWithElvis() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/safeCallWithElvis.kt"); } + @Test @TestMetadata("severalInlines.kt") public void testSeveralInlines() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/severalInlines.kt"); } + @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/simple.kt"); } + @Test @TestMetadata("simpleUninitializedMerge.kt") public void testSimpleUninitializedMerge() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/simpleUninitializedMerge.kt"); } + @Test @TestMetadata("unsafeRemoving.kt") public void testUnsafeRemoving() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/unsafeRemoving.kt"); } + @Test @TestMetadata("unsignedRangeIteratorSpecialization.kt") public void testUnsignedRangeIteratorSpecialization() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/unsignedRangeIteratorSpecialization.kt"); } + @Test @TestMetadata("variableClash.kt") public void testVariableClash() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/variableClash.kt"); } + @Test @TestMetadata("variables.kt") public void testVariables() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/variables.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/builtinFunctions") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class BuiltinFunctions extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class BuiltinFunctions extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInBuiltinFunctions() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/builtinFunctions"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("charSequence.kt") public void testCharSequence() throws Exception { runTest("compiler/testData/codegen/bytecodeText/builtinFunctions/charSequence.kt"); } + @Test @TestMetadata("contains.kt") public void testContains() throws Exception { runTest("compiler/testData/codegen/bytecodeText/builtinFunctions/contains.kt"); } + @Test @TestMetadata("removeAt.kt") public void testRemoveAt() throws Exception { runTest("compiler/testData/codegen/bytecodeText/builtinFunctions/removeAt.kt"); } + @Test @TestMetadata("size.kt") public void testSize() throws Exception { runTest("compiler/testData/codegen/bytecodeText/builtinFunctions/size.kt"); } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/builtinFunctions/genericParameterBridge") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class GenericParameterBridge extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class GenericParameterBridge extends AbstractBytecodeTextTest { + @Test @TestMetadata("abstractList.kt") public void testAbstractList() throws Exception { runTest("compiler/testData/codegen/bytecodeText/builtinFunctions/genericParameterBridge/abstractList.kt"); } + @Test public void testAllFilesPresentInGenericParameterBridge() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/builtinFunctions/genericParameterBridge"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("IntMC.kt") public void testIntMC() throws Exception { runTest("compiler/testData/codegen/bytecodeText/builtinFunctions/genericParameterBridge/IntMC.kt"); } + @Test @TestMetadata("mutableCollection.kt") public void testMutableCollection() throws Exception { runTest("compiler/testData/codegen/bytecodeText/builtinFunctions/genericParameterBridge/mutableCollection.kt"); } + @Test @TestMetadata("mutableSetInterfaces.kt") public void testMutableSetInterfaces() throws Exception { runTest("compiler/testData/codegen/bytecodeText/builtinFunctions/genericParameterBridge/mutableSetInterfaces.kt"); } + @Test @TestMetadata("notNullAnyMC.kt") public void testNotNullAnyMC() throws Exception { runTest("compiler/testData/codegen/bytecodeText/builtinFunctions/genericParameterBridge/notNullAnyMC.kt"); } + @Test @TestMetadata("notNullParamMC.kt") public void testNotNullParamMC() throws Exception { runTest("compiler/testData/codegen/bytecodeText/builtinFunctions/genericParameterBridge/notNullParamMC.kt"); } + @Test @TestMetadata("nullableAnyMC.kt") public void testNullableAnyMC() throws Exception { runTest("compiler/testData/codegen/bytecodeText/builtinFunctions/genericParameterBridge/nullableAnyMC.kt"); @@ -743,983 +847,1079 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest { } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/callableReference") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class CallableReference extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class CallableReference extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInCallableReference() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/callableReference"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("boundFieldReferenceInInline.kt") public void testBoundFieldReferenceInInline() throws Exception { runTest("compiler/testData/codegen/bytecodeText/callableReference/boundFieldReferenceInInline.kt"); } + @Test @TestMetadata("boundFunReferenceInInline.kt") public void testBoundFunReferenceInInline() throws Exception { runTest("compiler/testData/codegen/bytecodeText/callableReference/boundFunReferenceInInline.kt"); } + @Test @TestMetadata("boundPropertyReferenceInInline.kt") public void testBoundPropertyReferenceInInline() throws Exception { runTest("compiler/testData/codegen/bytecodeText/callableReference/boundPropertyReferenceInInline.kt"); } + @Test @TestMetadata("kt36975.kt") public void testKt36975() throws Exception { runTest("compiler/testData/codegen/bytecodeText/callableReference/kt36975.kt"); } + @Test @TestMetadata("kt39612.kt") public void testKt39612() throws Exception { runTest("compiler/testData/codegen/bytecodeText/callableReference/kt39612.kt"); } + @Test @TestMetadata("nameIntrinsicWithImplicitThis.kt") public void testNameIntrinsicWithImplicitThis() throws Exception { runTest("compiler/testData/codegen/bytecodeText/callableReference/nameIntrinsicWithImplicitThis.kt"); } + @Test @TestMetadata("unboundFieldReferenceInInline.kt") public void testUnboundFieldReferenceInInline() throws Exception { runTest("compiler/testData/codegen/bytecodeText/callableReference/unboundFieldReferenceInInline.kt"); } + @Test @TestMetadata("unboundFunReferenceInInline.kt") public void testUnboundFunReferenceInInline() throws Exception { runTest("compiler/testData/codegen/bytecodeText/callableReference/unboundFunReferenceInInline.kt"); } + @Test @TestMetadata("unboundPropertyReferenceInInline.kt") public void testUnboundPropertyReferenceInInline() throws Exception { runTest("compiler/testData/codegen/bytecodeText/callableReference/unboundPropertyReferenceInInline.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/capturedVarsOptimization") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class CapturedVarsOptimization extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class CapturedVarsOptimization extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInCapturedVarsOptimization() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/capturedVarsOptimization"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("capturedInChainOfInlineFuns.kt") public void testCapturedInChainOfInlineFuns() throws Exception { runTest("compiler/testData/codegen/bytecodeText/capturedVarsOptimization/capturedInChainOfInlineFuns.kt"); } + @Test @TestMetadata("capturedInInlineOnly.kt") public void testCapturedInInlineOnly() throws Exception { runTest("compiler/testData/codegen/bytecodeText/capturedVarsOptimization/capturedInInlineOnly.kt"); } + @Test @TestMetadata("capturedInLocalObject.kt") public void testCapturedInLocalObject() throws Exception { runTest("compiler/testData/codegen/bytecodeText/capturedVarsOptimization/capturedInLocalObject.kt"); } + @Test @TestMetadata("capturedInNoInlineOnly.kt") public void testCapturedInNoInlineOnly() throws Exception { runTest("compiler/testData/codegen/bytecodeText/capturedVarsOptimization/capturedInNoInlineOnly.kt"); } + @Test @TestMetadata("capturedInNoInlneInsideChainOfInlineFuns.kt") public void testCapturedInNoInlneInsideChainOfInlineFuns() throws Exception { runTest("compiler/testData/codegen/bytecodeText/capturedVarsOptimization/capturedInNoInlneInsideChainOfInlineFuns.kt"); } + @Test @TestMetadata("capturedValInLambdaInitializedInside.kt") public void testCapturedValInLambdaInitializedInside() throws Exception { runTest("compiler/testData/codegen/bytecodeText/capturedVarsOptimization/capturedValInLambdaInitializedInside.kt"); } + @Test @TestMetadata("capturedValInLambdaInitializedOutside.kt") public void testCapturedValInLambdaInitializedOutside() throws Exception { runTest("compiler/testData/codegen/bytecodeText/capturedVarsOptimization/capturedValInLambdaInitializedOutside.kt"); } + @Test @TestMetadata("capturedVarsOfSize2.kt") public void testCapturedVarsOfSize2() throws Exception { runTest("compiler/testData/codegen/bytecodeText/capturedVarsOptimization/capturedVarsOfSize2.kt"); } + @Test @TestMetadata("sharedSlotsWithCapturedVars.kt") public void testSharedSlotsWithCapturedVars() throws Exception { runTest("compiler/testData/codegen/bytecodeText/capturedVarsOptimization/sharedSlotsWithCapturedVars.kt"); } + @Test @TestMetadata("withStackNormalization.kt") public void testWithStackNormalization() throws Exception { runTest("compiler/testData/codegen/bytecodeText/capturedVarsOptimization/withStackNormalization.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/checkcast") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Checkcast extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class Checkcast extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInCheckcast() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/checkcast"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("kt14811.kt") public void testKt14811() throws Exception { runTest("compiler/testData/codegen/bytecodeText/checkcast/kt14811.kt"); } + @Test @TestMetadata("kt14963.kt") public void testKt14963() throws Exception { runTest("compiler/testData/codegen/bytecodeText/checkcast/kt14963.kt"); } + @Test @TestMetadata("kt15411.kt") public void testKt15411() throws Exception { runTest("compiler/testData/codegen/bytecodeText/checkcast/kt15411.kt"); } + @Test @TestMetadata("kt22714.kt") public void testKt22714() throws Exception { runTest("compiler/testData/codegen/bytecodeText/checkcast/kt22714.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/coercionToUnitOptimization") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class CoercionToUnitOptimization extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class CoercionToUnitOptimization extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInCoercionToUnitOptimization() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/coercionToUnitOptimization"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("inRangeCheckWithConst.kt") public void testInRangeCheckWithConst() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coercionToUnitOptimization/inRangeCheckWithConst.kt"); } + @Test @TestMetadata("kt14360.kt") public void testKt14360() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coercionToUnitOptimization/kt14360.kt"); } + @Test @TestMetadata("largeMethodWithCoercionToUnit.kt") public void testLargeMethodWithCoercionToUnit() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coercionToUnitOptimization/largeMethodWithCoercionToUnit.kt"); } + @Test @TestMetadata("nopInlineFuns.kt") public void testNopInlineFuns() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coercionToUnitOptimization/nopInlineFuns.kt"); } + @Test @TestMetadata("returnsUnit.kt") public void testReturnsUnit() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coercionToUnitOptimization/returnsUnit.kt"); } + @Test @TestMetadata("safeCall.kt") public void testSafeCall() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coercionToUnitOptimization/safeCall.kt"); } + @Test @TestMetadata("safeCallWithReturnValue.kt") public void testSafeCallWithReturnValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coercionToUnitOptimization/safeCallWithReturnValue.kt"); } + @Test @TestMetadata("safeLet.kt") public void testSafeLet() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coercionToUnitOptimization/safeLet.kt"); } + @Test @TestMetadata("tryInlined.kt") public void testTryInlined() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coercionToUnitOptimization/tryInlined.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/companion") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Companion extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class Companion extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInCompanion() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/companion"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("directAccessToBackingField.kt") public void testDirectAccessToBackingField() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/directAccessToBackingField.kt"); } + @Test @TestMetadata("floatingPointCompanionAccess.kt") public void testFloatingPointCompanionAccess() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/floatingPointCompanionAccess.kt"); } + @Test @TestMetadata("inlineFunctionCompanionPropertyAccess.kt") public void testInlineFunctionCompanionPropertyAccess() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/inlineFunctionCompanionPropertyAccess.kt"); } + @Test @TestMetadata("inlineFunctionObjectCompanionPropertyAccess.kt") public void testInlineFunctionObjectCompanionPropertyAccess() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/inlineFunctionObjectCompanionPropertyAccess.kt"); } + @Test @TestMetadata("kt14258_1.kt") public void testKt14258_1() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/kt14258_1.kt"); } + @Test @TestMetadata("kt14258_2.kt") public void testKt14258_2() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/kt14258_2.kt"); } + @Test @TestMetadata("kt14258_3.kt") public void testKt14258_3() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/kt14258_3.kt"); } + @Test @TestMetadata("kt14258_4.kt") public void testKt14258_4() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/kt14258_4.kt"); } + @Test @TestMetadata("kt14258_5.kt") public void testKt14258_5() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/kt14258_5.kt"); } + @Test @TestMetadata("nonDefaultAccessors.kt") public void testNonDefaultAccessors() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/nonDefaultAccessors.kt"); } + @Test @TestMetadata("privateCompanionObjectAccessors_after.kt") public void testPrivateCompanionObjectAccessors_after() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/privateCompanionObjectAccessors_after.kt"); } + @Test @TestMetadata("privateCompanionObjectAccessors_before.kt") public void testPrivateCompanionObjectAccessors_before() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/privateCompanionObjectAccessors_before.kt"); } + @Test @TestMetadata("protectedCompanionObjectAccessors_after.kt") public void testProtectedCompanionObjectAccessors_after() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/protectedCompanionObjectAccessors_after.kt"); } + @Test @TestMetadata("protectedCompanionObjectAccessors_before.kt") public void testProtectedCompanionObjectAccessors_before() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/protectedCompanionObjectAccessors_before.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/conditions") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Conditions extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class Conditions extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInConditions() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/conditions"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("conjunction.kt") public void testConjunction() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/conjunction.kt"); } + @Test @TestMetadata("conjunctionInDoWhile.kt") public void testConjunctionInDoWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/conjunctionInDoWhile.kt"); } + @Test @TestMetadata("conjunctionInWhile.kt") public void testConjunctionInWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/conjunctionInWhile.kt"); } + @Test @TestMetadata("disjunction.kt") public void testDisjunction() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/disjunction.kt"); } + @Test @TestMetadata("negatedConjuction.kt") public void testNegatedConjuction() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/negatedConjuction.kt"); } + @Test @TestMetadata("negatedDisjunction.kt") public void testNegatedDisjunction() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/negatedDisjunction.kt"); } + @Test @TestMetadata("negatedNonZeroCompareInDoWhile.kt") public void testNegatedNonZeroCompareInDoWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/negatedNonZeroCompareInDoWhile.kt"); } + @Test @TestMetadata("negatedNonZeroCompareInIf.kt") public void testNegatedNonZeroCompareInIf() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/negatedNonZeroCompareInIf.kt"); } + @Test @TestMetadata("negatedNonZeroCompareInWhile.kt") public void testNegatedNonZeroCompareInWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/negatedNonZeroCompareInWhile.kt"); } + @Test @TestMetadata("negatedNullCompareInDoWhile.kt") public void testNegatedNullCompareInDoWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/negatedNullCompareInDoWhile.kt"); } + @Test @TestMetadata("negatedNullCompareInIf.kt") public void testNegatedNullCompareInIf() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/negatedNullCompareInIf.kt"); } + @Test @TestMetadata("negatedNullCompareInWhile.kt") public void testNegatedNullCompareInWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/negatedNullCompareInWhile.kt"); } + @Test @TestMetadata("negatedZeroCompareInDoWhile.kt") public void testNegatedZeroCompareInDoWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/negatedZeroCompareInDoWhile.kt"); } + @Test @TestMetadata("negatedZeroCompareInIf.kt") public void testNegatedZeroCompareInIf() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/negatedZeroCompareInIf.kt"); } + @Test @TestMetadata("negatedZeroCompareInWhile.kt") public void testNegatedZeroCompareInWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/negatedZeroCompareInWhile.kt"); } + @Test @TestMetadata("noBoxingForBoxedEqPrimitive.kt") public void testNoBoxingForBoxedEqPrimitive() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/noBoxingForBoxedEqPrimitive.kt"); } + @Test @TestMetadata("noBoxingForPrimitiveEqBoxed.kt") public void testNoBoxingForPrimitiveEqBoxed() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/noBoxingForPrimitiveEqBoxed.kt"); } + @Test @TestMetadata("noBoxingForPrimitiveEqObject.kt") public void testNoBoxingForPrimitiveEqObject() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/noBoxingForPrimitiveEqObject.kt"); } + @Test @TestMetadata("nonZeroCompareInDoWhile.kt") public void testNonZeroCompareInDoWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/nonZeroCompareInDoWhile.kt"); } + @Test @TestMetadata("nonZeroCompareInIf.kt") public void testNonZeroCompareInIf() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/nonZeroCompareInIf.kt"); } + @Test @TestMetadata("nonZeroCompareInWhile.kt") public void testNonZeroCompareInWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/nonZeroCompareInWhile.kt"); } + @Test @TestMetadata("nullCompareConst.kt") public void testNullCompareConst() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/nullCompareConst.kt"); } + @Test @TestMetadata("nullCompareInDoWhile.kt") public void testNullCompareInDoWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/nullCompareInDoWhile.kt"); } + @Test @TestMetadata("nullCompareInIf.kt") public void testNullCompareInIf() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/nullCompareInIf.kt"); } + @Test @TestMetadata("nullCompareInWhile.kt") public void testNullCompareInWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/nullCompareInWhile.kt"); } + @Test @TestMetadata("zeroCompareInDoWhile.kt") public void testZeroCompareInDoWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/zeroCompareInDoWhile.kt"); } + @Test @TestMetadata("zeroCompareInIf.kt") public void testZeroCompareInIf() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/zeroCompareInIf.kt"); } + @Test @TestMetadata("zeroCompareInWhile.kt") public void testZeroCompareInWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/zeroCompareInWhile.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/constProperty") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ConstProperty extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class ConstProperty extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInConstProperty() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/constProperty"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("noAccessorsForPrivateConstants.kt") public void testNoAccessorsForPrivateConstants() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constProperty/noAccessorsForPrivateConstants.kt"); } + @Test @TestMetadata("noInline.kt") public void testNoInline() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constProperty/noInline.kt"); } + @Test @TestMetadata("noInlineInCmp.kt") public void testNoInlineInCmp() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constProperty/noInlineInCmp.kt"); } + @Test @TestMetadata("nonConstValHasNoDefaultValue_after.kt") public void testNonConstValHasNoDefaultValue_after() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constProperty/nonConstValHasNoDefaultValue_after.kt"); } + @Test @TestMetadata("nonConstValHasNoDefaultValue_before.kt") public void testNonConstValHasNoDefaultValue_before() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constProperty/nonConstValHasNoDefaultValue_before.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/constantConditions") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ConstantConditions extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class ConstantConditions extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInConstantConditions() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/constantConditions"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("cmpIntWith0.kt") public void testCmpIntWith0() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constantConditions/cmpIntWith0.kt"); } + @Test @TestMetadata("constantFlag.kt") public void testConstantFlag() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constantConditions/constantFlag.kt"); } + @Test @TestMetadata("constantInt.kt") public void testConstantInt() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constantConditions/constantInt.kt"); } + @Test @TestMetadata("inlineIfFalse.kt") public void testInlineIfFalse() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constantConditions/inlineIfFalse.kt"); } + @Test @TestMetadata("kt3098.kt") public void testKt3098() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constantConditions/kt3098.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/constants") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Constants extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class Constants extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInConstants() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/constants"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("byte.kt") public void testByte() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constants/byte.kt"); } + @Test @TestMetadata("floatingPoints.kt") public void testFloatingPoints() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constants/floatingPoints.kt"); } + @Test @TestMetadata("inlineUnsignedIntConstant.kt") public void testInlineUnsignedIntConstant() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constants/inlineUnsignedIntConstant.kt"); } + @Test @TestMetadata("kt9532.kt") public void testKt9532() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constants/kt9532.kt"); } + @Test @TestMetadata("noInlineNonConst.kt") public void testNoInlineNonConst() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constants/noInlineNonConst.kt"); } + @Test @TestMetadata("noInlineNonStaticJavaField.kt") public void testNoInlineNonStaticJavaField() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constants/noInlineNonStaticJavaField.kt"); } + @Test @TestMetadata("noInlineNonStaticJavaField_lv10.kt") public void testNoInlineNonStaticJavaField_lv10() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constants/noInlineNonStaticJavaField_lv10.kt"); } + @Test @TestMetadata("nullableByteAndShort.kt") public void testNullableByteAndShort() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constants/nullableByteAndShort.kt"); } + @Test @TestMetadata("partialString.kt") public void testPartialString() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constants/partialString.kt"); } + @Test @TestMetadata("short.kt") public void testShort() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constants/short.kt"); } + @Test @TestMetadata("string.kt") public void testString() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constants/string.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/constructors") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Constructors extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class Constructors extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInConstructors() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/constructors"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("enumPrimaryDefaults.kt") public void testEnumPrimaryDefaults() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constructors/enumPrimaryDefaults.kt"); } + @Test @TestMetadata("inlineArgumentPrimaryDefaults.kt") public void testInlineArgumentPrimaryDefaults() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constructors/inlineArgumentPrimaryDefaults.kt"); } + @Test @TestMetadata("inlinePrimaryDefaults.kt") public void testInlinePrimaryDefaults() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constructors/inlinePrimaryDefaults.kt"); } + @Test @TestMetadata("innerPrimaryDefaults.kt") public void testInnerPrimaryDefaults() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constructors/innerPrimaryDefaults.kt"); } + @Test @TestMetadata("internalPrimaryDefaults.kt") public void testInternalPrimaryDefaults() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constructors/internalPrimaryDefaults.kt"); } + @Test @TestMetadata("localPrimaryDefaults.kt") public void testLocalPrimaryDefaults() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constructors/localPrimaryDefaults.kt"); } + @Test @TestMetadata("parameterlessPrimary.kt") public void testParameterlessPrimary() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constructors/parameterlessPrimary.kt"); } + @Test @TestMetadata("privatePrimaryDefaults.kt") public void testPrivatePrimaryDefaults() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constructors/privatePrimaryDefaults.kt"); } + @Test @TestMetadata("protectedPrimaryDefaults.kt") public void testProtectedPrimaryDefaults() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constructors/protectedPrimaryDefaults.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/controlStructures") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ControlStructures extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class ControlStructures extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInControlStructures() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/controlStructures"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("ifConsts.kt") public void testIfConsts() throws Exception { runTest("compiler/testData/codegen/bytecodeText/controlStructures/ifConsts.kt"); } + @Test @TestMetadata("kt17110.kt") public void testKt17110() throws Exception { runTest("compiler/testData/codegen/bytecodeText/controlStructures/kt17110.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/coroutines") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Coroutines extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class Coroutines extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInCoroutines() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/coroutines"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("crossinlineSuspendContinuation_1_3.kt") public void testCrossinlineSuspendContinuation_1_3() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/crossinlineSuspendContinuation_1_3.kt"); } + @Test @TestMetadata("doNotReassignContinuation.kt") public void testDoNotReassignContinuation() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/doNotReassignContinuation.kt"); } + @Test @TestMetadata("effectivelyInlineOnly.kt") public void testEffectivelyInlineOnly() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/effectivelyInlineOnly.kt"); } + @Test @TestMetadata("internalInlineSuspend.kt") public void testInternalInlineSuspend() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/internalInlineSuspend.kt"); } + @Test @TestMetadata("mergeLvt.kt") public void testMergeLvt() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/mergeLvt.kt"); } + @Test @TestMetadata("nonLocalReturn.kt") public void testNonLocalReturn() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/nonLocalReturn.kt"); } + @Test @TestMetadata("returnUnitInLambda.kt") public void testReturnUnitInLambda() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/returnUnitInLambda.kt"); } + @Test @TestMetadata("suspendMain.kt") public void testSuspendMain() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/suspendMain.kt"); } + @Test @TestMetadata("throwOnFailure.kt") public void testThrowOnFailure() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/throwOnFailure.kt"); } + @Test @TestMetadata("varValueConflictsWithTable.kt") public void testVarValueConflictsWithTable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/varValueConflictsWithTable.kt"); } + @Test @TestMetadata("varValueConflictsWithTableSameSort.kt") public void testVarValueConflictsWithTableSameSort() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/varValueConflictsWithTableSameSort.kt"); } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/coroutines/cleanup") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Cleanup extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class Cleanup extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInCleanup() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/coroutines/cleanup"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("backEdge.kt") public void testBackEdge() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/cleanup/backEdge.kt"); } + @Test @TestMetadata("if.kt") public void testIf() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/cleanup/if.kt"); } + @Test @TestMetadata("nullCleanup.kt") public void testNullCleanup() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/cleanup/nullCleanup.kt"); } + @Test @TestMetadata("nullNotSpill.kt") public void testNullNotSpill() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/cleanup/nullNotSpill.kt"); } + @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/cleanup/simple.kt"); } + @Test @TestMetadata("twoRefs.kt") public void testTwoRefs() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/cleanup/twoRefs.kt"); } + @Test @TestMetadata("unusedParamNotSpill.kt") public void testUnusedParamNotSpill() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/cleanup/unusedParamNotSpill.kt"); } + @Test @TestMetadata("when.kt") public void testWhen() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/cleanup/when.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/coroutines/debug") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Debug extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class Debug extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInDebug() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/coroutines/debug"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("continuationInLvt.kt") public void testContinuationInLvt() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/debug/continuationInLvt.kt"); } + @Test @TestMetadata("localVariableCorrectLabel.kt") public void testLocalVariableCorrectLabel() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/debug/localVariableCorrectLabel.kt"); } + @Test @TestMetadata("probeCoroutineSuspended.kt") public void testProbeCoroutineSuspended() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/debug/probeCoroutineSuspended.kt"); } + @Test @TestMetadata("shrinkLvtTopLevel.kt") public void testShrinkLvtTopLevel() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/debug/shrinkLvtTopLevel.kt"); } + @Test @TestMetadata("thisAndResultInLvt.kt") public void testThisAndResultInLvt() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/debug/thisAndResultInLvt.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/coroutines/destructuringInLambda") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class DestructuringInLambda extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class DestructuringInLambda extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInDestructuringInLambda() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/coroutines/destructuringInLambda"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("inlineSeparateFiles.kt") public void testInlineSeparateFiles() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/destructuringInLambda/inlineSeparateFiles.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/coroutines/inlineClasses") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class InlineClasses extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class InlineClasses extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInInlineClasses() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/coroutines/inlineClasses"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("inlineClassBoxingInSuspendFunReturn_Primitive.kt") public void testInlineClassBoxingInSuspendFunReturn_Primitive() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/inlineClasses/inlineClassBoxingInSuspendFunReturn_Primitive.kt"); } + @Test @TestMetadata("noInlineClassBoxingInSuspendFunReturn_Any.kt") public void testNoInlineClassBoxingInSuspendFunReturn_Any() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/inlineClasses/noInlineClassBoxingInSuspendFunReturn_Any.kt"); } + @Test @TestMetadata("noInlineClassBoxingInSuspendFunReturn_InlineAny.kt") public void testNoInlineClassBoxingInSuspendFunReturn_InlineAny() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/inlineClasses/noInlineClassBoxingInSuspendFunReturn_InlineAny.kt"); } + @Test @TestMetadata("noInlineClassBoxingInSuspendFunReturn_SameJvmType.kt") public void testNoInlineClassBoxingInSuspendFunReturn_SameJvmType() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/inlineClasses/noInlineClassBoxingInSuspendFunReturn_SameJvmType.kt"); } + @Test @TestMetadata("noInlineClassBoxingInSuspendFunReturn_String.kt") public void testNoInlineClassBoxingInSuspendFunReturn_String() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/inlineClasses/noInlineClassBoxingInSuspendFunReturn_String.kt"); } + @Test @TestMetadata("returnResult.kt") public void testReturnResult() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/inlineClasses/returnResult.kt"); } + @Test @TestMetadata("returnStringOverride.kt") public void testReturnStringOverride() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/inlineClasses/returnStringOverride.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class IntLikeVarSpilling extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class IntLikeVarSpilling extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInIntLikeVarSpilling() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("complicatedMerge.kt") public void testComplicatedMerge() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/complicatedMerge.kt"); } + @Test @TestMetadata("i2bResult.kt") public void testI2bResult() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/i2bResult.kt"); } + @Test @TestMetadata("loadFromBooleanArray.kt") public void testLoadFromBooleanArray() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/loadFromBooleanArray.kt"); } + @Test @TestMetadata("loadFromByteArray.kt") public void testLoadFromByteArray() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/loadFromByteArray.kt"); } + @Test @TestMetadata("noVariableInTable.kt") public void testNoVariableInTable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/noVariableInTable.kt"); } + @Test @TestMetadata("sameIconst1ManyVars.kt") public void testSameIconst1ManyVars() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/sameIconst1ManyVars.kt"); } + @Test @TestMetadata("usedInArrayStore.kt") public void testUsedInArrayStore() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInArrayStore.kt"); } + @Test @TestMetadata("usedInMethodCall.kt") public void testUsedInMethodCall() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInMethodCall.kt"); } + @Test @TestMetadata("usedInPutfield.kt") public void testUsedInPutfield() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInPutfield.kt"); } + @Test @TestMetadata("usedInVarStore.kt") public void testUsedInVarStore() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInVarStore.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/coroutines/stateMachine") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class StateMachine extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class StateMachine extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInStateMachine() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/coroutines/stateMachine"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("kt25893.kt") public void testKt25893() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/stateMachine/kt25893.kt"); } + @Test @TestMetadata("withTypeParameter.kt") public void testWithTypeParameter() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/stateMachine/withTypeParameter.kt"); @@ -1727,958 +1927,1049 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest { } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/deadCodeElimination") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class DeadCodeElimination extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class DeadCodeElimination extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInDeadCodeElimination() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/deadCodeElimination"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("arrayConstructor.kt") public void testArrayConstructor() throws Exception { runTest("compiler/testData/codegen/bytecodeText/deadCodeElimination/arrayConstructor.kt"); } + @Test @TestMetadata("boxing.kt") public void testBoxing() throws Exception { runTest("compiler/testData/codegen/bytecodeText/deadCodeElimination/boxing.kt"); } + @Test @TestMetadata("boxingNotOptimizable.kt") public void testBoxingNotOptimizable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/deadCodeElimination/boxingNotOptimizable.kt"); } + @Test @TestMetadata("emptyVariableRange.kt") public void testEmptyVariableRange() throws Exception { runTest("compiler/testData/codegen/bytecodeText/deadCodeElimination/emptyVariableRange.kt"); } + @Test @TestMetadata("kt14357.kt") public void testKt14357() throws Exception { runTest("compiler/testData/codegen/bytecodeText/deadCodeElimination/kt14357.kt"); } + @Test @TestMetadata("lastReturn.kt") public void testLastReturn() throws Exception { runTest("compiler/testData/codegen/bytecodeText/deadCodeElimination/lastReturn.kt"); } + @Test @TestMetadata("literal.kt") public void testLiteral() throws Exception { runTest("compiler/testData/codegen/bytecodeText/deadCodeElimination/literal.kt"); } + @Test @TestMetadata("simpleConstructor.kt") public void testSimpleConstructor() throws Exception { runTest("compiler/testData/codegen/bytecodeText/deadCodeElimination/simpleConstructor.kt"); } + @Test @TestMetadata("simpleConstructorNotRedundant.kt") public void testSimpleConstructorNotRedundant() throws Exception { runTest("compiler/testData/codegen/bytecodeText/deadCodeElimination/simpleConstructorNotRedundant.kt"); } + @Test @TestMetadata("simpleConstructorNotRedundantNotOptimizable.kt") public void testSimpleConstructorNotRedundantNotOptimizable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/deadCodeElimination/simpleConstructorNotRedundantNotOptimizable.kt"); } + @Test @TestMetadata("unusedPrimitiveAndObjectEquals.kt") public void testUnusedPrimitiveAndObjectEquals() throws Exception { runTest("compiler/testData/codegen/bytecodeText/deadCodeElimination/unusedPrimitiveAndObjectEquals.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/defaultArguments") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class DefaultArguments extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class DefaultArguments extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInDefaultArguments() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/defaultArguments"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("inheritedInterfaceFunction.kt") public void testInheritedInterfaceFunction() throws Exception { runTest("compiler/testData/codegen/bytecodeText/defaultArguments/inheritedInterfaceFunction.kt"); } + @Test @TestMetadata("kt11962.kt") public void testKt11962() throws Exception { runTest("compiler/testData/codegen/bytecodeText/defaultArguments/kt11962.kt"); } + @Test @TestMetadata("localVariablesInInlinedDefaultStubs.kt") public void testLocalVariablesInInlinedDefaultStubs() throws Exception { runTest("compiler/testData/codegen/bytecodeText/defaultArguments/localVariablesInInlinedDefaultStubs.kt"); } + @Test @TestMetadata("maskAndArgumentElimination.kt") public void testMaskAndArgumentElimination() throws Exception { runTest("compiler/testData/codegen/bytecodeText/defaultArguments/maskAndArgumentElimination.kt"); } + @Test @TestMetadata("maskCheckSequence.kt") public void testMaskCheckSequence() throws Exception { runTest("compiler/testData/codegen/bytecodeText/defaultArguments/maskCheckSequence.kt"); } + @Test @TestMetadata("methodHandlerElimination.kt") public void testMethodHandlerElimination() throws Exception { runTest("compiler/testData/codegen/bytecodeText/defaultArguments/methodHandlerElimination.kt"); } + @Test @TestMetadata("noAccessorForDefault.kt") public void testNoAccessorForDefault() throws Exception { runTest("compiler/testData/codegen/bytecodeText/defaultArguments/noAccessorForDefault.kt"); } + @Test @TestMetadata("noAnonymousObjectRegenerationInDefaultStub.kt") public void testNoAnonymousObjectRegenerationInDefaultStub() throws Exception { runTest("compiler/testData/codegen/bytecodeText/defaultArguments/noAnonymousObjectRegenerationInDefaultStub.kt"); } + @Test @TestMetadata("noEmptyArray.kt") public void testNoEmptyArray() throws Exception { runTest("compiler/testData/codegen/bytecodeText/defaultArguments/noEmptyArray.kt"); } + @Test @TestMetadata("noSyntheticParameters.kt") public void testNoSyntheticParameters() throws Exception { runTest("compiler/testData/codegen/bytecodeText/defaultArguments/noSyntheticParameters.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/directInvoke") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class DirectInvoke extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class DirectInvoke extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInDirectInvoke() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/directInvoke"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("callableReference.kt") public void testCallableReference() throws Exception { runTest("compiler/testData/codegen/bytecodeText/directInvoke/callableReference.kt"); } + @Test @TestMetadata("inplaceClosure.kt") public void testInplaceClosure() throws Exception { runTest("compiler/testData/codegen/bytecodeText/directInvoke/inplaceClosure.kt"); } + @Test @TestMetadata("localFun.kt") public void testLocalFun() throws Exception { runTest("compiler/testData/codegen/bytecodeText/directInvoke/localFun.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/disabledOptimizations") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class DisabledOptimizations extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class DisabledOptimizations extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInDisabledOptimizations() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/disabledOptimizations"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("noJumpInLastBranch.kt") public void testNoJumpInLastBranch() throws Exception { runTest("compiler/testData/codegen/bytecodeText/disabledOptimizations/noJumpInLastBranch.kt"); } + @Test @TestMetadata("noJumpInSingleBranch.kt") public void testNoJumpInSingleBranch() throws Exception { runTest("compiler/testData/codegen/bytecodeText/disabledOptimizations/noJumpInSingleBranch.kt"); } + @Test @TestMetadata("noObjectCastAfterReification.kt") public void testNoObjectCastAfterReification() throws Exception { runTest("compiler/testData/codegen/bytecodeText/disabledOptimizations/noObjectCastAfterReification.kt"); } + @Test @TestMetadata("noUnitInstanceInDefaultParameterInitialization.kt") public void testNoUnitInstanceInDefaultParameterInitialization() throws Exception { runTest("compiler/testData/codegen/bytecodeText/disabledOptimizations/noUnitInstanceInDefaultParameterInitialization.kt"); } + @Test @TestMetadata("noUnitInstanceOnVoidFunctionCall.kt") public void testNoUnitInstanceOnVoidFunctionCall() throws Exception { runTest("compiler/testData/codegen/bytecodeText/disabledOptimizations/noUnitInstanceOnVoidFunctionCall.kt"); } + @Test @TestMetadata("noUnusedLabel.kt") public void testNoUnusedLabel() throws Exception { runTest("compiler/testData/codegen/bytecodeText/disabledOptimizations/noUnusedLabel.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/enum") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Enum extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class Enum extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInEnum() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/enum"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("constructorAccessors.kt") public void testConstructorAccessors() throws Exception { runTest("compiler/testData/codegen/bytecodeText/enum/constructorAccessors.kt"); } + @Test @TestMetadata("enumCheckcasts.kt") public void testEnumCheckcasts() throws Exception { runTest("compiler/testData/codegen/bytecodeText/enum/enumCheckcasts.kt"); } + @Test @TestMetadata("kt18731.kt") public void testKt18731() throws Exception { runTest("compiler/testData/codegen/bytecodeText/enum/kt18731.kt"); } + @Test @TestMetadata("kt18731_2.kt") public void testKt18731_2() throws Exception { runTest("compiler/testData/codegen/bytecodeText/enum/kt18731_2.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/exclExcl") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ExclExcl extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class ExclExcl extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInExclExcl() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/exclExcl"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("primitive.kt") public void testPrimitive() throws Exception { runTest("compiler/testData/codegen/bytecodeText/exclExcl/primitive.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/fieldsForCapturedValues") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class FieldsForCapturedValues extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class FieldsForCapturedValues extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInFieldsForCapturedValues() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/fieldsForCapturedValues"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("extensionLambdaExtensionReceiver.kt") public void testExtensionLambdaExtensionReceiver() throws Exception { runTest("compiler/testData/codegen/bytecodeText/fieldsForCapturedValues/extensionLambdaExtensionReceiver.kt"); } + @Test @TestMetadata("extensionReceiver.kt") public void testExtensionReceiver() throws Exception { runTest("compiler/testData/codegen/bytecodeText/fieldsForCapturedValues/extensionReceiver.kt"); } + @Test @TestMetadata("innerAndOuterThis.kt") public void testInnerAndOuterThis() throws Exception { runTest("compiler/testData/codegen/bytecodeText/fieldsForCapturedValues/innerAndOuterThis.kt"); } + @Test @TestMetadata("labeledExtensionLambdaExtensionReceiver.kt") public void testLabeledExtensionLambdaExtensionReceiver() throws Exception { runTest("compiler/testData/codegen/bytecodeText/fieldsForCapturedValues/labeledExtensionLambdaExtensionReceiver.kt"); } + @Test @TestMetadata("multipleExtensionReceivers.kt") public void testMultipleExtensionReceivers() throws Exception { runTest("compiler/testData/codegen/bytecodeText/fieldsForCapturedValues/multipleExtensionReceivers.kt"); } + @Test @TestMetadata("outerThis.kt") public void testOuterThis() throws Exception { runTest("compiler/testData/codegen/bytecodeText/fieldsForCapturedValues/outerThis.kt"); } + @Test @TestMetadata("outerThisInInnerConstructor.kt") public void testOuterThisInInnerConstructor() throws Exception { runTest("compiler/testData/codegen/bytecodeText/fieldsForCapturedValues/outerThisInInnerConstructor.kt"); } + @Test @TestMetadata("outerThisInInnerInitBlock.kt") public void testOuterThisInInnerInitBlock() throws Exception { runTest("compiler/testData/codegen/bytecodeText/fieldsForCapturedValues/outerThisInInnerInitBlock.kt"); } + @Test @TestMetadata("this.kt") public void testThis() throws Exception { runTest("compiler/testData/codegen/bytecodeText/fieldsForCapturedValues/this.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/forLoop") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ForLoop extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class ForLoop extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInForLoop() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/forLoop"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("forInCharSequence.kt") public void testForInCharSequence() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInCharSequence.kt"); } + @Test @TestMetadata("forInCharSequenceTypeParameter.kt") public void testForInCharSequenceTypeParameter() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInCharSequenceTypeParameter.kt"); } + @Test @TestMetadata("forInDownToCharMinValue.kt") public void testForInDownToCharMinValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInDownToCharMinValue.kt"); } + @Test @TestMetadata("forInDownToIntMinValue.kt") public void testForInDownToIntMinValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInDownToIntMinValue.kt"); } + @Test @TestMetadata("forInDownToLongMinValue.kt") public void testForInDownToLongMinValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInDownToLongMinValue.kt"); } + @Test @TestMetadata("forInObjectArray.kt") public void testForInObjectArray() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInObjectArray.kt"); } + @Test @TestMetadata("forInPrimitiveArray.kt") public void testForInPrimitiveArray() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInPrimitiveArray.kt"); } + @Test @TestMetadata("forInRangeSpecializedToUntil.kt") public void testForInRangeSpecializedToUntil() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeSpecializedToUntil.kt"); } + @Test @TestMetadata("forInRangeToCharConst.kt") public void testForInRangeToCharConst() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeToCharConst.kt"); } + @Test @TestMetadata("forInRangeToCharMaxValue.kt") public void testForInRangeToCharMaxValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeToCharMaxValue.kt"); } + @Test @TestMetadata("forInRangeToConst.kt") public void testForInRangeToConst() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeToConst.kt"); } + @Test @TestMetadata("forInRangeToIntMaxValue.kt") public void testForInRangeToIntMaxValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeToIntMaxValue.kt"); } + @Test @TestMetadata("forInRangeToLongConst.kt") public void testForInRangeToLongConst() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeToLongConst.kt"); } + @Test @TestMetadata("forInRangeToLongMaxValue.kt") public void testForInRangeToLongMaxValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeToLongMaxValue.kt"); } + @Test @TestMetadata("forInRangeToQualifiedConst.kt") public void testForInRangeToQualifiedConst() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeToQualifiedConst.kt"); } + @Test @TestMetadata("forInRangeWithImplicitReceiver.kt") public void testForInRangeWithImplicitReceiver() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeWithImplicitReceiver.kt"); } + @Test @TestMetadata("forInStringSpecialized.kt") public void testForInStringSpecialized() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInStringSpecialized.kt"); } + @Test @TestMetadata("forIntInDownTo.kt") public void testForIntInDownTo() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forIntInDownTo.kt"); } + @Test @TestMetadata("iincGeneration.kt") public void testIincGeneration() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/iincGeneration.kt"); } + @Test @TestMetadata("intrinsicArrayConstructorsUseCounterLoop.kt") public void testIntrinsicArrayConstructorsUseCounterLoop() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/intrinsicArrayConstructorsUseCounterLoop.kt"); } + @Test @TestMetadata("loopVarInterval.kt") public void testLoopVarInterval() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/loopVarInterval.kt"); } + @Test @TestMetadata("primitiveLiteralRange1.kt") public void testPrimitiveLiteralRange1() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/primitiveLiteralRange1.kt"); } + @Test @TestMetadata("primitiveLiteralRange2.kt") public void testPrimitiveLiteralRange2() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/primitiveLiteralRange2.kt"); } + @Test @TestMetadata("primitiveProgression.kt") public void testPrimitiveProgression() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/primitiveProgression.kt"); } + @Test @TestMetadata("primitiveRange.kt") public void testPrimitiveRange() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/primitiveRange.kt"); } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/forLoop/forInArrayWithIndex") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ForInArrayWithIndex extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class ForInArrayWithIndex extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInForInArrayWithIndex() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/forLoop/forInArrayWithIndex"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("forInArrayWithIndexNoElementVar.kt") public void testForInArrayWithIndexNoElementVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInArrayWithIndex/forInArrayWithIndexNoElementVar.kt"); } + @Test @TestMetadata("forInArrayWithIndexNoIndexVar.kt") public void testForInArrayWithIndexNoIndexVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInArrayWithIndex/forInArrayWithIndexNoIndexVar.kt"); } + @Test @TestMetadata("forInEmptyArrayWithIndex.kt") public void testForInEmptyArrayWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInArrayWithIndex/forInEmptyArrayWithIndex.kt"); } + @Test @TestMetadata("forInIntArrayWithIndex.kt") public void testForInIntArrayWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInArrayWithIndex/forInIntArrayWithIndex.kt"); } + @Test @TestMetadata("forInObjectArrayWithIndex.kt") public void testForInObjectArrayWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInArrayWithIndex/forInObjectArrayWithIndex.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/forLoop/forInCharSequenceWithIndex") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ForInCharSequenceWithIndex extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class ForInCharSequenceWithIndex extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInForInCharSequenceWithIndex() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/forLoop/forInCharSequenceWithIndex"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("forInCharSequenceWithIndex.kt") public void testForInCharSequenceWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInCharSequenceWithIndex/forInCharSequenceWithIndex.kt"); } + @Test @TestMetadata("forInEmptyStringWithIndex.kt") public void testForInEmptyStringWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInCharSequenceWithIndex/forInEmptyStringWithIndex.kt"); } + @Test @TestMetadata("forInStringWithIndex.kt") public void testForInStringWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInCharSequenceWithIndex/forInStringWithIndex.kt"); } + @Test @TestMetadata("forInStringWithIndexNoElementVar.kt") public void testForInStringWithIndexNoElementVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInCharSequenceWithIndex/forInStringWithIndexNoElementVar.kt"); } + @Test @TestMetadata("forInStringWithIndexNoIndexVar.kt") public void testForInStringWithIndexNoIndexVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInCharSequenceWithIndex/forInStringWithIndexNoIndexVar.kt"); } + @Test @TestMetadata("forInStringWithIndexWithExplicitlyTypedIndexVariable.kt") public void testForInStringWithIndexWithExplicitlyTypedIndexVariable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInCharSequenceWithIndex/forInStringWithIndexWithExplicitlyTypedIndexVariable.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/forLoop/forInIndices") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ForInIndices extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class ForInIndices extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInForInIndices() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/forLoop/forInIndices"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("forInArrayListIndices.kt") public void testForInArrayListIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIndices/forInArrayListIndices.kt"); } + @Test @TestMetadata("forInCharSequenceIndices.kt") public void testForInCharSequenceIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIndices/forInCharSequenceIndices.kt"); } + @Test @TestMetadata("forInCharSequenceTypeParameterIndices.kt") public void testForInCharSequenceTypeParameterIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIndices/forInCharSequenceTypeParameterIndices.kt"); } + @Test @TestMetadata("forInCollectionImplicitReceiverIndices.kt") public void testForInCollectionImplicitReceiverIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIndices/forInCollectionImplicitReceiverIndices.kt"); } + @Test @TestMetadata("forInCollectionIndices.kt") public void testForInCollectionIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIndices/forInCollectionIndices.kt"); } + @Test @TestMetadata("forInCollectionTypeParameterIndices.kt") public void testForInCollectionTypeParameterIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIndices/forInCollectionTypeParameterIndices.kt"); } + @Test @TestMetadata("forInNonOptimizedIndices.kt") public void testForInNonOptimizedIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIndices/forInNonOptimizedIndices.kt"); } + @Test @TestMetadata("forInObjectArrayIndices.kt") public void testForInObjectArrayIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIndices/forInObjectArrayIndices.kt"); } + @Test @TestMetadata("forInPrimitiveArrayIndices.kt") public void testForInPrimitiveArrayIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIndices/forInPrimitiveArrayIndices.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/forLoop/forInIterableWithIndex") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ForInIterableWithIndex extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class ForInIterableWithIndex extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInForInIterableWithIndex() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/forLoop/forInIterableWithIndex"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("forInEmptyListWithIndex.kt") public void testForInEmptyListWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIterableWithIndex/forInEmptyListWithIndex.kt"); } + @Test @TestMetadata("forInIterableTypeParameterWithIndex.kt") public void testForInIterableTypeParameterWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIterableWithIndex/forInIterableTypeParameterWithIndex.kt"); } + @Test @TestMetadata("forInListWithIndex.kt") public void testForInListWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIterableWithIndex/forInListWithIndex.kt"); } + @Test @TestMetadata("forInListWithIndexNoElementVar.kt") public void testForInListWithIndexNoElementVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIterableWithIndex/forInListWithIndexNoElementVar.kt"); } + @Test @TestMetadata("forInListWithIndexNoIndexVar.kt") public void testForInListWithIndexNoIndexVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIterableWithIndex/forInListWithIndexNoIndexVar.kt"); } + @Test @TestMetadata("forInListWithIndexWithExplicitlyTypedIndexVariable.kt") public void testForInListWithIndexWithExplicitlyTypedIndexVariable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIterableWithIndex/forInListWithIndexWithExplicitlyTypedIndexVariable.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ForInProgressionWithIndex extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class ForInProgressionWithIndex extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInForInProgressionWithIndex() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("forInDownToWithIndex.kt") public void testForInDownToWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInDownToWithIndex.kt"); } + @Test @TestMetadata("forInIndicesWithIndex.kt") public void testForInIndicesWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInIndicesWithIndex.kt"); } + @Test @TestMetadata("forInRangeToWithIndex.kt") public void testForInRangeToWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInRangeToWithIndex.kt"); } + @Test @TestMetadata("forInReversedStepWithIndex.kt") public void testForInReversedStepWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInReversedStepWithIndex.kt"); } + @Test @TestMetadata("forInReversedWithIndex.kt") public void testForInReversedWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInReversedWithIndex.kt"); } + @Test @TestMetadata("forInStepReversedWithIndex.kt") public void testForInStepReversedWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInStepReversedWithIndex.kt"); } + @Test @TestMetadata("forInStepWithIndex.kt") public void testForInStepWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInStepWithIndex.kt"); } + @Test @TestMetadata("forInUntilWithIndex.kt") public void testForInUntilWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInUntilWithIndex.kt"); } + @Test @TestMetadata("forInWithIndexNoIndexOrElementVar.kt") public void testForInWithIndexNoIndexOrElementVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInWithIndexNoIndexOrElementVar.kt"); } + @Test @TestMetadata("forInWithIndexNotDestructured.kt") public void testForInWithIndexNotDestructured() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInWithIndexNotDestructured.kt"); } + @Test @TestMetadata("forInWithIndexReversed.kt") public void testForInWithIndexReversed() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInWithIndexReversed.kt"); } + @Test @TestMetadata("forInWithIndexWithIndex.kt") public void testForInWithIndexWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInWithIndexWithIndex.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/forLoop/forInReversed") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ForInReversed extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class ForInReversed extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInForInReversed() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/forLoop/forInReversed"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("forInReversedArrayIndices.kt") public void testForInReversedArrayIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInReversed/forInReversedArrayIndices.kt"); } + @Test @TestMetadata("forInReversedCharSequenceIndices.kt") public void testForInReversedCharSequenceIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInReversed/forInReversedCharSequenceIndices.kt"); } + @Test @TestMetadata("forInReversedCollectionIndices.kt") public void testForInReversedCollectionIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInReversed/forInReversedCollectionIndices.kt"); } + @Test @TestMetadata("forInReversedDownTo.kt") public void testForInReversedDownTo() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInReversed/forInReversedDownTo.kt"); } + @Test @TestMetadata("forInReversedEmptyRangeLiteral.kt") public void testForInReversedEmptyRangeLiteral() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInReversed/forInReversedEmptyRangeLiteral.kt"); } + @Test @TestMetadata("forInReversedRange.kt") public void testForInReversedRange() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInReversed/forInReversedRange.kt"); } + @Test @TestMetadata("forInReversedRangeLiteral.kt") public void testForInReversedRangeLiteral() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInReversed/forInReversedRangeLiteral.kt"); } + @Test @TestMetadata("forInReversedReversedArrayIndices.kt") public void testForInReversedReversedArrayIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInReversed/forInReversedReversedArrayIndices.kt"); } + @Test @TestMetadata("forInReversedReversedDownTo.kt") public void testForInReversedReversedDownTo() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInReversed/forInReversedReversedDownTo.kt"); } + @Test @TestMetadata("ForInReversedReversedRange.kt") public void testForInReversedReversedRange() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInReversed/ForInReversedReversedRange.kt"); } + @Test @TestMetadata("forInReversedReversedReversedRange.kt") public void testForInReversedReversedReversedRange() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInReversed/forInReversedReversedReversedRange.kt"); } + @Test @TestMetadata("forInReversedReversedUntil.kt") public void testForInReversedReversedUntil() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInReversed/forInReversedReversedUntil.kt"); } + @Test @TestMetadata("forInReversedUntil.kt") public void testForInReversedUntil() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInReversed/forInReversedUntil.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/forLoop/forInSequenceWithIndex") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ForInSequenceWithIndex extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class ForInSequenceWithIndex extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInForInSequenceWithIndex() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/forLoop/forInSequenceWithIndex"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("forInEmptySequenceWithIndex.kt") public void testForInEmptySequenceWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInSequenceWithIndex/forInEmptySequenceWithIndex.kt"); } + @Test @TestMetadata("forInSequenceTypeParameterWithIndex.kt") public void testForInSequenceTypeParameterWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInSequenceWithIndex/forInSequenceTypeParameterWithIndex.kt"); } + @Test @TestMetadata("forInSequenceWithIndex.kt") public void testForInSequenceWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInSequenceWithIndex/forInSequenceWithIndex.kt"); } + @Test @TestMetadata("forInSequenceWithIndexNoElementVar.kt") public void testForInSequenceWithIndexNoElementVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInSequenceWithIndex/forInSequenceWithIndexNoElementVar.kt"); } + @Test @TestMetadata("forInSequenceWithIndexNoIndexVar.kt") public void testForInSequenceWithIndexNoIndexVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInSequenceWithIndex/forInSequenceWithIndexNoIndexVar.kt"); } + @Test @TestMetadata("forInSequenceWithIndexThrowsCME.kt") public void testForInSequenceWithIndexThrowsCME() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInSequenceWithIndex/forInSequenceWithIndexThrowsCME.kt"); } + @Test @TestMetadata("forInSequenceWithIndexWithExplicitlyTypedIndexVariable.kt") public void testForInSequenceWithIndexWithExplicitlyTypedIndexVariable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInSequenceWithIndex/forInSequenceWithIndexWithExplicitlyTypedIndexVariable.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/forLoop/forInUntil") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ForInUntil extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class ForInUntil extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInForInUntil() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/forLoop/forInUntil"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("forInUntilChar.kt") public void testForInUntilChar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInUntil/forInUntilChar.kt"); } + @Test @TestMetadata("forInUntilCharMaxValue.kt") public void testForInUntilCharMaxValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInUntil/forInUntilCharMaxValue.kt"); } + @Test @TestMetadata("forInUntilCharMinValue.kt") public void testForInUntilCharMinValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInUntil/forInUntilCharMinValue.kt"); } + @Test @TestMetadata("forInUntilInt.kt") public void testForInUntilInt() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInUntil/forInUntilInt.kt"); } + @Test @TestMetadata("forInUntilIntMaxValue.kt") public void testForInUntilIntMaxValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInUntil/forInUntilIntMaxValue.kt"); } + @Test @TestMetadata("forInUntilIntMinValue.kt") public void testForInUntilIntMinValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInUntil/forInUntilIntMinValue.kt"); } + @Test @TestMetadata("forInUntilLong.kt") public void testForInUntilLong() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInUntil/forInUntilLong.kt"); } + @Test @TestMetadata("forInUntilLongMaxValue.kt") public void testForInUntilLongMaxValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInUntil/forInUntilLongMaxValue.kt"); } + @Test @TestMetadata("forInUntilLongMinValue.kt") public void testForInUntilLongMinValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInUntil/forInUntilLongMinValue.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/forLoop/stepped") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Stepped extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class Stepped extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInStepped() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/forLoop/stepped"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/forLoop/unsigned") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Unsigned extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class Unsigned extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInUnsigned() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/forLoop/unsigned"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("forInDownToUIntMinValue.kt") public void testForInDownToUIntMinValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInDownToUIntMinValue.kt"); } + @Test @TestMetadata("forInDownToULongMinValue.kt") public void testForInDownToULongMinValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInDownToULongMinValue.kt"); } + @Test @TestMetadata("forInOptimizableUnsignedRange.kt") public void testForInOptimizableUnsignedRange() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInOptimizableUnsignedRange.kt"); } + @Test @TestMetadata("forInRangeToUIntMaxValue.kt") public void testForInRangeToUIntMaxValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInRangeToUIntMaxValue.kt"); } + @Test @TestMetadata("forInRangeToULongMaxValue.kt") public void testForInRangeToULongMaxValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInRangeToULongMaxValue.kt"); } + @Test @TestMetadata("forInUntilUIntMaxValue.kt") public void testForInUntilUIntMaxValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInUntilUIntMaxValue.kt"); } + @Test @TestMetadata("forInUntilUIntMinValue.kt") public void testForInUntilUIntMinValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInUntilUIntMinValue.kt"); } + @Test @TestMetadata("forInUntilULongMaxValue.kt") public void testForInUntilULongMaxValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInUntilULongMaxValue.kt"); } + @Test @TestMetadata("forInUntilULongMinValue.kt") public void testForInUntilULongMinValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInUntilULongMinValue.kt"); @@ -2686,201 +2977,219 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest { } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/hashCode") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class HashCode extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class HashCode extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInHashCode() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/hashCode"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("hashCode.kt") public void testHashCode() throws Exception { runTest("compiler/testData/codegen/bytecodeText/hashCode/hashCode.kt"); } + @Test @TestMetadata("interfaceHashCode.kt") public void testInterfaceHashCode() throws Exception { runTest("compiler/testData/codegen/bytecodeText/hashCode/interfaceHashCode.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/ieee754") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Ieee754 extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class Ieee754 extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInIeee754() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/ieee754"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("nullableDoubleEquals.kt") public void testNullableDoubleEquals() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ieee754/nullableDoubleEquals.kt"); } + @Test @TestMetadata("nullableDoubleNotEquals.kt") public void testNullableDoubleNotEquals() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ieee754/nullableDoubleNotEquals.kt"); } + @Test @TestMetadata("nullableFloatEquals.kt") public void testNullableFloatEquals() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ieee754/nullableFloatEquals.kt"); } + @Test @TestMetadata("nullableFloatNotEquals.kt") public void testNullableFloatNotEquals() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ieee754/nullableFloatNotEquals.kt"); } + @Test @TestMetadata("smartCastsForDouble.kt") public void testSmartCastsForDouble() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ieee754/smartCastsForDouble.kt"); } + @Test @TestMetadata("smartCastsForFloat.kt") public void testSmartCastsForFloat() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ieee754/smartCastsForFloat.kt"); } + @Test @TestMetadata("when.kt") public void testWhen() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ieee754/when.kt"); } + @Test @TestMetadata("whenNullableSmartCast.kt") public void testWhenNullableSmartCast() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ieee754/whenNullableSmartCast.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/inline") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Inline extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class Inline extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInInline() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/inline"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("deleteClassOnTransformation.kt") public void testDeleteClassOnTransformation() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/deleteClassOnTransformation.kt"); } + @Test @TestMetadata("finallyMarkers.kt") public void testFinallyMarkers() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/finallyMarkers.kt"); } + @Test @TestMetadata("inlineArgumentSlots.kt") public void testInlineArgumentSlots() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/inlineArgumentSlots.kt"); } + @Test @TestMetadata("inlineReturnsNothing1.kt") public void testInlineReturnsNothing1() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/inlineReturnsNothing1.kt"); } + @Test @TestMetadata("inlineReturnsNothing2.kt") public void testInlineReturnsNothing2() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/inlineReturnsNothing2.kt"); } + @Test @TestMetadata("inlineReturnsNothing3.kt") public void testInlineReturnsNothing3() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/inlineReturnsNothing3.kt"); } + @Test @TestMetadata("inlineSuspendReifiedNoSpilling.kt") public void testInlineSuspendReifiedNoSpilling() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/inlineSuspendReifiedNoSpilling.kt"); } + @Test @TestMetadata("interfaceDefaultMethod.kt") public void testInterfaceDefaultMethod() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/interfaceDefaultMethod.kt"); } + @Test @TestMetadata("linenumberForOneParametersArgumentCall.kt") public void testLinenumberForOneParametersArgumentCall() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/linenumberForOneParametersArgumentCall.kt"); } + @Test @TestMetadata("noSynAccessor.kt") public void testNoSynAccessor() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/noSynAccessor.kt"); } + @Test @TestMetadata("noSynAccessorToDirectFieldAccess.kt") public void testNoSynAccessorToDirectFieldAccess() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/noSynAccessorToDirectFieldAccess.kt"); } + @Test @TestMetadata("noSynAccessorToSuper.kt") public void testNoSynAccessorToSuper() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/noSynAccessorToSuper.kt"); } + @Test @TestMetadata("notSplitedExceptionTable.kt") public void testNotSplitedExceptionTable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/notSplitedExceptionTable.kt"); } + @Test @TestMetadata("reifiedSafeAsWithMutable.kt") public void testReifiedSafeAsWithMutable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/reifiedSafeAsWithMutable.kt"); } + @Test @TestMetadata("remappedLocalVar.kt") public void testRemappedLocalVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/remappedLocalVar.kt"); } + @Test @TestMetadata("removedFinallyMarkers.kt") public void testRemovedFinallyMarkers() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/removedFinallyMarkers.kt"); } + @Test @TestMetadata("specialEnumFunction.kt") public void testSpecialEnumFunction() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/specialEnumFunction.kt"); } + @Test @TestMetadata("splitedExceptionTable.kt") public void testSplitedExceptionTable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/splitedExceptionTable.kt"); } + @Test @TestMetadata("whenMappingOnCallSite.kt") public void testWhenMappingOnCallSite() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/whenMappingOnCallSite.kt"); } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/inline/property") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Property extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class Property extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInProperty() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/inline/property"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/property/simple.kt"); @@ -2888,646 +3197,714 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest { } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/inlineClasses") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class InlineClasses extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class InlineClasses extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInInlineClasses() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/inlineClasses"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("asCastForInlineClass.kt") public void testAsCastForInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/asCastForInlineClass.kt"); } + @Test @TestMetadata("assertionsForParametersOfInlineClassTypes.kt") public void testAssertionsForParametersOfInlineClassTypes() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/assertionsForParametersOfInlineClassTypes.kt"); } + @Test @TestMetadata("boxInlineClassInsideElvisWithNullConstant.kt") public void testBoxInlineClassInsideElvisWithNullConstant() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/boxInlineClassInsideElvisWithNullConstant.kt"); } + @Test @TestMetadata("boxInlineClassesOnPassingToVarargs.kt") public void testBoxInlineClassesOnPassingToVarargs() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/boxInlineClassesOnPassingToVarargs.kt"); } + @Test @TestMetadata("boxMethodCalledByInlineClass.kt") public void testBoxMethodCalledByInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/boxMethodCalledByInlineClass.kt"); } + @Test @TestMetadata("boxResultAfterConstructorCall.kt") public void testBoxResultAfterConstructorCall() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/boxResultAfterConstructorCall.kt"); } + @Test @TestMetadata("boxResultInlineClassOfConstructorCall.kt") public void testBoxResultInlineClassOfConstructorCall() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/boxResultInlineClassOfConstructorCall.kt"); } + @Test @TestMetadata("boxThisOfInlineClass.kt") public void testBoxThisOfInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/boxThisOfInlineClass.kt"); } + @Test @TestMetadata("boxUnboxInlineClassFromMethodReturnType.kt") public void testBoxUnboxInlineClassFromMethodReturnType() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/boxUnboxInlineClassFromMethodReturnType.kt"); } + @Test @TestMetadata("boxUnboxInsideLambdaAsLastExpression.kt") public void testBoxUnboxInsideLambdaAsLastExpression() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/boxUnboxInsideLambdaAsLastExpression.kt"); } + @Test @TestMetadata("boxUnboxOfInlineClassesWithFunctionalTypes.kt") public void testBoxUnboxOfInlineClassesWithFunctionalTypes() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/boxUnboxOfInlineClassesWithFunctionalTypes.kt"); } + @Test @TestMetadata("boxUnboxOnInlinedParameters.kt") public void testBoxUnboxOnInlinedParameters() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/boxUnboxOnInlinedParameters.kt"); } + @Test @TestMetadata("boxingForNonLocalAndLabeledReturnsOfInlineClasses.kt") public void testBoxingForNonLocalAndLabeledReturnsOfInlineClasses() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/boxingForNonLocalAndLabeledReturnsOfInlineClasses.kt"); } + @Test @TestMetadata("callMemberMethodsInsideInlineClass.kt") public void testCallMemberMethodsInsideInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/callMemberMethodsInsideInlineClass.kt"); } + @Test @TestMetadata("checkBoxingInInlineClass.kt") public void testCheckBoxingInInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/checkBoxingInInlineClass.kt"); } + @Test @TestMetadata("checkOuterInlineFunctionCall.kt") public void testCheckOuterInlineFunctionCall() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/checkOuterInlineFunctionCall.kt"); } + @Test @TestMetadata("constructorBridge.kt") public void testConstructorBridge() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/constructorBridge.kt"); } + @Test @TestMetadata("constructorWithDefaultArguments.kt") public void testConstructorWithDefaultArguments() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/constructorWithDefaultArguments.kt"); } + @Test @TestMetadata("defaultParametersDontBox.kt") public void testDefaultParametersDontBox() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/defaultParametersDontBox.kt"); } + @Test @TestMetadata("delegatedPropertyMangling.kt") public void testDelegatedPropertyMangling() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/delegatedPropertyMangling.kt"); } + @Test @TestMetadata("equalsDoesNotBox.kt") public void testEqualsDoesNotBox() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/equalsDoesNotBox.kt"); } + @Test @TestMetadata("equalsIsCalledByInlineClass.kt") public void testEqualsIsCalledByInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/equalsIsCalledByInlineClass.kt"); } + @Test @TestMetadata("factoryMethodForSecondaryConstructorsCalledByInlineClass.kt") public void testFactoryMethodForSecondaryConstructorsCalledByInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/factoryMethodForSecondaryConstructorsCalledByInlineClass.kt"); } + @Test @TestMetadata("functionsWithInlineClassParametersHaveStableMangledNames.kt") public void testFunctionsWithInlineClassParametersHaveStableMangledNames() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/functionsWithInlineClassParametersHaveStableMangledNames.kt"); } + @Test @TestMetadata("generationOfAccessorToUnderlyingValue.kt") public void testGenerationOfAccessorToUnderlyingValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/generationOfAccessorToUnderlyingValue.kt"); } + @Test @TestMetadata("hashCodeIsCalledByInlineClass.kt") public void testHashCodeIsCalledByInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/hashCodeIsCalledByInlineClass.kt"); } + @Test @TestMetadata("inlineClassBoxingOnAssignment.kt") public void testInlineClassBoxingOnAssignment() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/inlineClassBoxingOnAssignment.kt"); } + @Test @TestMetadata("inlineClassBoxingOnFunctionCall.kt") public void testInlineClassBoxingOnFunctionCall() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/inlineClassBoxingOnFunctionCall.kt"); } + @Test @TestMetadata("inlineClassBoxingUnboxingInsideInlinedLambda.kt") public void testInlineClassBoxingUnboxingInsideInlinedLambda() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/inlineClassBoxingUnboxingInsideInlinedLambda.kt"); } + @Test @TestMetadata("inlineClassInGeneratedToString.kt") public void testInlineClassInGeneratedToString() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/inlineClassInGeneratedToString.kt"); } + @Test @TestMetadata("inlineClassInStringTemplate.kt") public void testInlineClassInStringTemplate() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/inlineClassInStringTemplate.kt"); } + @Test @TestMetadata("inlineClassesUnboxingAfterAssertionOperator.kt") public void testInlineClassesUnboxingAfterAssertionOperator() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/inlineClassesUnboxingAfterAssertionOperator.kt"); } + @Test @TestMetadata("interfaceDefaultImplStubs.kt") public void testInterfaceDefaultImplStubs() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/interfaceDefaultImplStubs.kt"); } + @Test @TestMetadata("interfaceJvmDefaultImplStubs.kt") public void testInterfaceJvmDefaultImplStubs() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/interfaceJvmDefaultImplStubs.kt"); } + @Test @TestMetadata("isCheckForInlineClass.kt") public void testIsCheckForInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/isCheckForInlineClass.kt"); } + @Test @TestMetadata("mangledInlineClassInterfaceImplementation.kt") public void testMangledInlineClassInterfaceImplementation() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/mangledInlineClassInterfaceImplementation.kt"); } + @Test @TestMetadata("noActualCallsOfInlineFunctionsOfInlineClass.kt") public void testNoActualCallsOfInlineFunctionsOfInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/noActualCallsOfInlineFunctionsOfInlineClass.kt"); } + @Test @TestMetadata("noAssertionsForInlineClassesBasedOnNullableTypes.kt") public void testNoAssertionsForInlineClassesBasedOnNullableTypes() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/noAssertionsForInlineClassesBasedOnNullableTypes.kt"); } + @Test @TestMetadata("noBoxingInMethod.kt") public void testNoBoxingInMethod() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/noBoxingInMethod.kt"); } + @Test @TestMetadata("noBoxingOnCastOperations.kt") public void testNoBoxingOnCastOperations() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/noBoxingOnCastOperations.kt"); } + @Test @TestMetadata("noBoxingOperationsOnNonTrivialSpread.kt") public void testNoBoxingOperationsOnNonTrivialSpread() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/noBoxingOperationsOnNonTrivialSpread.kt"); } + @Test @TestMetadata("noBoxingUnboxingInAccessorsForDelegatedPropertyWithInlineClassDelegate.kt") public void testNoBoxingUnboxingInAccessorsForDelegatedPropertyWithInlineClassDelegate() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/noBoxingUnboxingInAccessorsForDelegatedPropertyWithInlineClassDelegate.kt"); } + @Test @TestMetadata("noManglingForFunctionsWithJvmName.kt") public void testNoManglingForFunctionsWithJvmName() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/noManglingForFunctionsWithJvmName.kt"); } + @Test @TestMetadata("noReturnTypeMangling.kt") public void testNoReturnTypeMangling() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/noReturnTypeMangling.kt"); } + @Test @TestMetadata("nonOverridingMethodsAreCalledByInlineClass.kt") public void testNonOverridingMethodsAreCalledByInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/nonOverridingMethodsAreCalledByInlineClass.kt"); } + @Test @TestMetadata("overridingMethodsAreCalledByInlineClass.kt") public void testOverridingMethodsAreCalledByInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/overridingMethodsAreCalledByInlineClass.kt"); } + @Test @TestMetadata("passInlineClassesWithSpreadOperatorToVarargs.kt") public void testPassInlineClassesWithSpreadOperatorToVarargs() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/passInlineClassesWithSpreadOperatorToVarargs.kt"); } + @Test @TestMetadata("primaryConstructorCalledByInlineClass.kt") public void testPrimaryConstructorCalledByInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/primaryConstructorCalledByInlineClass.kt"); } + @Test @TestMetadata("propertyAccessorsAreCalledByInlineClass.kt") public void testPropertyAccessorsAreCalledByInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/propertyAccessorsAreCalledByInlineClass.kt"); } + @Test @TestMetadata("propertySetterWithInlineClassTypeArgument.kt") public void testPropertySetterWithInlineClassTypeArgument() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/propertySetterWithInlineClassTypeArgument.kt"); } + @Test @TestMetadata("resultApiDoesntCallSpecializedEquals.kt") public void testResultApiDoesntCallSpecializedEquals() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/resultApiDoesntCallSpecializedEquals.kt"); } + @Test @TestMetadata("resultApiDoesntUseBox.kt") public void testResultApiDoesntUseBox() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/resultApiDoesntUseBox.kt"); } + @Test @TestMetadata("resultApiEqualsDoesntBox.kt") public void testResultApiEqualsDoesntBox() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/resultApiEqualsDoesntBox.kt"); } + @Test @TestMetadata("resultApiRunCatchingDoesntBox.kt") public void testResultApiRunCatchingDoesntBox() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/resultApiRunCatchingDoesntBox.kt"); } + @Test @TestMetadata("resultApiStringInterpolationDoesntBox.kt") public void testResultApiStringInterpolationDoesntBox() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/resultApiStringInterpolationDoesntBox.kt"); } + @Test @TestMetadata("resultMangling.kt") public void testResultMangling() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/resultMangling.kt"); } + @Test @TestMetadata("skipCallToUnderlyingValueOfInlineClass.kt") public void testSkipCallToUnderlyingValueOfInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/skipCallToUnderlyingValueOfInlineClass.kt"); } + @Test @TestMetadata("suspendFunctionMangling.kt") public void testSuspendFunctionMangling() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/suspendFunctionMangling.kt"); } + @Test @TestMetadata("toStringOfInlineClassValue.kt") public void testToStringOfInlineClassValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/toStringOfInlineClassValue.kt"); } + @Test @TestMetadata("toStringOfReferenceInlineClassValue.kt") public void testToStringOfReferenceInlineClassValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/toStringOfReferenceInlineClassValue.kt"); } + @Test @TestMetadata("uIntArrayIteratorWithoutBoxing.kt") public void testUIntArrayIteratorWithoutBoxing() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/uIntArrayIteratorWithoutBoxing.kt"); } + @Test @TestMetadata("uIntArraySwapBoxing.kt") public void testUIntArraySwapBoxing() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/uIntArraySwapBoxing.kt"); } + @Test @TestMetadata("unboxInlineClassAfterElvis.kt") public void testUnboxInlineClassAfterElvis() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/unboxInlineClassAfterElvis.kt"); } + @Test @TestMetadata("unboxInlineClassAfterSafeCall.kt") public void testUnboxInlineClassAfterSafeCall() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/unboxInlineClassAfterSafeCall.kt"); } + @Test @TestMetadata("unboxInlineClassFromParameterizedType.kt") public void testUnboxInlineClassFromParameterizedType() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/unboxInlineClassFromParameterizedType.kt"); } + @Test @TestMetadata("unboxInlineClassesAfterSmartCasts.kt") public void testUnboxInlineClassesAfterSmartCasts() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/unboxInlineClassesAfterSmartCasts.kt"); } + @Test @TestMetadata("unboxMethodCalledByInlineClass.kt") public void testUnboxMethodCalledByInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/unboxMethodCalledByInlineClass.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/innerClasses") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class InnerClasses extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class InnerClasses extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInInnerClasses() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/innerClasses"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("nestedClassInAnnotationArgument.kt") public void testNestedClassInAnnotationArgument() throws Exception { runTest("compiler/testData/codegen/bytecodeText/innerClasses/nestedClassInAnnotationArgument.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/interfaces") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Interfaces extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class Interfaces extends AbstractBytecodeTextTest { + @Test @TestMetadata("addedInterfaceBridge.kt") public void testAddedInterfaceBridge() throws Exception { runTest("compiler/testData/codegen/bytecodeText/interfaces/addedInterfaceBridge.kt"); } + @Test public void testAllFilesPresentInInterfaces() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/interfaces"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("firstInheritedMethodIsAbstract.kt") public void testFirstInheritedMethodIsAbstract() throws Exception { runTest("compiler/testData/codegen/bytecodeText/interfaces/firstInheritedMethodIsAbstract.kt"); } + @Test @TestMetadata("noAnyMethodsOnInterfaceInheritance.kt") public void testNoAnyMethodsOnInterfaceInheritance() throws Exception { runTest("compiler/testData/codegen/bytecodeText/interfaces/noAnyMethodsOnInterfaceInheritance.kt"); } + @Test @TestMetadata("noPrivateMemberInJavaInterface.kt") public void testNoPrivateMemberInJavaInterface() throws Exception { runTest("compiler/testData/codegen/bytecodeText/interfaces/noPrivateMemberInJavaInterface.kt"); } + @Test @TestMetadata("traitImplGeneratedOnce.kt") public void testTraitImplGeneratedOnce() throws Exception { runTest("compiler/testData/codegen/bytecodeText/interfaces/traitImplGeneratedOnce.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/intrinsics") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Intrinsics extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class Intrinsics extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInIntrinsics() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/intrinsics"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("javaObjectType.kt") public void testJavaObjectType() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsics/javaObjectType.kt"); } + @Test @TestMetadata("javaPrimitiveType.kt") public void testJavaPrimitiveType() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsics/javaPrimitiveType.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/intrinsicsCompare") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class IntrinsicsCompare extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class IntrinsicsCompare extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInIntrinsicsCompare() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/intrinsicsCompare"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("byteSmartCast_after.kt") public void testByteSmartCast_after() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsicsCompare/byteSmartCast_after.kt"); } + @Test @TestMetadata("byteSmartCast_before.kt") public void testByteSmartCast_before() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsicsCompare/byteSmartCast_before.kt"); } + @Test @TestMetadata("charSmartCast.kt") public void testCharSmartCast() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsicsCompare/charSmartCast.kt"); } + @Test @TestMetadata("differentTypes_after.kt") public void testDifferentTypes_after() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsicsCompare/differentTypes_after.kt"); } + @Test @TestMetadata("differentTypes_before.kt") public void testDifferentTypes_before() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsicsCompare/differentTypes_before.kt"); } + @Test @TestMetadata("intSmartCast_after.kt") public void testIntSmartCast_after() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsicsCompare/intSmartCast_after.kt"); } + @Test @TestMetadata("intSmartCast_before.kt") public void testIntSmartCast_before() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsicsCompare/intSmartCast_before.kt"); } + @Test @TestMetadata("longSmartCast.kt") public void testLongSmartCast() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsicsCompare/longSmartCast.kt"); } + @Test @TestMetadata("shortSmartCast_after.kt") public void testShortSmartCast_after() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsicsCompare/shortSmartCast_after.kt"); } + @Test @TestMetadata("shortSmartCast_before.kt") public void testShortSmartCast_before() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsicsCompare/shortSmartCast_before.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/intrinsicsTrim") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class IntrinsicsTrim extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class IntrinsicsTrim extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInIntrinsicsTrim() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/intrinsicsTrim"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("trimIndentNegative.kt") public void testTrimIndentNegative() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsicsTrim/trimIndentNegative.kt"); } + @Test @TestMetadata("trimIndentPositive.kt") public void testTrimIndentPositive() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsicsTrim/trimIndentPositive.kt"); } + @Test @TestMetadata("trimMarginNegative.kt") public void testTrimMarginNegative() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsicsTrim/trimMarginNegative.kt"); } + @Test @TestMetadata("trimMarginPositive.kt") public void testTrimMarginPositive() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsicsTrim/trimMarginPositive.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/jvm8") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Jvm8 extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class Jvm8 extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInJvm8() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/jvm8"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/jvm8/hashCode") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class HashCode extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class HashCode extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInHashCode() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/jvm8/hashCode"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("dataClass.kt") public void testDataClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/jvm8/hashCode/dataClass.kt"); } + @Test @TestMetadata("hashCode.kt") public void testHashCode() throws Exception { runTest("compiler/testData/codegen/bytecodeText/jvm8/hashCode/hashCode.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class JvmDefault extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class JvmDefault extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInJvmDefault() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault/allCompatibility") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class AllCompatibility extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class AllCompatibility extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInAllCompatibility() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault/allCompatibility"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("defaultArgs.kt") public void testDefaultArgs() throws Exception { runTest("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault/allCompatibility/defaultArgs.kt"); } + @Test @TestMetadata("simpleDiamond.kt") public void testSimpleDiamond() throws Exception { runTest("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault/allCompatibility/simpleDiamond.kt"); } + @Test @TestMetadata("simpleFunction.kt") public void testSimpleFunction() throws Exception { runTest("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault/allCompatibility/simpleFunction.kt"); } + @Test @TestMetadata("simpleFunctionWithAbstractOverride.kt") public void testSimpleFunctionWithAbstractOverride() throws Exception { runTest("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault/allCompatibility/simpleFunctionWithAbstractOverride.kt"); } + @Test @TestMetadata("simpleProperty.kt") public void testSimpleProperty() throws Exception { runTest("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault/allCompatibility/simpleProperty.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault/compatibility") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Compatibility extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class Compatibility extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInCompatibility() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault/compatibility"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("defaultArgs.kt") public void testDefaultArgs() throws Exception { runTest("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault/compatibility/defaultArgs.kt"); } + @Test @TestMetadata("simpleDiamond.kt") public void testSimpleDiamond() throws Exception { runTest("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault/compatibility/simpleDiamond.kt"); } + @Test @TestMetadata("simpleFunction.kt") public void testSimpleFunction() throws Exception { runTest("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault/compatibility/simpleFunction.kt"); } + @Test @TestMetadata("simpleFunctionWithAbstractOverride.kt") public void testSimpleFunctionWithAbstractOverride() throws Exception { runTest("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault/compatibility/simpleFunctionWithAbstractOverride.kt"); } + @Test @TestMetadata("simpleProperty.kt") public void testSimpleProperty() throws Exception { runTest("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault/compatibility/simpleProperty.kt"); @@ -3536,498 +3913,553 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest { } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/lazyCodegen") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class LazyCodegen extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class LazyCodegen extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInLazyCodegen() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/lazyCodegen"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("inlineConstInsideComparison.kt") public void testInlineConstInsideComparison() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lazyCodegen/inlineConstInsideComparison.kt"); } + @Test @TestMetadata("negateConst.kt") public void testNegateConst() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lazyCodegen/negateConst.kt"); } + @Test @TestMetadata("negateConstantCompare.kt") public void testNegateConstantCompare() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lazyCodegen/negateConstantCompare.kt"); } + @Test @TestMetadata("negateObjectComp.kt") public void testNegateObjectComp() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lazyCodegen/negateObjectComp.kt"); } + @Test @TestMetadata("negateObjectCompChaing.kt") public void testNegateObjectCompChaing() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lazyCodegen/negateObjectCompChaing.kt"); } + @Test @TestMetadata("negateVar.kt") public void testNegateVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lazyCodegen/negateVar.kt"); } + @Test @TestMetadata("negateVarChain.kt") public void testNegateVarChain() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lazyCodegen/negateVarChain.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/lineNumbers") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class LineNumbers extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class LineNumbers extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInLineNumbers() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/lineNumbers"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("ifConsts.kt") public void testIfConsts() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lineNumbers/ifConsts.kt"); } + @Test @TestMetadata("ifElse.kt") public void testIfElse() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lineNumbers/ifElse.kt"); } + @Test @TestMetadata("ifFalse.kt") public void testIfFalse() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lineNumbers/ifFalse.kt"); } + @Test @TestMetadata("ifFalseElse.kt") public void testIfFalseElse() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lineNumbers/ifFalseElse.kt"); } + @Test @TestMetadata("ifTrue.kt") public void testIfTrue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lineNumbers/ifTrue.kt"); } + @Test @TestMetadata("ifTrueElse.kt") public void testIfTrueElse() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lineNumbers/ifTrueElse.kt"); } + @Test @TestMetadata("inlineCondition.kt") public void testInlineCondition() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lineNumbers/inlineCondition.kt"); } + @Test @TestMetadata("inlineCondition2.kt") public void testInlineCondition2() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lineNumbers/inlineCondition2.kt"); } + @Test @TestMetadata("inlineLambdaObjectInit.kt") public void testInlineLambdaObjectInit() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lineNumbers/inlineLambdaObjectInit.kt"); } + @Test @TestMetadata("singleThen.kt") public void testSingleThen() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lineNumbers/singleThen.kt"); } + @Test @TestMetadata("tryCatch.kt") public void testTryCatch() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lineNumbers/tryCatch.kt"); } + @Test @TestMetadata("when.kt") public void testWhen() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lineNumbers/when.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/localInitializationLVT") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class LocalInitializationLVT extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class LocalInitializationLVT extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInLocalInitializationLVT() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/localInitializationLVT"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("boxing.kt") public void testBoxing() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/boxing.kt"); } + @Test @TestMetadata("boxingVar.kt") public void testBoxingVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/boxingVar.kt"); } + @Test @TestMetadata("contract.kt") public void testContract() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/contract.kt"); } + @Test @TestMetadata("contractVar.kt") public void testContractVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/contractVar.kt"); } + @Test @TestMetadata("generics.kt") public void testGenerics() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/generics.kt"); } + @Test @TestMetadata("genericsVar.kt") public void testGenericsVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/genericsVar.kt"); } + @Test @TestMetadata("ifStatement.kt") public void testIfStatement() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/ifStatement.kt"); } + @Test @TestMetadata("ifStatementVar.kt") public void testIfStatementVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/ifStatementVar.kt"); } + @Test @TestMetadata("ifStatementWithoutBlock.kt") public void testIfStatementWithoutBlock() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/ifStatementWithoutBlock.kt"); } + @Test @TestMetadata("ifStatementWithoutBlockVar.kt") public void testIfStatementWithoutBlockVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/ifStatementWithoutBlockVar.kt"); } + @Test @TestMetadata("inlineClass.kt") public void testInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/inlineClass.kt"); } + @Test @TestMetadata("inlineClassVar.kt") public void testInlineClassVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/inlineClassVar.kt"); } + @Test @TestMetadata("lateinit.kt") public void testLateinit() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/lateinit.kt"); } + @Test @TestMetadata("run.kt") public void testRun() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/run.kt"); } + @Test @TestMetadata("runVar.kt") public void testRunVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/runVar.kt"); } + @Test @TestMetadata("singleBlock.kt") public void testSingleBlock() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/singleBlock.kt"); } + @Test @TestMetadata("singleBlockVar.kt") public void testSingleBlockVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/singleBlockVar.kt"); } + @Test @TestMetadata("whenStatement.kt") public void testWhenStatement() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/whenStatement.kt"); } + @Test @TestMetadata("whenStatementVar.kt") public void testWhenStatementVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/whenStatementVar.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/mangling") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Mangling extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class Mangling extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInMangling() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/mangling"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("parentheses.kt") public void testParentheses() throws Exception { runTest("compiler/testData/codegen/bytecodeText/mangling/parentheses.kt"); } + @Test @TestMetadata("parenthesesNoSanitize.kt") public void testParenthesesNoSanitize() throws Exception { runTest("compiler/testData/codegen/bytecodeText/mangling/parenthesesNoSanitize.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/multifileClasses") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class MultifileClasses extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class MultifileClasses extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInMultifileClasses() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/multifileClasses"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("defaultFunctionInMultifileClass.kt") public void testDefaultFunctionInMultifileClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/multifileClasses/defaultFunctionInMultifileClass.kt"); } + @Test @TestMetadata("optimizedMultifileClassFacadeMethods.kt") public void testOptimizedMultifileClassFacadeMethods() throws Exception { runTest("compiler/testData/codegen/bytecodeText/multifileClasses/optimizedMultifileClassFacadeMethods.kt"); } + @Test @TestMetadata("privateFunctionName.kt") public void testPrivateFunctionName() throws Exception { runTest("compiler/testData/codegen/bytecodeText/multifileClasses/privateFunctionName.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/notNullAssertions") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class NotNullAssertions extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class NotNullAssertions extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInNotNullAssertions() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/notNullAssertions"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("arrayListGet.kt") public void testArrayListGet() throws Exception { runTest("compiler/testData/codegen/bytecodeText/notNullAssertions/arrayListGet.kt"); } + @Test @TestMetadata("assertionForNotNullCaptured.kt") public void testAssertionForNotNullCaptured() throws Exception { runTest("compiler/testData/codegen/bytecodeText/notNullAssertions/assertionForNotNullCaptured.kt"); } + @Test @TestMetadata("assertionForNotNullTypeParam.kt") public void testAssertionForNotNullTypeParam() throws Exception { runTest("compiler/testData/codegen/bytecodeText/notNullAssertions/assertionForNotNullTypeParam.kt"); } + @Test @TestMetadata("assertionForNotNullTypeParam_1_4.kt") public void testAssertionForNotNullTypeParam_1_4() throws Exception { runTest("compiler/testData/codegen/bytecodeText/notNullAssertions/assertionForNotNullTypeParam_1_4.kt"); } + @Test @TestMetadata("doNotGenerateParamAssertions.kt") public void testDoNotGenerateParamAssertions() throws Exception { runTest("compiler/testData/codegen/bytecodeText/notNullAssertions/doNotGenerateParamAssertions.kt"); } + @Test @TestMetadata("javaMultipleSubstitutions.kt") public void testJavaMultipleSubstitutions() throws Exception { runTest("compiler/testData/codegen/bytecodeText/notNullAssertions/javaMultipleSubstitutions.kt"); } + @Test @TestMetadata("noAssertionForNullableCaptured.kt") public void testNoAssertionForNullableCaptured() throws Exception { runTest("compiler/testData/codegen/bytecodeText/notNullAssertions/noAssertionForNullableCaptured.kt"); } + @Test @TestMetadata("noAssertionForNullableGenericMethod.kt") public void testNoAssertionForNullableGenericMethod() throws Exception { runTest("compiler/testData/codegen/bytecodeText/notNullAssertions/noAssertionForNullableGenericMethod.kt"); } + @Test @TestMetadata("noAssertionForNullableGenericMethodCall.kt") public void testNoAssertionForNullableGenericMethodCall() throws Exception { runTest("compiler/testData/codegen/bytecodeText/notNullAssertions/noAssertionForNullableGenericMethodCall.kt"); } + @Test @TestMetadata("noAssertionForPrivateMethod.kt") public void testNoAssertionForPrivateMethod() throws Exception { runTest("compiler/testData/codegen/bytecodeText/notNullAssertions/noAssertionForPrivateMethod.kt"); } + @Test @TestMetadata("noAssertionsForKotlin.kt") public void testNoAssertionsForKotlin() throws Exception { runTest("compiler/testData/codegen/bytecodeText/notNullAssertions/noAssertionsForKotlin.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/nullCheckOptimization") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class NullCheckOptimization extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class NullCheckOptimization extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInNullCheckOptimization() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/nullCheckOptimization"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("alreadyCheckedForIs.kt") public void testAlreadyCheckedForIs() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/alreadyCheckedForIs.kt"); } + @Test @TestMetadata("alreadyCheckedForNull.kt") public void testAlreadyCheckedForNull() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/alreadyCheckedForNull.kt"); } + @Test @TestMetadata("deterministicNotNullChecks.kt") public void testDeterministicNotNullChecks() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/deterministicNotNullChecks.kt"); } + @Test @TestMetadata("expressionValueIsNotNull.kt") public void testExpressionValueIsNotNull() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/expressionValueIsNotNull.kt"); } + @Test @TestMetadata("expressionValueIsNotNullAfterExclExcl.kt") public void testExpressionValueIsNotNullAfterExclExcl() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/expressionValueIsNotNullAfterExclExcl.kt"); } + @Test @TestMetadata("expressionValueIsNotNullTwice.kt") public void testExpressionValueIsNotNullTwice() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/expressionValueIsNotNullTwice.kt"); } + @Test @TestMetadata("ifNullEqualsNull.kt") public void testIfNullEqualsNull() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/ifNullEqualsNull.kt"); } + @Test @TestMetadata("ifNullEqualsNullInline.kt") public void testIfNullEqualsNullInline() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/ifNullEqualsNullInline.kt"); } + @Test @TestMetadata("ifUnitEqualsNull.kt") public void testIfUnitEqualsNull() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/ifUnitEqualsNull.kt"); } + @Test @TestMetadata("ifUnitEqualsNullInline.kt") public void testIfUnitEqualsNullInline() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/ifUnitEqualsNullInline.kt"); } + @Test @TestMetadata("kt12839.kt") public void testKt12839() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/kt12839.kt"); } + @Test @TestMetadata("multipleExclExcl_1_4.kt") public void testMultipleExclExcl_1_4() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/multipleExclExcl_1_4.kt"); } + @Test @TestMetadata("notNullAsNotNullable.kt") public void testNotNullAsNotNullable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/notNullAsNotNullable.kt"); } + @Test @TestMetadata("notNullExpressionValueTwice_1_4.kt") public void testNotNullExpressionValueTwice_1_4() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/notNullExpressionValueTwice_1_4.kt"); } + @Test @TestMetadata("nullCheckAfterExclExcl_1_4.kt") public void testNullCheckAfterExclExcl_1_4() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/nullCheckAfterExclExcl_1_4.kt"); } + @Test @TestMetadata("nullabilityAssertionOnDispatchReceiver.kt") public void testNullabilityAssertionOnDispatchReceiver() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/nullabilityAssertionOnDispatchReceiver.kt"); } + @Test @TestMetadata("primitiveCheck.kt") public void testPrimitiveCheck() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/primitiveCheck.kt"); } + @Test @TestMetadata("redundantSafeCall.kt") public void testRedundantSafeCall() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/redundantSafeCall.kt"); } + @Test @TestMetadata("redundantSafeCall_1_4.kt") public void testRedundantSafeCall_1_4() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/redundantSafeCall_1_4.kt"); } + @Test @TestMetadata("reifiedIs.kt") public void testReifiedIs() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/reifiedIs.kt"); } + @Test @TestMetadata("reifiedNullIs.kt") public void testReifiedNullIs() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/reifiedNullIs.kt"); } + @Test @TestMetadata("trivialInstanceOf.kt") public void testTrivialInstanceOf() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/trivialInstanceOf.kt"); } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/nullCheckOptimization/localLateinit") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class LocalLateinit extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class LocalLateinit extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInLocalLateinit() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/nullCheckOptimization/localLateinit"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("checkedAlways.kt") public void testCheckedAlways() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/localLateinit/checkedAlways.kt"); } + @Test @TestMetadata("checkedOnce.kt") public void testCheckedOnce() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/localLateinit/checkedOnce.kt"); } + @Test @TestMetadata("initialized.kt") public void testInitialized() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/localLateinit/initialized.kt"); @@ -4035,88 +4467,89 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest { } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/oldLanguageVersions") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class OldLanguageVersions extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class OldLanguageVersions extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInOldLanguageVersions() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/oldLanguageVersions"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("noInlineJavaProtectedConstants.kt") public void testNoInlineJavaProtectedConstants() throws Exception { runTest("compiler/testData/codegen/bytecodeText/oldLanguageVersions/noInlineJavaProtectedConstants.kt"); } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/oldLanguageVersions/constProperty") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ConstProperty extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class ConstProperty extends AbstractBytecodeTextTest { + @Test @TestMetadata("accessorsForPrivateConstants.kt") public void testAccessorsForPrivateConstants() throws Exception { runTest("compiler/testData/codegen/bytecodeText/oldLanguageVersions/constProperty/accessorsForPrivateConstants.kt"); } + @Test public void testAllFilesPresentInConstProperty() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/oldLanguageVersions/constProperty"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/oldLanguageVersions/ieee754") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Ieee754 extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class Ieee754 extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInIeee754() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/oldLanguageVersions/ieee754"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("nullableDoubleEquals10.kt") public void testNullableDoubleEquals10() throws Exception { runTest("compiler/testData/codegen/bytecodeText/oldLanguageVersions/ieee754/nullableDoubleEquals10.kt"); } + @Test @TestMetadata("nullableDoubleNotEquals10.kt") public void testNullableDoubleNotEquals10() throws Exception { runTest("compiler/testData/codegen/bytecodeText/oldLanguageVersions/ieee754/nullableDoubleNotEquals10.kt"); } + @Test @TestMetadata("nullableFloatEquals10.kt") public void testNullableFloatEquals10() throws Exception { runTest("compiler/testData/codegen/bytecodeText/oldLanguageVersions/ieee754/nullableFloatEquals10.kt"); } + @Test @TestMetadata("nullableFloatNotEquals10.kt") public void testNullableFloatNotEquals10() throws Exception { runTest("compiler/testData/codegen/bytecodeText/oldLanguageVersions/ieee754/nullableFloatNotEquals10.kt"); } + @Test @TestMetadata("smartCastsForDouble10.kt") public void testSmartCastsForDouble10() throws Exception { runTest("compiler/testData/codegen/bytecodeText/oldLanguageVersions/ieee754/smartCastsForDouble10.kt"); } + @Test @TestMetadata("smartCastsForFloat10.kt") public void testSmartCastsForFloat10() throws Exception { runTest("compiler/testData/codegen/bytecodeText/oldLanguageVersions/ieee754/smartCastsForFloat10.kt"); } + @Test @TestMetadata("when10.kt") public void testWhen10() throws Exception { runTest("compiler/testData/codegen/bytecodeText/oldLanguageVersions/ieee754/when10.kt"); } + @Test @TestMetadata("whenNullableSmartCast10.kt") public void testWhenNullableSmartCast10() throws Exception { runTest("compiler/testData/codegen/bytecodeText/oldLanguageVersions/ieee754/whenNullableSmartCast10.kt"); @@ -4124,126 +4557,129 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest { } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/optimizedDelegatedProperties") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class OptimizedDelegatedProperties extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class OptimizedDelegatedProperties extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInOptimizedDelegatedProperties() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/optimizedDelegatedProperties"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("definedInSources.kt") public void testDefinedInSources() throws Exception { runTest("compiler/testData/codegen/bytecodeText/optimizedDelegatedProperties/definedInSources.kt"); } + @Test @TestMetadata("inSeparateModule.kt") public void testInSeparateModule() throws Exception { runTest("compiler/testData/codegen/bytecodeText/optimizedDelegatedProperties/inSeparateModule.kt"); } + @Test @TestMetadata("lazy.kt") public void testLazy() throws Exception { runTest("compiler/testData/codegen/bytecodeText/optimizedDelegatedProperties/lazy.kt"); } + @Test @TestMetadata("withNonNullMetadataParameter.kt") public void testWithNonNullMetadataParameter() throws Exception { runTest("compiler/testData/codegen/bytecodeText/optimizedDelegatedProperties/withNonNullMetadataParameter.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/parameterlessMain") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ParameterlessMain extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class ParameterlessMain extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInParameterlessMain() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/parameterlessMain"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("dontGenerateOnExtensionReceiver.kt") public void testDontGenerateOnExtensionReceiver() throws Exception { runTest("compiler/testData/codegen/bytecodeText/parameterlessMain/dontGenerateOnExtensionReceiver.kt"); } + @Test @TestMetadata("dontGenerateOnJvmNameMain.kt") public void testDontGenerateOnJvmNameMain() throws Exception { runTest("compiler/testData/codegen/bytecodeText/parameterlessMain/dontGenerateOnJvmNameMain.kt"); } + @Test @TestMetadata("dontGenerateOnJvmOverloads.kt") public void testDontGenerateOnJvmOverloads() throws Exception { runTest("compiler/testData/codegen/bytecodeText/parameterlessMain/dontGenerateOnJvmOverloads.kt"); } + @Test @TestMetadata("dontGenerateOnMain.kt") public void testDontGenerateOnMain() throws Exception { runTest("compiler/testData/codegen/bytecodeText/parameterlessMain/dontGenerateOnMain.kt"); } + @Test @TestMetadata("dontGenerateOnMainExtension.kt") public void testDontGenerateOnMainExtension() throws Exception { runTest("compiler/testData/codegen/bytecodeText/parameterlessMain/dontGenerateOnMainExtension.kt"); } + @Test @TestMetadata("dontGenerateOnNullableArray.kt") public void testDontGenerateOnNullableArray() throws Exception { runTest("compiler/testData/codegen/bytecodeText/parameterlessMain/dontGenerateOnNullableArray.kt"); } + @Test @TestMetadata("dontGenerateOnVarargsString.kt") public void testDontGenerateOnVarargsString() throws Exception { runTest("compiler/testData/codegen/bytecodeText/parameterlessMain/dontGenerateOnVarargsString.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/properties") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Properties extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class Properties extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInProperties() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/properties"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("dataClass.kt") public void testDataClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/properties/dataClass.kt"); } + @Test @TestMetadata("openDataClass.kt") public void testOpenDataClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/properties/openDataClass.kt"); } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/properties/lateinit") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Lateinit extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class Lateinit extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInLateinit() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/properties/lateinit"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("companionObject.kt") public void testCompanionObject() throws Exception { runTest("compiler/testData/codegen/bytecodeText/properties/lateinit/companionObject.kt"); } + @Test @TestMetadata("companionObjectFromLambda.kt") public void testCompanionObjectFromLambda() throws Exception { runTest("compiler/testData/codegen/bytecodeText/properties/lateinit/companionObjectFromLambda.kt"); @@ -4251,791 +4687,882 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest { } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/ranges") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Ranges extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class Ranges extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInRanges() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/ranges"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("ifNotInRange.kt") public void testIfNotInRange() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ranges/ifNotInRange.kt"); } + @Test @TestMetadata("inArrayIndices.kt") public void testInArrayIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ranges/inArrayIndices.kt"); } + @Test @TestMetadata("inCharSequenceIndices.kt") public void testInCharSequenceIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ranges/inCharSequenceIndices.kt"); } + @Test @TestMetadata("inCollectionIndices.kt") public void testInCollectionIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ranges/inCollectionIndices.kt"); } + @Test @TestMetadata("inComparableRangeLiteral.kt") public void testInComparableRangeLiteral() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ranges/inComparableRangeLiteral.kt"); } + @Test @TestMetadata("inMixedUnsignedRange.kt") public void testInMixedUnsignedRange() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ranges/inMixedUnsignedRange.kt"); } + @Test @TestMetadata("inMixedUnsignedRange_2.kt") public void testInMixedUnsignedRange_2() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ranges/inMixedUnsignedRange_2.kt"); } + @Test @TestMetadata("inNonMatchingRangeIntrinsified.kt") public void testInNonMatchingRangeIntrinsified() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ranges/inNonMatchingRangeIntrinsified.kt"); } + @Test @TestMetadata("inOptimizableRange.kt") public void testInOptimizableRange() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ranges/inOptimizableRange.kt"); } + @Test @TestMetadata("inOptimizableUnsignedRange.kt") public void testInOptimizableUnsignedRange() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ranges/inOptimizableUnsignedRange.kt"); } + @Test @TestMetadata("inUntil.kt") public void testInUntil() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ranges/inUntil.kt"); } + @Test @TestMetadata("noDupXForLiteralRangeContains.kt") public void testNoDupXForLiteralRangeContains() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ranges/noDupXForLiteralRangeContains.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/sam") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Sam extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class Sam extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInSam() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/sam"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("samWrapperForNullInitialization.kt") public void testSamWrapperForNullInitialization() throws Exception { runTest("compiler/testData/codegen/bytecodeText/sam/samWrapperForNullInitialization.kt"); } + @Test @TestMetadata("samWrapperForNullableInitialization.kt") public void testSamWrapperForNullableInitialization() throws Exception { runTest("compiler/testData/codegen/bytecodeText/sam/samWrapperForNullableInitialization.kt"); } + @Test @TestMetadata("samWrapperInInlineLambda.kt") public void testSamWrapperInInlineLambda() throws Exception { runTest("compiler/testData/codegen/bytecodeText/sam/samWrapperInInlineLambda.kt"); } + @Test @TestMetadata("samWrapperOfLambda.kt") public void testSamWrapperOfLambda() throws Exception { runTest("compiler/testData/codegen/bytecodeText/sam/samWrapperOfLambda.kt"); } + @Test @TestMetadata("samWrapperOfReference.kt") public void testSamWrapperOfReference() throws Exception { runTest("compiler/testData/codegen/bytecodeText/sam/samWrapperOfReference.kt"); } + @Test @TestMetadata("samWrapperRawTypes.kt") public void testSamWrapperRawTypes() throws Exception { runTest("compiler/testData/codegen/bytecodeText/sam/samWrapperRawTypes.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/statements") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Statements extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class Statements extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInStatements() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/statements"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("ifSingleBranch.kt") public void testIfSingleBranch() throws Exception { runTest("compiler/testData/codegen/bytecodeText/statements/ifSingleBranch.kt"); } + @Test @TestMetadata("ifThenElse.kt") public void testIfThenElse() throws Exception { runTest("compiler/testData/codegen/bytecodeText/statements/ifThenElse.kt"); } + @Test @TestMetadata("ifThenElseEmpty.kt") public void testIfThenElseEmpty() throws Exception { runTest("compiler/testData/codegen/bytecodeText/statements/ifThenElseEmpty.kt"); } + @Test @TestMetadata("labeled.kt") public void testLabeled() throws Exception { runTest("compiler/testData/codegen/bytecodeText/statements/labeled.kt"); } + @Test @TestMetadata("statementsComposition.kt") public void testStatementsComposition() throws Exception { runTest("compiler/testData/codegen/bytecodeText/statements/statementsComposition.kt"); } + @Test @TestMetadata("tryCatchFinally.kt") public void testTryCatchFinally() throws Exception { runTest("compiler/testData/codegen/bytecodeText/statements/tryCatchFinally.kt"); } + @Test @TestMetadata("when.kt") public void testWhen() throws Exception { runTest("compiler/testData/codegen/bytecodeText/statements/when.kt"); } + @Test @TestMetadata("whenSubject.kt") public void testWhenSubject() throws Exception { runTest("compiler/testData/codegen/bytecodeText/statements/whenSubject.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/staticFields") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class StaticFields extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class StaticFields extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInStaticFields() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/staticFields"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("classObject.kt") public void testClassObject() throws Exception { runTest("compiler/testData/codegen/bytecodeText/staticFields/classObject.kt"); } + @Test @TestMetadata("object.kt") public void testObject() throws Exception { runTest("compiler/testData/codegen/bytecodeText/staticFields/object.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/storeStackBeforeInline") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class StoreStackBeforeInline extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class StoreStackBeforeInline extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInStoreStackBeforeInline() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/storeStackBeforeInline"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("differentTypes.kt") public void testDifferentTypes() throws Exception { runTest("compiler/testData/codegen/bytecodeText/storeStackBeforeInline/differentTypes.kt"); } + @Test @TestMetadata("primitiveMerge.kt") public void testPrimitiveMerge() throws Exception { runTest("compiler/testData/codegen/bytecodeText/storeStackBeforeInline/primitiveMerge.kt"); } + @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { runTest("compiler/testData/codegen/bytecodeText/storeStackBeforeInline/simple.kt"); } + @Test @TestMetadata("unreachableMarker.kt") public void testUnreachableMarker() throws Exception { runTest("compiler/testData/codegen/bytecodeText/storeStackBeforeInline/unreachableMarker.kt"); } + @Test @TestMetadata("withLambda.kt") public void testWithLambda() throws Exception { runTest("compiler/testData/codegen/bytecodeText/storeStackBeforeInline/withLambda.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/stringOperations") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class StringOperations extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class StringOperations extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInStringOperations() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/stringOperations"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("concat.kt") public void testConcat() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/concat.kt"); } + @Test @TestMetadata("concatDynamic.kt") public void testConcatDynamic() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/concatDynamic.kt"); } + @Test @TestMetadata("concatDynamic200.kt") public void testConcatDynamic200() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/concatDynamic200.kt"); } + @Test @TestMetadata("concatDynamic201.kt") public void testConcatDynamic201() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/concatDynamic201.kt"); } + @Test @TestMetadata("concatDynamicConstants.kt") public void testConcatDynamicConstants() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/concatDynamicConstants.kt"); } + @Test @TestMetadata("concatDynamicDataClass.kt") public void testConcatDynamicDataClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/concatDynamicDataClass.kt"); } + @Test @TestMetadata("concatDynamicIndy.kt") public void testConcatDynamicIndy() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/concatDynamicIndy.kt"); } + @Test @TestMetadata("concatDynamicIndy201.kt") public void testConcatDynamicIndy201() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/concatDynamicIndy201.kt"); } + @Test @TestMetadata("concatDynamicIndyDataClass.kt") public void testConcatDynamicIndyDataClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/concatDynamicIndyDataClass.kt"); } + @Test @TestMetadata("concatNotDynamic.kt") public void testConcatNotDynamic() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/concatNotDynamic.kt"); } + @Test @TestMetadata("constConcat.kt") public void testConstConcat() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/constConcat.kt"); } + @Test @TestMetadata("constValConcat.kt") public void testConstValConcat() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/constValConcat.kt"); } + @Test @TestMetadata("doNotAppendEmptyString.kt") public void testDoNotAppendEmptyString() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/doNotAppendEmptyString.kt"); } + @Test @TestMetadata("interpolation.kt") public void testInterpolation() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/interpolation.kt"); } + @Test @TestMetadata("kt15235.kt") public void testKt15235() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/kt15235.kt"); } + @Test @TestMetadata("kt19037.kt") public void testKt19037() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/kt19037.kt"); } + @Test @TestMetadata("kt42457_old.kt") public void testKt42457_old() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/kt42457_old.kt"); } + @Test @TestMetadata("multipleNestedConcat.kt") public void testMultipleNestedConcat() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/multipleNestedConcat.kt"); } + @Test @TestMetadata("nestedConcat.kt") public void testNestedConcat() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/nestedConcat.kt"); } + @Test @TestMetadata("nonNullableStringPlus.kt") public void testNonNullableStringPlus() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/nonNullableStringPlus.kt"); } + @Test @TestMetadata("nullableStringPlus.kt") public void testNullableStringPlus() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/nullableStringPlus.kt"); } + @Test @TestMetadata("partiallyConstConcat.kt") public void testPartiallyConstConcat() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/partiallyConstConcat.kt"); } + @Test @TestMetadata("plusAssign.kt") public void testPlusAssign() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/plusAssign.kt"); } + @Test @TestMetadata("primitiveToString.kt") public void testPrimitiveToString() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/primitiveToString.kt"); } + @Test @TestMetadata("primitiveToStringNotOptimizable.kt") public void testPrimitiveToStringNotOptimizable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/primitiveToStringNotOptimizable.kt"); } + @Test @TestMetadata("primitivesAsStringTemplates.kt") public void testPrimitivesAsStringTemplates() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/primitivesAsStringTemplates.kt"); } + @Test @TestMetadata("singleConcat.kt") public void testSingleConcat() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/singleConcat.kt"); } + @Test @TestMetadata("stringBuilderToString.kt") public void testStringBuilderToString() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/stringBuilderToString.kt"); } + @Test @TestMetadata("stringPlus.kt") public void testStringPlus() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/stringPlus.kt"); } + @Test @TestMetadata("useAppendCharForOneCharStringInTemplate.kt") public void testUseAppendCharForOneCharStringInTemplate() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/useAppendCharForOneCharStringInTemplate.kt"); } + @Test @TestMetadata("useAppendCharForOneCharStringInTemplate_2.kt") public void testUseAppendCharForOneCharStringInTemplate_2() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/useAppendCharForOneCharStringInTemplate_2.kt"); } + @Test @TestMetadata("useAppendCharForOneCharStringUsingPlus.kt") public void testUseAppendCharForOneCharStringUsingPlus() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/useAppendCharForOneCharStringUsingPlus.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/toArray") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ToArray extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class ToArray extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInToArray() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/toArray"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("noAccessorForToArray.kt") public void testNoAccessorForToArray() throws Exception { runTest("compiler/testData/codegen/bytecodeText/toArray/noAccessorForToArray.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/unsignedTypes") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class UnsignedTypes extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class UnsignedTypes extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInUnsignedTypes() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/unsignedTypes"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("unsignedIntCompare_before.kt") public void testUnsignedIntCompare_before() throws Exception { runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntCompare_before.kt"); } + @Test @TestMetadata("unsignedIntCompare_jvm18.kt") public void testUnsignedIntCompare_jvm18() throws Exception { runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntCompare_jvm18.kt"); } + @Test @TestMetadata("unsignedIntDivide_jvm18.kt") public void testUnsignedIntDivide_jvm18() throws Exception { runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntDivide_jvm18.kt"); } + @Test @TestMetadata("unsignedIntRemainder_jvm18.kt") public void testUnsignedIntRemainder_jvm18() throws Exception { runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntRemainder_jvm18.kt"); } + @Test @TestMetadata("unsignedIntSmartCasts_jvm18.kt") public void testUnsignedIntSmartCasts_jvm18() throws Exception { runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntSmartCasts_jvm18.kt"); } + @Test @TestMetadata("unsignedIntToString_jvm18.kt") public void testUnsignedIntToString_jvm18() throws Exception { runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntToString_jvm18.kt"); } + @Test @TestMetadata("unsignedLongCompare_jvm18.kt") public void testUnsignedLongCompare_jvm18() throws Exception { runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedLongCompare_jvm18.kt"); } + @Test @TestMetadata("unsignedLongDivide_jvm18.kt") public void testUnsignedLongDivide_jvm18() throws Exception { runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedLongDivide_jvm18.kt"); } + @Test @TestMetadata("unsignedLongRemainder_jvm18.kt") public void testUnsignedLongRemainder_jvm18() throws Exception { runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedLongRemainder_jvm18.kt"); } + @Test @TestMetadata("unsignedLongToString_jvm18.kt") public void testUnsignedLongToString_jvm18() throws Exception { runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedLongToString_jvm18.kt"); } + @Test @TestMetadata("whenByUnsigned.kt") public void testWhenByUnsigned() throws Exception { runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/whenByUnsigned.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/varargs") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Varargs extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class Varargs extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInVarargs() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/varargs"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("doNotCopyImmediatelyCreatedArrays.kt") public void testDoNotCopyImmediatelyCreatedArrays() throws Exception { runTest("compiler/testData/codegen/bytecodeText/varargs/doNotCopyImmediatelyCreatedArrays.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/when") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class When extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class When extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInWhen() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/when"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("edgeCases.kt") public void testEdgeCases() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/edgeCases.kt"); } + @Test @TestMetadata("exhaustiveWhenInitialization.kt") public void testExhaustiveWhenInitialization() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/exhaustiveWhenInitialization.kt"); } + @Test @TestMetadata("exhaustiveWhenReturn.kt") public void testExhaustiveWhenReturn() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/exhaustiveWhenReturn.kt"); } + @Test @TestMetadata("exhaustiveWhenSpecialCases.kt") public void testExhaustiveWhenSpecialCases() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/exhaustiveWhenSpecialCases.kt"); } + @Test @TestMetadata("exhaustiveWhenUnit.kt") public void testExhaustiveWhenUnit() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/exhaustiveWhenUnit.kt"); } + @Test @TestMetadata("exhaustiveWhenUnitStatement.kt") public void testExhaustiveWhenUnitStatement() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/exhaustiveWhenUnitStatement.kt"); } + @Test @TestMetadata("inlineConstValsInsideWhen.kt") public void testInlineConstValsInsideWhen() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/inlineConstValsInsideWhen.kt"); } + @Test @TestMetadata("integralWhenWithNoInlinedConstants.kt") public void testIntegralWhenWithNoInlinedConstants() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/integralWhenWithNoInlinedConstants.kt"); } + @Test @TestMetadata("kt18818.kt") public void testKt18818() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/kt18818.kt"); } + @Test @TestMetadata("lookupSwitch.kt") public void testLookupSwitch() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/lookupSwitch.kt"); } + @Test @TestMetadata("lookupSwitchWithSubjectVal.kt") public void testLookupSwitchWithSubjectVal() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/lookupSwitchWithSubjectVal.kt"); } + @Test @TestMetadata("noBoxingInDefaultWhenWithSpecialCases.kt") public void testNoBoxingInDefaultWhenWithSpecialCases() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/noBoxingInDefaultWhenWithSpecialCases.kt"); } + @Test @TestMetadata("qualifiedConstValsInsideWhen.kt") public void testQualifiedConstValsInsideWhen() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/qualifiedConstValsInsideWhen.kt"); } + @Test @TestMetadata("sealedWhenInitialization.kt") public void testSealedWhenInitialization() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/sealedWhenInitialization.kt"); } + @Test @TestMetadata("simpleConstValsInsideWhen.kt") public void testSimpleConstValsInsideWhen() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/simpleConstValsInsideWhen.kt"); } + @Test @TestMetadata("stringSwitchWithSubjectVal.kt") public void testStringSwitchWithSubjectVal() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/stringSwitchWithSubjectVal.kt"); } + @Test @TestMetadata("subjectValHasLocalVariableSlot.kt") public void testSubjectValHasLocalVariableSlot() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/subjectValHasLocalVariableSlot.kt"); } + @Test @TestMetadata("subjectValInEnumWhenHasLocalVariableSlot.kt") public void testSubjectValInEnumWhenHasLocalVariableSlot() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/subjectValInEnumWhenHasLocalVariableSlot.kt"); } + @Test @TestMetadata("subjectValInIntWhenHasLocalVariableSlot.kt") public void testSubjectValInIntWhenHasLocalVariableSlot() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/subjectValInIntWhenHasLocalVariableSlot.kt"); } + @Test @TestMetadata("subjectValInStringWhenHasLocalVariableSlot.kt") public void testSubjectValInStringWhenHasLocalVariableSlot() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/subjectValInStringWhenHasLocalVariableSlot.kt"); } + @Test @TestMetadata("switchOptimizationDuplicates.kt") public void testSwitchOptimizationDuplicates() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/switchOptimizationDuplicates.kt"); } + @Test @TestMetadata("tableSwitch.kt") public void testTableSwitch() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/tableSwitch.kt"); } + @Test @TestMetadata("tableSwitchWithSubjectVal.kt") public void testTableSwitchWithSubjectVal() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/tableSwitchWithSubjectVal.kt"); } + @Test @TestMetadata("whenNull.kt") public void testWhenNull() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/whenNull.kt"); } + @Test @TestMetadata("whenZero.kt") public void testWhenZero() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/whenZero.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/whenEnumOptimization") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class WhenEnumOptimization extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class WhenEnumOptimization extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInWhenEnumOptimization() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/whenEnumOptimization"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("bigEnum.kt") public void testBigEnum() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/bigEnum.kt"); } + @Test @TestMetadata("differentEnumClasses.kt") public void testDifferentEnumClasses() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/differentEnumClasses.kt"); } + @Test @TestMetadata("differentEnumClasses2.kt") public void testDifferentEnumClasses2() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/differentEnumClasses2.kt"); } + @Test @TestMetadata("duplicatingItems.kt") public void testDuplicatingItems() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/duplicatingItems.kt"); } + @Test @TestMetadata("expression.kt") public void testExpression() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/expression.kt"); } + @Test @TestMetadata("functionLiteralInTopLevel.kt") public void testFunctionLiteralInTopLevel() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/functionLiteralInTopLevel.kt"); } + @Test @TestMetadata("importedEnumEntry.kt") public void testImportedEnumEntry() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/importedEnumEntry.kt"); } + @Test @TestMetadata("kt14597_full.kt") public void testKt14597_full() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/kt14597_full.kt"); } + @Test @TestMetadata("kt14802.kt") public void testKt14802() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/kt14802.kt"); } + @Test @TestMetadata("manyWhensWithinClass.kt") public void testManyWhensWithinClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/manyWhensWithinClass.kt"); } + @Test @TestMetadata("nonConstantEnum.kt") public void testNonConstantEnum() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/nonConstantEnum.kt"); } + @Test @TestMetadata("nullability.kt") public void testNullability() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/nullability.kt"); } + @Test @TestMetadata("subjectAny.kt") public void testSubjectAny() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/subjectAny.kt"); } + @Test @TestMetadata("withoutElse.kt") public void testWithoutElse() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/withoutElse.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/whenStringOptimization") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class WhenStringOptimization extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - + public class WhenStringOptimization extends AbstractBytecodeTextTest { + @Test public void testAllFilesPresentInWhenStringOptimization() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/whenStringOptimization"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test @TestMetadata("denseHashCode.kt") public void testDenseHashCode() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenStringOptimization/denseHashCode.kt"); } + @Test @TestMetadata("duplicatingItems.kt") public void testDuplicatingItems() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenStringOptimization/duplicatingItems.kt"); } + @Test @TestMetadata("duplicatingItemsSameHashCodeFewBranches.kt") public void testDuplicatingItemsSameHashCodeFewBranches() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenStringOptimization/duplicatingItemsSameHashCodeFewBranches.kt"); } + @Test @TestMetadata("duplicatingItemsSameHashCodeMoreBranches.kt") public void testDuplicatingItemsSameHashCodeMoreBranches() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenStringOptimization/duplicatingItemsSameHashCodeMoreBranches.kt"); } + @Test @TestMetadata("expression.kt") public void testExpression() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenStringOptimization/expression.kt"); } + @Test @TestMetadata("inlineStringConstInsideWhen.kt") public void testInlineStringConstInsideWhen() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenStringOptimization/inlineStringConstInsideWhen.kt"); } + @Test @TestMetadata("nonInlinedConst.kt") public void testNonInlinedConst() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenStringOptimization/nonInlinedConst.kt"); } + @Test @TestMetadata("nullability.kt") public void testNullability() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenStringOptimization/nullability.kt"); } + @Test @TestMetadata("sameHashCode.kt") public void testSameHashCode() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenStringOptimization/sameHashCode.kt"); } + @Test @TestMetadata("statement.kt") public void testStatement() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenStringOptimization/statement.kt"); diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrBytecodeTextTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBytecodeTextTestGenerated.java similarity index 90% rename from compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrBytecodeTextTestGenerated.java rename to compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBytecodeTextTestGenerated.java index c6f9499ee57..fcd726e793a 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrBytecodeTextTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBytecodeTextTestGenerated.java @@ -3,739 +3,843 @@ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ -package org.jetbrains.kotlin.codegen.ir; +package org.jetbrains.kotlin.test.runners.codegen; import com.intellij.testFramework.TestDataPath; -import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; -import org.jetbrains.kotlin.test.KotlinTestUtils; import org.jetbrains.kotlin.test.util.KtTestUtil; import org.jetbrains.kotlin.test.TargetBackend; import org.jetbrains.kotlin.test.TestMetadata; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; import java.io.File; import java.util.regex.Pattern; -/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ +/** This class is generated by {@link GenerateNewCompilerTests.kt}. DO NOT MODIFY MANUALLY */ @SuppressWarnings("all") @TestMetadata("compiler/testData/codegen/bytecodeText") @TestDataPath("$PROJECT_ROOT") -@RunWith(JUnit3RunnerWithInners.class) public class IrBytecodeTextTestGenerated extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + @Test @TestMetadata("accessorForOverridenVal.kt") public void testAccessorForOverridenVal() throws Exception { runTest("compiler/testData/codegen/bytecodeText/accessorForOverridenVal.kt"); } + @Test @TestMetadata("accessorForProtected.kt") public void testAccessorForProtected() throws Exception { runTest("compiler/testData/codegen/bytecodeText/accessorForProtected.kt"); } + @Test @TestMetadata("accessorNaming.kt") public void testAccessorNaming() throws Exception { runTest("compiler/testData/codegen/bytecodeText/accessorNaming.kt"); } + @Test public void testAllFilesPresentInBytecodeText() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true, "oldLanguageVersions"); } + @Test @TestMetadata("annotationDefaultValue.kt") public void testAnnotationDefaultValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/annotationDefaultValue.kt"); } + @Test @TestMetadata("annotationJavaRetentionPolicyRuntime.kt") public void testAnnotationJavaRetentionPolicyRuntime() throws Exception { runTest("compiler/testData/codegen/bytecodeText/annotationJavaRetentionPolicyRuntime.kt"); } + @Test @TestMetadata("annotationRetentionPolicyClass.kt") public void testAnnotationRetentionPolicyClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/annotationRetentionPolicyClass.kt"); } + @Test @TestMetadata("annotationRetentionPolicyRuntime.kt") public void testAnnotationRetentionPolicyRuntime() throws Exception { runTest("compiler/testData/codegen/bytecodeText/annotationRetentionPolicyRuntime.kt"); } + @Test @TestMetadata("annotationRetentionPolicySource.kt") public void testAnnotationRetentionPolicySource() throws Exception { runTest("compiler/testData/codegen/bytecodeText/annotationRetentionPolicySource.kt"); } + @Test @TestMetadata("boxedNotNumberTypeOnUnboxing.kt") public void testBoxedNotNumberTypeOnUnboxing() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxedNotNumberTypeOnUnboxing.kt"); } + @Test @TestMetadata("bridgeForFakeOverride.kt") public void testBridgeForFakeOverride() throws Exception { runTest("compiler/testData/codegen/bytecodeText/bridgeForFakeOverride.kt"); } + @Test @TestMetadata("charConstant.kt") public void testCharConstant() throws Exception { runTest("compiler/testData/codegen/bytecodeText/charConstant.kt"); } + @Test @TestMetadata("collectionStubs.kt") public void testCollectionStubs() throws Exception { runTest("compiler/testData/codegen/bytecodeText/collectionStubs.kt"); } + @Test @TestMetadata("componentEvaluatesOnlyOnce.kt") public void testComponentEvaluatesOnlyOnce() throws Exception { runTest("compiler/testData/codegen/bytecodeText/componentEvaluatesOnlyOnce.kt"); } + @Test @TestMetadata("constClosureOptimization.kt") public void testConstClosureOptimization() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constClosureOptimization.kt"); } + @Test @TestMetadata("defaultMethodBody.kt") public void testDefaultMethodBody() throws Exception { runTest("compiler/testData/codegen/bytecodeText/defaultMethodBody.kt"); } + @Test @TestMetadata("doNotStoreNullForTmpInDestructuring.kt") public void testDoNotStoreNullForTmpInDestructuring() throws Exception { runTest("compiler/testData/codegen/bytecodeText/doNotStoreNullForTmpInDestructuring.kt"); } + @Test @TestMetadata("doNotStoreNullsForCapturedVars.kt") public void testDoNotStoreNullsForCapturedVars() throws Exception { runTest("compiler/testData/codegen/bytecodeText/doNotStoreNullsForCapturedVars.kt"); } + @Test @TestMetadata("falseSmartCast.kt") public void testFalseSmartCast() throws Exception { runTest("compiler/testData/codegen/bytecodeText/falseSmartCast.kt"); } + @Test @TestMetadata("flagsInMultiFileInherit.kt") public void testFlagsInMultiFileInherit() throws Exception { runTest("compiler/testData/codegen/bytecodeText/flagsInMultiFileInherit.kt"); } + @Test @TestMetadata("iincGeneration.kt") public void testIincGeneration() throws Exception { runTest("compiler/testData/codegen/bytecodeText/iincGeneration.kt"); } + @Test @TestMetadata("inheritedPropertyAnnotations.kt") public void testInheritedPropertyAnnotations() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inheritedPropertyAnnotations.kt"); } + @Test @TestMetadata("inlineFromOtherModule.kt") public void testInlineFromOtherModule() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineFromOtherModule.kt"); } + @Test @TestMetadata("inlineJavaConstantFromSubclass.kt") public void testInlineJavaConstantFromSubclass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineJavaConstantFromSubclass.kt"); } + @Test @TestMetadata("inlineJavaStaticFields.kt") public void testInlineJavaStaticFields() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineJavaStaticFields.kt"); } + @Test @TestMetadata("inlineProtectedJavaConstantFromOtherPackage.kt") public void testInlineProtectedJavaConstantFromOtherPackage() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineProtectedJavaConstantFromOtherPackage.kt"); } + @Test @TestMetadata("intConstantNotNull.kt") public void testIntConstantNotNull() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intConstantNotNull.kt"); } + @Test @TestMetadata("intConstantNullable.kt") public void testIntConstantNullable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intConstantNullable.kt"); } + @Test @TestMetadata("intConstantNullableSafeCall.kt") public void testIntConstantNullableSafeCall() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intConstantNullableSafeCall.kt"); } + @Test @TestMetadata("intConstantSafeCall.kt") public void testIntConstantSafeCall() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intConstantSafeCall.kt"); } + @Test @TestMetadata("intProgressionNoBoxing.kt") public void testIntProgressionNoBoxing() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intProgressionNoBoxing.kt"); } + @Test @TestMetadata("intRangeNoBoxing.kt") public void testIntRangeNoBoxing() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intRangeNoBoxing.kt"); } + @Test @TestMetadata("interfaceDefaultImpl.kt") public void testInterfaceDefaultImpl() throws Exception { runTest("compiler/testData/codegen/bytecodeText/interfaceDefaultImpl.kt"); } + @Test @TestMetadata("isArrayOf.kt") public void testIsArrayOf() throws Exception { runTest("compiler/testData/codegen/bytecodeText/isArrayOf.kt"); } + @Test @TestMetadata("javaExtensionPropertyIntrinsic.kt") public void testJavaExtensionPropertyIntrinsic() throws Exception { runTest("compiler/testData/codegen/bytecodeText/javaExtensionPropertyIntrinsic.kt"); } + @Test @TestMetadata("javaFields.kt") public void testJavaFields() throws Exception { runTest("compiler/testData/codegen/bytecodeText/javaFields.kt"); } + @Test @TestMetadata("javaFieldsWithIntersectionTypes.kt") public void testJavaFieldsWithIntersectionTypes() throws Exception { runTest("compiler/testData/codegen/bytecodeText/javaFieldsWithIntersectionTypes.kt"); } + @Test @TestMetadata("javaStatics.kt") public void testJavaStatics() throws Exception { runTest("compiler/testData/codegen/bytecodeText/javaStatics.kt"); } + @Test @TestMetadata("jvmField.kt") public void testJvmField() throws Exception { runTest("compiler/testData/codegen/bytecodeText/jvmField.kt"); } + @Test @TestMetadata("jvmStaticInternalMangling.kt") public void testJvmStaticInternalMangling() throws Exception { runTest("compiler/testData/codegen/bytecodeText/jvmStaticInternalMangling.kt"); } + @Test @TestMetadata("kt10259.kt") public void testKt10259() throws Exception { runTest("compiler/testData/codegen/bytecodeText/kt10259.kt"); } + @Test @TestMetadata("kt10259_2.kt") public void testKt10259_2() throws Exception { runTest("compiler/testData/codegen/bytecodeText/kt10259_2.kt"); } + @Test @TestMetadata("kt10259_3.kt") public void testKt10259_3() throws Exception { runTest("compiler/testData/codegen/bytecodeText/kt10259_3.kt"); } + @Test @TestMetadata("kt2202.kt") public void testKt2202() throws Exception { runTest("compiler/testData/codegen/bytecodeText/kt2202.kt"); } + @Test @TestMetadata("kt2887.kt") public void testKt2887() throws Exception { runTest("compiler/testData/codegen/bytecodeText/kt2887.kt"); } + @Test @TestMetadata("kt3845.kt") public void testKt3845() throws Exception { runTest("compiler/testData/codegen/bytecodeText/kt3845.kt"); } + @Test @TestMetadata("kt5016.kt") public void testKt5016() throws Exception { runTest("compiler/testData/codegen/bytecodeText/kt5016.kt"); } + @Test @TestMetadata("kt5016int.kt") public void testKt5016int() throws Exception { runTest("compiler/testData/codegen/bytecodeText/kt5016int.kt"); } + @Test @TestMetadata("kt5016intOrNull.kt") public void testKt5016intOrNull() throws Exception { runTest("compiler/testData/codegen/bytecodeText/kt5016intOrNull.kt"); } + @Test @TestMetadata("kt7188.kt") public void testKt7188() throws Exception { runTest("compiler/testData/codegen/bytecodeText/kt7188.kt"); } + @Test @TestMetadata("kt7769.kt") public void testKt7769() throws Exception { runTest("compiler/testData/codegen/bytecodeText/kt7769.kt"); } + @Test @TestMetadata("kt9603.kt") public void testKt9603() throws Exception { runTest("compiler/testData/codegen/bytecodeText/kt9603.kt"); } + @Test @TestMetadata("mapGetOrDefault.kt") public void testMapGetOrDefault() throws Exception { runTest("compiler/testData/codegen/bytecodeText/mapGetOrDefault.kt"); } + @Test @TestMetadata("maxStackAfterOptimizations.kt") public void testMaxStackAfterOptimizations() throws Exception { runTest("compiler/testData/codegen/bytecodeText/maxStackAfterOptimizations.kt"); } + @Test @TestMetadata("noAccessorForProtectedInSamePackageCrossinline.kt") public void testNoAccessorForProtectedInSamePackageCrossinline() throws Exception { runTest("compiler/testData/codegen/bytecodeText/noAccessorForProtectedInSamePackageCrossinline.kt"); } + @Test @TestMetadata("noFlagAnnotations.kt") public void testNoFlagAnnotations() throws Exception { runTest("compiler/testData/codegen/bytecodeText/noFlagAnnotations.kt"); } + @Test @TestMetadata("noNumberCheckCast.kt") public void testNoNumberCheckCast() throws Exception { runTest("compiler/testData/codegen/bytecodeText/noNumberCheckCast.kt"); } + @Test @TestMetadata("noSuperCheckInDefaultConstuctor.kt") public void testNoSuperCheckInDefaultConstuctor() throws Exception { runTest("compiler/testData/codegen/bytecodeText/noSuperCheckInDefaultConstuctor.kt"); } + @Test @TestMetadata("noSyntheticAccessorForPrivateCompanionObjectWhenNotRequired.kt") public void testNoSyntheticAccessorForPrivateCompanionObjectWhenNotRequired() throws Exception { runTest("compiler/testData/codegen/bytecodeText/noSyntheticAccessorForPrivateCompanionObjectWhenNotRequired.kt"); } + @Test @TestMetadata("noWrapperForMethodReturningPrimitive.kt") public void testNoWrapperForMethodReturningPrimitive() throws Exception { runTest("compiler/testData/codegen/bytecodeText/noWrapperForMethodReturningPrimitive.kt"); } + @Test @TestMetadata("nopsInDoWhile.kt") public void testNopsInDoWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nopsInDoWhile.kt"); } + @Test @TestMetadata("partMembersCall.kt") public void testPartMembersCall() throws Exception { runTest("compiler/testData/codegen/bytecodeText/partMembersCall.kt"); } + @Test @TestMetadata("partMembersInline.kt") public void testPartMembersInline() throws Exception { runTest("compiler/testData/codegen/bytecodeText/partMembersInline.kt"); } + @Test @TestMetadata("preEvaluateInlineJavaStaticFields.kt") public void testPreEvaluateInlineJavaStaticFields() throws Exception { runTest("compiler/testData/codegen/bytecodeText/preEvaluateInlineJavaStaticFields.kt"); } + @Test @TestMetadata("prefixIntVarIncrement.kt") public void testPrefixIntVarIncrement() throws Exception { runTest("compiler/testData/codegen/bytecodeText/prefixIntVarIncrement.kt"); } + @Test @TestMetadata("privateDefaultArgs.kt") public void testPrivateDefaultArgs() throws Exception { runTest("compiler/testData/codegen/bytecodeText/privateDefaultArgs.kt"); } + @Test @TestMetadata("redundantGotoRemoving.kt") public void testRedundantGotoRemoving() throws Exception { runTest("compiler/testData/codegen/bytecodeText/redundantGotoRemoving.kt"); } + @Test @TestMetadata("redundantInitializer.kt") public void testRedundantInitializer() throws Exception { runTest("compiler/testData/codegen/bytecodeText/redundantInitializer.kt"); } + @Test @TestMetadata("redundantInitializerNumber.kt") public void testRedundantInitializerNumber() throws Exception { runTest("compiler/testData/codegen/bytecodeText/redundantInitializerNumber.kt"); } + @Test @TestMetadata("redundantValInitializer.kt") public void testRedundantValInitializer() throws Exception { runTest("compiler/testData/codegen/bytecodeText/redundantValInitializer.kt"); } + @Test @TestMetadata("redundantValInitializerInObject.kt") public void testRedundantValInitializerInObject() throws Exception { runTest("compiler/testData/codegen/bytecodeText/redundantValInitializerInObject.kt"); } + @Test @TestMetadata("redundantVarInitializer.kt") public void testRedundantVarInitializer() throws Exception { runTest("compiler/testData/codegen/bytecodeText/redundantVarInitializer.kt"); } + @Test @TestMetadata("redundantVarInitializerInObject.kt") public void testRedundantVarInitializerInObject() throws Exception { runTest("compiler/testData/codegen/bytecodeText/redundantVarInitializerInObject.kt"); } + @Test @TestMetadata("reifiedAsCheck.kt") public void testReifiedAsCheck() throws Exception { runTest("compiler/testData/codegen/bytecodeText/reifiedAsCheck.kt"); } + @Test @TestMetadata("reifiedAsCheckWithNullable.kt") public void testReifiedAsCheckWithNullable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/reifiedAsCheckWithNullable.kt"); } + @Test @TestMetadata("reifiedIsCheck.kt") public void testReifiedIsCheck() throws Exception { runTest("compiler/testData/codegen/bytecodeText/reifiedIsCheck.kt"); } + @Test @TestMetadata("reifiedIsCheckWithNullable.kt") public void testReifiedIsCheckWithNullable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/reifiedIsCheckWithNullable.kt"); } + @Test @TestMetadata("reifiedSafeAsCheck.kt") public void testReifiedSafeAsCheck() throws Exception { runTest("compiler/testData/codegen/bytecodeText/reifiedSafeAsCheck.kt"); } + @Test @TestMetadata("safeAsWithMutable.kt") public void testSafeAsWithMutable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/safeAsWithMutable.kt"); } + @Test @TestMetadata("superFlagInMultiFileFacade.kt") public void testSuperFlagInMultiFileFacade() throws Exception { runTest("compiler/testData/codegen/bytecodeText/superFlagInMultiFileFacade.kt"); } + @Test @TestMetadata("superToString.kt") public void testSuperToString() throws Exception { runTest("compiler/testData/codegen/bytecodeText/superToString.kt"); } + @Test @TestMetadata("suspendCoroutineUninterceptedOrReturn.kt") public void testSuspendCoroutineUninterceptedOrReturn() throws Exception { runTest("compiler/testData/codegen/bytecodeText/suspendCoroutineUninterceptedOrReturn.kt"); } + @Test @TestMetadata("topLevelFunWithDefaultArgs.kt") public void testTopLevelFunWithDefaultArgs() throws Exception { runTest("compiler/testData/codegen/bytecodeText/topLevelFunWithDefaultArgs.kt"); } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/argumentOrder") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ArgumentOrder extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class ArgumentOrder extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInArgumentOrder() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/argumentOrder"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("sameOrder.kt") public void testSameOrder() throws Exception { runTest("compiler/testData/codegen/bytecodeText/argumentOrder/sameOrder.kt"); } + @Test @TestMetadata("sameOrderWithDefault.kt") public void testSameOrderWithDefault() throws Exception { runTest("compiler/testData/codegen/bytecodeText/argumentOrder/sameOrderWithDefault.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/assert") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Assert extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class Assert extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInAssert() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/assert"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("jvmCrossinline.kt") public void testJvmCrossinline() throws Exception { runTest("compiler/testData/codegen/bytecodeText/assert/jvmCrossinline.kt"); } + @Test @TestMetadata("jvmCrossinlineAssertInLambda.kt") public void testJvmCrossinlineAssertInLambda() throws Exception { runTest("compiler/testData/codegen/bytecodeText/assert/jvmCrossinlineAssertInLambda.kt"); } + @Test @TestMetadata("jvmInline.kt") public void testJvmInline() throws Exception { runTest("compiler/testData/codegen/bytecodeText/assert/jvmInline.kt"); } + @Test @TestMetadata("jvmInlineLambda.kt") public void testJvmInlineLambda() throws Exception { runTest("compiler/testData/codegen/bytecodeText/assert/jvmInlineLambda.kt"); } + @Test @TestMetadata("jvmNestedClass.kt") public void testJvmNestedClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/assert/jvmNestedClass.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/boxing") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Boxing extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class Boxing extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInBoxing() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/boxing"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("crossinlineSuspend.kt") public void testCrossinlineSuspend() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxing/crossinlineSuspend.kt"); } + @Test @TestMetadata("inlineSuspend.kt") public void testInlineSuspend() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxing/inlineSuspend.kt"); } + @Test @TestMetadata("suspend.kt") public void testSuspend() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxing/suspend.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/boxingOptimization") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class BoxingOptimization extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class BoxingOptimization extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInBoxingOptimization() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/boxingOptimization"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("boxingAndEquals.kt") public void testBoxingAndEquals() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/boxingAndEquals.kt"); } + @Test @TestMetadata("casts.kt") public void testCasts() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/casts.kt"); } + @Test @TestMetadata("checkcastAndInstanceOf.kt") public void testCheckcastAndInstanceOf() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/checkcastAndInstanceOf.kt"); } + @Test @TestMetadata("fold.kt") public void testFold() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/fold.kt"); } + @Test @TestMetadata("inlineClassesAndInlinedLambda.kt") public void testInlineClassesAndInlinedLambda() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/inlineClassesAndInlinedLambda.kt"); } + @Test @TestMetadata("intCompareTo.kt") public void testIntCompareTo() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/intCompareTo.kt"); } + @Test @TestMetadata("kClassInAnnotation.kt") public void testKClassInAnnotation() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/kClassInAnnotation.kt"); } + @Test @TestMetadata("kClassInAnnotationEscaping.kt") public void testKClassInAnnotationEscaping() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/kClassInAnnotationEscaping.kt"); } + @Test @TestMetadata("kt15862.kt") public void testKt15862() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/kt15862.kt"); } + @Test @TestMetadata("kt15862_2.kt") public void testKt15862_2() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/kt15862_2.kt"); } + @Test @TestMetadata("kt6842.kt") public void testKt6842() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/kt6842.kt"); } + @Test @TestMetadata("kt7224.kt") public void testKt7224() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/kt7224.kt"); } + @Test @TestMetadata("maxMinByOrNull.kt") public void testMaxMinByOrNull() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/maxMinByOrNull.kt"); } + @Test @TestMetadata("nullCheck.kt") public void testNullCheck() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/nullCheck.kt"); } + @Test @TestMetadata("progressions.kt") public void testProgressions() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/progressions.kt"); } + @Test @TestMetadata("safeCallToPrimitiveEquality.kt") public void testSafeCallToPrimitiveEquality() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/safeCallToPrimitiveEquality.kt"); } + @Test @TestMetadata("safeCallWithElvis.kt") public void testSafeCallWithElvis() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/safeCallWithElvis.kt"); } + @Test @TestMetadata("severalInlines.kt") public void testSeveralInlines() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/severalInlines.kt"); } + @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/simple.kt"); } + @Test @TestMetadata("simpleUninitializedMerge.kt") public void testSimpleUninitializedMerge() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/simpleUninitializedMerge.kt"); } + @Test @TestMetadata("unsafeRemoving.kt") public void testUnsafeRemoving() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/unsafeRemoving.kt"); } + @Test @TestMetadata("unsignedRangeIteratorSpecialization.kt") public void testUnsignedRangeIteratorSpecialization() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/unsignedRangeIteratorSpecialization.kt"); } + @Test @TestMetadata("variableClash.kt") public void testVariableClash() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/variableClash.kt"); } + @Test @TestMetadata("variables.kt") public void testVariables() throws Exception { runTest("compiler/testData/codegen/bytecodeText/boxingOptimization/variables.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/builtinFunctions") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class BuiltinFunctions extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class BuiltinFunctions extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInBuiltinFunctions() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/builtinFunctions"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("charSequence.kt") public void testCharSequence() throws Exception { runTest("compiler/testData/codegen/bytecodeText/builtinFunctions/charSequence.kt"); } + @Test @TestMetadata("contains.kt") public void testContains() throws Exception { runTest("compiler/testData/codegen/bytecodeText/builtinFunctions/contains.kt"); } + @Test @TestMetadata("removeAt.kt") public void testRemoveAt() throws Exception { runTest("compiler/testData/codegen/bytecodeText/builtinFunctions/removeAt.kt"); } + @Test @TestMetadata("size.kt") public void testSize() throws Exception { runTest("compiler/testData/codegen/bytecodeText/builtinFunctions/size.kt"); } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/builtinFunctions/genericParameterBridge") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class GenericParameterBridge extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class GenericParameterBridge extends AbstractIrBytecodeTextTest { + @Test @TestMetadata("abstractList.kt") public void testAbstractList() throws Exception { runTest("compiler/testData/codegen/bytecodeText/builtinFunctions/genericParameterBridge/abstractList.kt"); } + @Test public void testAllFilesPresentInGenericParameterBridge() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/builtinFunctions/genericParameterBridge"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("IntMC.kt") public void testIntMC() throws Exception { runTest("compiler/testData/codegen/bytecodeText/builtinFunctions/genericParameterBridge/IntMC.kt"); } + @Test @TestMetadata("mutableCollection.kt") public void testMutableCollection() throws Exception { runTest("compiler/testData/codegen/bytecodeText/builtinFunctions/genericParameterBridge/mutableCollection.kt"); } + @Test @TestMetadata("mutableSetInterfaces.kt") public void testMutableSetInterfaces() throws Exception { runTest("compiler/testData/codegen/bytecodeText/builtinFunctions/genericParameterBridge/mutableSetInterfaces.kt"); } + @Test @TestMetadata("notNullAnyMC.kt") public void testNotNullAnyMC() throws Exception { runTest("compiler/testData/codegen/bytecodeText/builtinFunctions/genericParameterBridge/notNullAnyMC.kt"); } + @Test @TestMetadata("notNullParamMC.kt") public void testNotNullParamMC() throws Exception { runTest("compiler/testData/codegen/bytecodeText/builtinFunctions/genericParameterBridge/notNullParamMC.kt"); } + @Test @TestMetadata("nullableAnyMC.kt") public void testNullableAnyMC() throws Exception { runTest("compiler/testData/codegen/bytecodeText/builtinFunctions/genericParameterBridge/nullableAnyMC.kt"); @@ -743,993 +847,1091 @@ public class IrBytecodeTextTestGenerated extends AbstractIrBytecodeTextTest { } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/callableReference") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class CallableReference extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class CallableReference extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInCallableReference() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/callableReference"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("boundFieldReferenceInInline.kt") public void testBoundFieldReferenceInInline() throws Exception { runTest("compiler/testData/codegen/bytecodeText/callableReference/boundFieldReferenceInInline.kt"); } + @Test @TestMetadata("boundFunReferenceInInline.kt") public void testBoundFunReferenceInInline() throws Exception { runTest("compiler/testData/codegen/bytecodeText/callableReference/boundFunReferenceInInline.kt"); } + @Test @TestMetadata("boundPropertyReferenceInInline.kt") public void testBoundPropertyReferenceInInline() throws Exception { runTest("compiler/testData/codegen/bytecodeText/callableReference/boundPropertyReferenceInInline.kt"); } + @Test @TestMetadata("kt36975.kt") public void testKt36975() throws Exception { runTest("compiler/testData/codegen/bytecodeText/callableReference/kt36975.kt"); } + @Test @TestMetadata("kt39612.kt") public void testKt39612() throws Exception { runTest("compiler/testData/codegen/bytecodeText/callableReference/kt39612.kt"); } + @Test @TestMetadata("nameIntrinsicWithImplicitThis.kt") public void testNameIntrinsicWithImplicitThis() throws Exception { runTest("compiler/testData/codegen/bytecodeText/callableReference/nameIntrinsicWithImplicitThis.kt"); } + @Test @TestMetadata("unboundFieldReferenceInInline.kt") public void testUnboundFieldReferenceInInline() throws Exception { runTest("compiler/testData/codegen/bytecodeText/callableReference/unboundFieldReferenceInInline.kt"); } + @Test @TestMetadata("unboundFunReferenceInInline.kt") public void testUnboundFunReferenceInInline() throws Exception { runTest("compiler/testData/codegen/bytecodeText/callableReference/unboundFunReferenceInInline.kt"); } + @Test @TestMetadata("unboundPropertyReferenceInInline.kt") public void testUnboundPropertyReferenceInInline() throws Exception { runTest("compiler/testData/codegen/bytecodeText/callableReference/unboundPropertyReferenceInInline.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/capturedVarsOptimization") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class CapturedVarsOptimization extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class CapturedVarsOptimization extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInCapturedVarsOptimization() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/capturedVarsOptimization"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("capturedInChainOfInlineFuns.kt") public void testCapturedInChainOfInlineFuns() throws Exception { runTest("compiler/testData/codegen/bytecodeText/capturedVarsOptimization/capturedInChainOfInlineFuns.kt"); } + @Test @TestMetadata("capturedInInlineOnly.kt") public void testCapturedInInlineOnly() throws Exception { runTest("compiler/testData/codegen/bytecodeText/capturedVarsOptimization/capturedInInlineOnly.kt"); } + @Test @TestMetadata("capturedInLocalObject.kt") public void testCapturedInLocalObject() throws Exception { runTest("compiler/testData/codegen/bytecodeText/capturedVarsOptimization/capturedInLocalObject.kt"); } + @Test @TestMetadata("capturedInNoInlineOnly.kt") public void testCapturedInNoInlineOnly() throws Exception { runTest("compiler/testData/codegen/bytecodeText/capturedVarsOptimization/capturedInNoInlineOnly.kt"); } + @Test @TestMetadata("capturedInNoInlneInsideChainOfInlineFuns.kt") public void testCapturedInNoInlneInsideChainOfInlineFuns() throws Exception { runTest("compiler/testData/codegen/bytecodeText/capturedVarsOptimization/capturedInNoInlneInsideChainOfInlineFuns.kt"); } + @Test @TestMetadata("capturedValInLambdaInitializedInside.kt") public void testCapturedValInLambdaInitializedInside() throws Exception { runTest("compiler/testData/codegen/bytecodeText/capturedVarsOptimization/capturedValInLambdaInitializedInside.kt"); } + @Test @TestMetadata("capturedValInLambdaInitializedOutside.kt") public void testCapturedValInLambdaInitializedOutside() throws Exception { runTest("compiler/testData/codegen/bytecodeText/capturedVarsOptimization/capturedValInLambdaInitializedOutside.kt"); } + @Test @TestMetadata("capturedVarsOfSize2.kt") public void testCapturedVarsOfSize2() throws Exception { runTest("compiler/testData/codegen/bytecodeText/capturedVarsOptimization/capturedVarsOfSize2.kt"); } + @Test @TestMetadata("sharedSlotsWithCapturedVars.kt") public void testSharedSlotsWithCapturedVars() throws Exception { runTest("compiler/testData/codegen/bytecodeText/capturedVarsOptimization/sharedSlotsWithCapturedVars.kt"); } + @Test @TestMetadata("withStackNormalization.kt") public void testWithStackNormalization() throws Exception { runTest("compiler/testData/codegen/bytecodeText/capturedVarsOptimization/withStackNormalization.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/checkcast") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Checkcast extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class Checkcast extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInCheckcast() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/checkcast"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("kt14811.kt") public void testKt14811() throws Exception { runTest("compiler/testData/codegen/bytecodeText/checkcast/kt14811.kt"); } + @Test @TestMetadata("kt14963.kt") public void testKt14963() throws Exception { runTest("compiler/testData/codegen/bytecodeText/checkcast/kt14963.kt"); } + @Test @TestMetadata("kt15411.kt") public void testKt15411() throws Exception { runTest("compiler/testData/codegen/bytecodeText/checkcast/kt15411.kt"); } + @Test @TestMetadata("kt22714.kt") public void testKt22714() throws Exception { runTest("compiler/testData/codegen/bytecodeText/checkcast/kt22714.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/coercionToUnitOptimization") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class CoercionToUnitOptimization extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class CoercionToUnitOptimization extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInCoercionToUnitOptimization() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/coercionToUnitOptimization"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("inRangeCheckWithConst.kt") public void testInRangeCheckWithConst() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coercionToUnitOptimization/inRangeCheckWithConst.kt"); } + @Test @TestMetadata("kt14360.kt") public void testKt14360() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coercionToUnitOptimization/kt14360.kt"); } + @Test @TestMetadata("largeMethodWithCoercionToUnit.kt") public void testLargeMethodWithCoercionToUnit() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coercionToUnitOptimization/largeMethodWithCoercionToUnit.kt"); } + @Test @TestMetadata("nopInlineFuns.kt") public void testNopInlineFuns() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coercionToUnitOptimization/nopInlineFuns.kt"); } + @Test @TestMetadata("returnsUnit.kt") public void testReturnsUnit() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coercionToUnitOptimization/returnsUnit.kt"); } + @Test @TestMetadata("safeCall.kt") public void testSafeCall() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coercionToUnitOptimization/safeCall.kt"); } + @Test @TestMetadata("safeCallWithReturnValue.kt") public void testSafeCallWithReturnValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coercionToUnitOptimization/safeCallWithReturnValue.kt"); } + @Test @TestMetadata("safeLet.kt") public void testSafeLet() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coercionToUnitOptimization/safeLet.kt"); } + @Test @TestMetadata("tryInlined.kt") public void testTryInlined() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coercionToUnitOptimization/tryInlined.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/companion") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Companion extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class Companion extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInCompanion() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/companion"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("directAccessToBackingField.kt") public void testDirectAccessToBackingField() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/directAccessToBackingField.kt"); } + @Test @TestMetadata("floatingPointCompanionAccess.kt") public void testFloatingPointCompanionAccess() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/floatingPointCompanionAccess.kt"); } + @Test @TestMetadata("inlineFunctionCompanionPropertyAccess.kt") public void testInlineFunctionCompanionPropertyAccess() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/inlineFunctionCompanionPropertyAccess.kt"); } + @Test @TestMetadata("inlineFunctionObjectCompanionPropertyAccess.kt") public void testInlineFunctionObjectCompanionPropertyAccess() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/inlineFunctionObjectCompanionPropertyAccess.kt"); } + @Test @TestMetadata("kt14258_1.kt") public void testKt14258_1() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/kt14258_1.kt"); } + @Test @TestMetadata("kt14258_2.kt") public void testKt14258_2() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/kt14258_2.kt"); } + @Test @TestMetadata("kt14258_3.kt") public void testKt14258_3() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/kt14258_3.kt"); } + @Test @TestMetadata("kt14258_4.kt") public void testKt14258_4() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/kt14258_4.kt"); } + @Test @TestMetadata("kt14258_5.kt") public void testKt14258_5() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/kt14258_5.kt"); } + @Test @TestMetadata("nonDefaultAccessors.kt") public void testNonDefaultAccessors() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/nonDefaultAccessors.kt"); } + @Test @TestMetadata("privateCompanionObjectAccessors_after.kt") public void testPrivateCompanionObjectAccessors_after() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/privateCompanionObjectAccessors_after.kt"); } + @Test @TestMetadata("privateCompanionObjectAccessors_before.kt") public void testPrivateCompanionObjectAccessors_before() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/privateCompanionObjectAccessors_before.kt"); } + @Test @TestMetadata("protectedCompanionObjectAccessors_after.kt") public void testProtectedCompanionObjectAccessors_after() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/protectedCompanionObjectAccessors_after.kt"); } + @Test @TestMetadata("protectedCompanionObjectAccessors_before.kt") public void testProtectedCompanionObjectAccessors_before() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/protectedCompanionObjectAccessors_before.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/conditions") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Conditions extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class Conditions extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInConditions() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/conditions"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("conjunction.kt") public void testConjunction() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/conjunction.kt"); } + @Test @TestMetadata("conjunctionInDoWhile.kt") public void testConjunctionInDoWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/conjunctionInDoWhile.kt"); } + @Test @TestMetadata("conjunctionInWhile.kt") public void testConjunctionInWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/conjunctionInWhile.kt"); } + @Test @TestMetadata("disjunction.kt") public void testDisjunction() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/disjunction.kt"); } + @Test @TestMetadata("negatedConjuction.kt") public void testNegatedConjuction() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/negatedConjuction.kt"); } + @Test @TestMetadata("negatedDisjunction.kt") public void testNegatedDisjunction() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/negatedDisjunction.kt"); } + @Test @TestMetadata("negatedNonZeroCompareInDoWhile.kt") public void testNegatedNonZeroCompareInDoWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/negatedNonZeroCompareInDoWhile.kt"); } + @Test @TestMetadata("negatedNonZeroCompareInIf.kt") public void testNegatedNonZeroCompareInIf() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/negatedNonZeroCompareInIf.kt"); } + @Test @TestMetadata("negatedNonZeroCompareInWhile.kt") public void testNegatedNonZeroCompareInWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/negatedNonZeroCompareInWhile.kt"); } + @Test @TestMetadata("negatedNullCompareInDoWhile.kt") public void testNegatedNullCompareInDoWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/negatedNullCompareInDoWhile.kt"); } + @Test @TestMetadata("negatedNullCompareInIf.kt") public void testNegatedNullCompareInIf() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/negatedNullCompareInIf.kt"); } + @Test @TestMetadata("negatedNullCompareInWhile.kt") public void testNegatedNullCompareInWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/negatedNullCompareInWhile.kt"); } + @Test @TestMetadata("negatedZeroCompareInDoWhile.kt") public void testNegatedZeroCompareInDoWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/negatedZeroCompareInDoWhile.kt"); } + @Test @TestMetadata("negatedZeroCompareInIf.kt") public void testNegatedZeroCompareInIf() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/negatedZeroCompareInIf.kt"); } + @Test @TestMetadata("negatedZeroCompareInWhile.kt") public void testNegatedZeroCompareInWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/negatedZeroCompareInWhile.kt"); } + @Test @TestMetadata("noBoxingForBoxedEqPrimitive.kt") public void testNoBoxingForBoxedEqPrimitive() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/noBoxingForBoxedEqPrimitive.kt"); } + @Test @TestMetadata("noBoxingForPrimitiveEqBoxed.kt") public void testNoBoxingForPrimitiveEqBoxed() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/noBoxingForPrimitiveEqBoxed.kt"); } + @Test @TestMetadata("noBoxingForPrimitiveEqObject.kt") public void testNoBoxingForPrimitiveEqObject() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/noBoxingForPrimitiveEqObject.kt"); } + @Test @TestMetadata("nonZeroCompareInDoWhile.kt") public void testNonZeroCompareInDoWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/nonZeroCompareInDoWhile.kt"); } + @Test @TestMetadata("nonZeroCompareInIf.kt") public void testNonZeroCompareInIf() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/nonZeroCompareInIf.kt"); } + @Test @TestMetadata("nonZeroCompareInWhile.kt") public void testNonZeroCompareInWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/nonZeroCompareInWhile.kt"); } + @Test @TestMetadata("nullCompareConst.kt") public void testNullCompareConst() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/nullCompareConst.kt"); } + @Test @TestMetadata("nullCompareInDoWhile.kt") public void testNullCompareInDoWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/nullCompareInDoWhile.kt"); } + @Test @TestMetadata("nullCompareInIf.kt") public void testNullCompareInIf() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/nullCompareInIf.kt"); } + @Test @TestMetadata("nullCompareInWhile.kt") public void testNullCompareInWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/nullCompareInWhile.kt"); } + @Test @TestMetadata("zeroCompareInDoWhile.kt") public void testZeroCompareInDoWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/zeroCompareInDoWhile.kt"); } + @Test @TestMetadata("zeroCompareInIf.kt") public void testZeroCompareInIf() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/zeroCompareInIf.kt"); } + @Test @TestMetadata("zeroCompareInWhile.kt") public void testZeroCompareInWhile() throws Exception { runTest("compiler/testData/codegen/bytecodeText/conditions/zeroCompareInWhile.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/constProperty") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ConstProperty extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class ConstProperty extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInConstProperty() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/constProperty"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("noAccessorsForPrivateConstants.kt") public void testNoAccessorsForPrivateConstants() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constProperty/noAccessorsForPrivateConstants.kt"); } + @Test @TestMetadata("noInline.kt") public void testNoInline() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constProperty/noInline.kt"); } + @Test @TestMetadata("noInlineInCmp.kt") public void testNoInlineInCmp() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constProperty/noInlineInCmp.kt"); } + @Test @TestMetadata("nonConstValHasNoDefaultValue_after.kt") public void testNonConstValHasNoDefaultValue_after() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constProperty/nonConstValHasNoDefaultValue_after.kt"); } + @Test @TestMetadata("nonConstValHasNoDefaultValue_before.kt") public void testNonConstValHasNoDefaultValue_before() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constProperty/nonConstValHasNoDefaultValue_before.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/constantConditions") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ConstantConditions extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class ConstantConditions extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInConstantConditions() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/constantConditions"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("cmpIntWith0.kt") public void testCmpIntWith0() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constantConditions/cmpIntWith0.kt"); } + @Test @TestMetadata("constantFlag.kt") public void testConstantFlag() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constantConditions/constantFlag.kt"); } + @Test @TestMetadata("constantInt.kt") public void testConstantInt() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constantConditions/constantInt.kt"); } + @Test @TestMetadata("inlineIfFalse.kt") public void testInlineIfFalse() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constantConditions/inlineIfFalse.kt"); } + @Test @TestMetadata("kt3098.kt") public void testKt3098() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constantConditions/kt3098.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/constants") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Constants extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class Constants extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInConstants() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/constants"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("byte.kt") public void testByte() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constants/byte.kt"); } + @Test @TestMetadata("comparisonFalse.kt") public void testComparisonFalse() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constants/comparisonFalse.kt"); } + @Test @TestMetadata("comparisonTrue.kt") public void testComparisonTrue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constants/comparisonTrue.kt"); } + @Test @TestMetadata("floatingPoints.kt") public void testFloatingPoints() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constants/floatingPoints.kt"); } + @Test @TestMetadata("inlineUnsignedIntConstant.kt") public void testInlineUnsignedIntConstant() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constants/inlineUnsignedIntConstant.kt"); } + @Test @TestMetadata("kt9532.kt") public void testKt9532() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constants/kt9532.kt"); } + @Test @TestMetadata("noInlineNonConst.kt") public void testNoInlineNonConst() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constants/noInlineNonConst.kt"); } + @Test @TestMetadata("noInlineNonStaticJavaField.kt") public void testNoInlineNonStaticJavaField() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constants/noInlineNonStaticJavaField.kt"); } + @Test @TestMetadata("noInlineNonStaticJavaField_lv10.kt") public void testNoInlineNonStaticJavaField_lv10() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constants/noInlineNonStaticJavaField_lv10.kt"); } + @Test @TestMetadata("nullableByteAndShort.kt") public void testNullableByteAndShort() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constants/nullableByteAndShort.kt"); } + @Test @TestMetadata("partialString.kt") public void testPartialString() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constants/partialString.kt"); } + @Test @TestMetadata("short.kt") public void testShort() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constants/short.kt"); } + @Test @TestMetadata("string.kt") public void testString() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constants/string.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/constructors") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Constructors extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class Constructors extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInConstructors() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/constructors"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("enumPrimaryDefaults.kt") public void testEnumPrimaryDefaults() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constructors/enumPrimaryDefaults.kt"); } + @Test @TestMetadata("inlineArgumentPrimaryDefaults.kt") public void testInlineArgumentPrimaryDefaults() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constructors/inlineArgumentPrimaryDefaults.kt"); } + @Test @TestMetadata("inlinePrimaryDefaults.kt") public void testInlinePrimaryDefaults() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constructors/inlinePrimaryDefaults.kt"); } + @Test @TestMetadata("innerPrimaryDefaults.kt") public void testInnerPrimaryDefaults() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constructors/innerPrimaryDefaults.kt"); } + @Test @TestMetadata("internalPrimaryDefaults.kt") public void testInternalPrimaryDefaults() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constructors/internalPrimaryDefaults.kt"); } + @Test @TestMetadata("localPrimaryDefaults.kt") public void testLocalPrimaryDefaults() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constructors/localPrimaryDefaults.kt"); } + @Test @TestMetadata("parameterlessPrimary.kt") public void testParameterlessPrimary() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constructors/parameterlessPrimary.kt"); } + @Test @TestMetadata("privatePrimaryDefaults.kt") public void testPrivatePrimaryDefaults() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constructors/privatePrimaryDefaults.kt"); } + @Test @TestMetadata("protectedPrimaryDefaults.kt") public void testProtectedPrimaryDefaults() throws Exception { runTest("compiler/testData/codegen/bytecodeText/constructors/protectedPrimaryDefaults.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/controlStructures") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ControlStructures extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class ControlStructures extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInControlStructures() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/controlStructures"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("ifConsts.kt") public void testIfConsts() throws Exception { runTest("compiler/testData/codegen/bytecodeText/controlStructures/ifConsts.kt"); } + @Test @TestMetadata("kt17110.kt") public void testKt17110() throws Exception { runTest("compiler/testData/codegen/bytecodeText/controlStructures/kt17110.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/coroutines") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Coroutines extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class Coroutines extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInCoroutines() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/coroutines"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("crossinlineSuspendContinuation_1_3.kt") public void testCrossinlineSuspendContinuation_1_3() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/crossinlineSuspendContinuation_1_3.kt"); } + @Test @TestMetadata("doNotReassignContinuation.kt") public void testDoNotReassignContinuation() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/doNotReassignContinuation.kt"); } + @Test @TestMetadata("effectivelyInlineOnly.kt") public void testEffectivelyInlineOnly() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/effectivelyInlineOnly.kt"); } + @Test @TestMetadata("internalInlineSuspend.kt") public void testInternalInlineSuspend() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/internalInlineSuspend.kt"); } + @Test @TestMetadata("mergeLvt.kt") public void testMergeLvt() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/mergeLvt.kt"); } + @Test @TestMetadata("nonLocalReturn.kt") public void testNonLocalReturn() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/nonLocalReturn.kt"); } + @Test @TestMetadata("returnUnitInLambda.kt") public void testReturnUnitInLambda() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/returnUnitInLambda.kt"); } + @Test @TestMetadata("suspendMain.kt") public void testSuspendMain() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/suspendMain.kt"); } + @Test @TestMetadata("throwOnFailure.kt") public void testThrowOnFailure() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/throwOnFailure.kt"); } + @Test @TestMetadata("varValueConflictsWithTable.kt") public void testVarValueConflictsWithTable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/varValueConflictsWithTable.kt"); } + @Test @TestMetadata("varValueConflictsWithTableSameSort.kt") public void testVarValueConflictsWithTableSameSort() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/varValueConflictsWithTableSameSort.kt"); } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/coroutines/cleanup") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Cleanup extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class Cleanup extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInCleanup() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/coroutines/cleanup"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("backEdge.kt") public void testBackEdge() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/cleanup/backEdge.kt"); } + @Test @TestMetadata("if.kt") public void testIf() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/cleanup/if.kt"); } + @Test @TestMetadata("nullCleanup.kt") public void testNullCleanup() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/cleanup/nullCleanup.kt"); } + @Test @TestMetadata("nullNotSpill.kt") public void testNullNotSpill() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/cleanup/nullNotSpill.kt"); } + @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/cleanup/simple.kt"); } + @Test @TestMetadata("twoRefs.kt") public void testTwoRefs() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/cleanup/twoRefs.kt"); } + @Test @TestMetadata("unusedParamNotSpill.kt") public void testUnusedParamNotSpill() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/cleanup/unusedParamNotSpill.kt"); } + @Test @TestMetadata("when.kt") public void testWhen() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/cleanup/when.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/coroutines/debug") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Debug extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class Debug extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInDebug() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/coroutines/debug"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("continuationInLvt.kt") public void testContinuationInLvt() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/debug/continuationInLvt.kt"); } + @Test @TestMetadata("localVariableCorrectLabel.kt") public void testLocalVariableCorrectLabel() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/debug/localVariableCorrectLabel.kt"); } + @Test @TestMetadata("probeCoroutineSuspended.kt") public void testProbeCoroutineSuspended() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/debug/probeCoroutineSuspended.kt"); } + @Test @TestMetadata("shrinkLvtTopLevel.kt") public void testShrinkLvtTopLevel() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/debug/shrinkLvtTopLevel.kt"); } + @Test @TestMetadata("thisAndResultInLvt.kt") public void testThisAndResultInLvt() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/debug/thisAndResultInLvt.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/coroutines/destructuringInLambda") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class DestructuringInLambda extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class DestructuringInLambda extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInDestructuringInLambda() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/coroutines/destructuringInLambda"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("inlineSeparateFiles.kt") public void testInlineSeparateFiles() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/destructuringInLambda/inlineSeparateFiles.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/coroutines/inlineClasses") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class InlineClasses extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class InlineClasses extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInInlineClasses() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/coroutines/inlineClasses"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("inlineClassBoxingInSuspendFunReturn_Primitive.kt") public void testInlineClassBoxingInSuspendFunReturn_Primitive() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/inlineClasses/inlineClassBoxingInSuspendFunReturn_Primitive.kt"); } + @Test @TestMetadata("noInlineClassBoxingInSuspendFunReturn_Any.kt") public void testNoInlineClassBoxingInSuspendFunReturn_Any() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/inlineClasses/noInlineClassBoxingInSuspendFunReturn_Any.kt"); } + @Test @TestMetadata("noInlineClassBoxingInSuspendFunReturn_InlineAny.kt") public void testNoInlineClassBoxingInSuspendFunReturn_InlineAny() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/inlineClasses/noInlineClassBoxingInSuspendFunReturn_InlineAny.kt"); } + @Test @TestMetadata("noInlineClassBoxingInSuspendFunReturn_SameJvmType.kt") public void testNoInlineClassBoxingInSuspendFunReturn_SameJvmType() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/inlineClasses/noInlineClassBoxingInSuspendFunReturn_SameJvmType.kt"); } + @Test @TestMetadata("noInlineClassBoxingInSuspendFunReturn_String.kt") public void testNoInlineClassBoxingInSuspendFunReturn_String() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/inlineClasses/noInlineClassBoxingInSuspendFunReturn_String.kt"); } + @Test @TestMetadata("returnResult.kt") public void testReturnResult() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/inlineClasses/returnResult.kt"); } + @Test @TestMetadata("returnStringOverride.kt") public void testReturnStringOverride() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/inlineClasses/returnStringOverride.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class IntLikeVarSpilling extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class IntLikeVarSpilling extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInIntLikeVarSpilling() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("complicatedMerge.kt") public void testComplicatedMerge() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/complicatedMerge.kt"); } + @Test @TestMetadata("i2bResult.kt") public void testI2bResult() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/i2bResult.kt"); } + @Test @TestMetadata("loadFromBooleanArray.kt") public void testLoadFromBooleanArray() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/loadFromBooleanArray.kt"); } + @Test @TestMetadata("loadFromByteArray.kt") public void testLoadFromByteArray() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/loadFromByteArray.kt"); } + @Test @TestMetadata("noVariableInTable.kt") public void testNoVariableInTable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/noVariableInTable.kt"); } + @Test @TestMetadata("sameIconst1ManyVars.kt") public void testSameIconst1ManyVars() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/sameIconst1ManyVars.kt"); } + @Test @TestMetadata("usedInArrayStore.kt") public void testUsedInArrayStore() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInArrayStore.kt"); } + @Test @TestMetadata("usedInMethodCall.kt") public void testUsedInMethodCall() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInMethodCall.kt"); } + @Test @TestMetadata("usedInPutfield.kt") public void testUsedInPutfield() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInPutfield.kt"); } + @Test @TestMetadata("usedInVarStore.kt") public void testUsedInVarStore() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/intLikeVarSpilling/usedInVarStore.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/coroutines/stateMachine") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class StateMachine extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class StateMachine extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInStateMachine() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/coroutines/stateMachine"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("kt25893.kt") public void testKt25893() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/stateMachine/kt25893.kt"); } + @Test @TestMetadata("withTypeParameter.kt") public void testWithTypeParameter() throws Exception { runTest("compiler/testData/codegen/bytecodeText/coroutines/stateMachine/withTypeParameter.kt"); @@ -1737,1058 +1939,1169 @@ public class IrBytecodeTextTestGenerated extends AbstractIrBytecodeTextTest { } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/deadCodeElimination") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class DeadCodeElimination extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class DeadCodeElimination extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInDeadCodeElimination() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/deadCodeElimination"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("arrayConstructor.kt") public void testArrayConstructor() throws Exception { runTest("compiler/testData/codegen/bytecodeText/deadCodeElimination/arrayConstructor.kt"); } + @Test @TestMetadata("boxing.kt") public void testBoxing() throws Exception { runTest("compiler/testData/codegen/bytecodeText/deadCodeElimination/boxing.kt"); } + @Test @TestMetadata("boxingNotOptimizable.kt") public void testBoxingNotOptimizable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/deadCodeElimination/boxingNotOptimizable.kt"); } + @Test @TestMetadata("emptyVariableRange.kt") public void testEmptyVariableRange() throws Exception { runTest("compiler/testData/codegen/bytecodeText/deadCodeElimination/emptyVariableRange.kt"); } + @Test @TestMetadata("kt14357.kt") public void testKt14357() throws Exception { runTest("compiler/testData/codegen/bytecodeText/deadCodeElimination/kt14357.kt"); } + @Test @TestMetadata("lastReturn.kt") public void testLastReturn() throws Exception { runTest("compiler/testData/codegen/bytecodeText/deadCodeElimination/lastReturn.kt"); } + @Test @TestMetadata("literal.kt") public void testLiteral() throws Exception { runTest("compiler/testData/codegen/bytecodeText/deadCodeElimination/literal.kt"); } + @Test @TestMetadata("simpleConstructor.kt") public void testSimpleConstructor() throws Exception { runTest("compiler/testData/codegen/bytecodeText/deadCodeElimination/simpleConstructor.kt"); } + @Test @TestMetadata("simpleConstructorNotRedundant.kt") public void testSimpleConstructorNotRedundant() throws Exception { runTest("compiler/testData/codegen/bytecodeText/deadCodeElimination/simpleConstructorNotRedundant.kt"); } + @Test @TestMetadata("simpleConstructorNotRedundantNotOptimizable.kt") public void testSimpleConstructorNotRedundantNotOptimizable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/deadCodeElimination/simpleConstructorNotRedundantNotOptimizable.kt"); } + @Test @TestMetadata("unusedPrimitiveAndObjectEquals.kt") public void testUnusedPrimitiveAndObjectEquals() throws Exception { runTest("compiler/testData/codegen/bytecodeText/deadCodeElimination/unusedPrimitiveAndObjectEquals.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/defaultArguments") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class DefaultArguments extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class DefaultArguments extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInDefaultArguments() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/defaultArguments"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("inheritedInterfaceFunction.kt") public void testInheritedInterfaceFunction() throws Exception { runTest("compiler/testData/codegen/bytecodeText/defaultArguments/inheritedInterfaceFunction.kt"); } + @Test @TestMetadata("kt11962.kt") public void testKt11962() throws Exception { runTest("compiler/testData/codegen/bytecodeText/defaultArguments/kt11962.kt"); } + @Test @TestMetadata("localVariablesInInlinedDefaultStubs.kt") public void testLocalVariablesInInlinedDefaultStubs() throws Exception { runTest("compiler/testData/codegen/bytecodeText/defaultArguments/localVariablesInInlinedDefaultStubs.kt"); } + @Test @TestMetadata("maskAndArgumentElimination.kt") public void testMaskAndArgumentElimination() throws Exception { runTest("compiler/testData/codegen/bytecodeText/defaultArguments/maskAndArgumentElimination.kt"); } + @Test @TestMetadata("maskCheckSequence.kt") public void testMaskCheckSequence() throws Exception { runTest("compiler/testData/codegen/bytecodeText/defaultArguments/maskCheckSequence.kt"); } + @Test @TestMetadata("methodHandlerElimination.kt") public void testMethodHandlerElimination() throws Exception { runTest("compiler/testData/codegen/bytecodeText/defaultArguments/methodHandlerElimination.kt"); } + @Test @TestMetadata("noAccessorForDefault.kt") public void testNoAccessorForDefault() throws Exception { runTest("compiler/testData/codegen/bytecodeText/defaultArguments/noAccessorForDefault.kt"); } + @Test @TestMetadata("noAnonymousObjectRegenerationInDefaultStub.kt") public void testNoAnonymousObjectRegenerationInDefaultStub() throws Exception { runTest("compiler/testData/codegen/bytecodeText/defaultArguments/noAnonymousObjectRegenerationInDefaultStub.kt"); } + @Test @TestMetadata("noEmptyArray.kt") public void testNoEmptyArray() throws Exception { runTest("compiler/testData/codegen/bytecodeText/defaultArguments/noEmptyArray.kt"); } + @Test @TestMetadata("noSyntheticParameters.kt") public void testNoSyntheticParameters() throws Exception { runTest("compiler/testData/codegen/bytecodeText/defaultArguments/noSyntheticParameters.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/directInvoke") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class DirectInvoke extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class DirectInvoke extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInDirectInvoke() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/directInvoke"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("callableReference.kt") public void testCallableReference() throws Exception { runTest("compiler/testData/codegen/bytecodeText/directInvoke/callableReference.kt"); } + @Test @TestMetadata("inplaceClosure.kt") public void testInplaceClosure() throws Exception { runTest("compiler/testData/codegen/bytecodeText/directInvoke/inplaceClosure.kt"); } + @Test @TestMetadata("localFun.kt") public void testLocalFun() throws Exception { runTest("compiler/testData/codegen/bytecodeText/directInvoke/localFun.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/disabledOptimizations") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class DisabledOptimizations extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class DisabledOptimizations extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInDisabledOptimizations() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/disabledOptimizations"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("noJumpInLastBranch.kt") public void testNoJumpInLastBranch() throws Exception { runTest("compiler/testData/codegen/bytecodeText/disabledOptimizations/noJumpInLastBranch.kt"); } + @Test @TestMetadata("noJumpInSingleBranch.kt") public void testNoJumpInSingleBranch() throws Exception { runTest("compiler/testData/codegen/bytecodeText/disabledOptimizations/noJumpInSingleBranch.kt"); } + @Test @TestMetadata("noObjectCastAfterReification.kt") public void testNoObjectCastAfterReification() throws Exception { runTest("compiler/testData/codegen/bytecodeText/disabledOptimizations/noObjectCastAfterReification.kt"); } + @Test @TestMetadata("noUnitInstanceInDefaultParameterInitialization.kt") public void testNoUnitInstanceInDefaultParameterInitialization() throws Exception { runTest("compiler/testData/codegen/bytecodeText/disabledOptimizations/noUnitInstanceInDefaultParameterInitialization.kt"); } + @Test @TestMetadata("noUnitInstanceOnVoidFunctionCall.kt") public void testNoUnitInstanceOnVoidFunctionCall() throws Exception { runTest("compiler/testData/codegen/bytecodeText/disabledOptimizations/noUnitInstanceOnVoidFunctionCall.kt"); } + @Test @TestMetadata("noUnusedLabel.kt") public void testNoUnusedLabel() throws Exception { runTest("compiler/testData/codegen/bytecodeText/disabledOptimizations/noUnusedLabel.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/enum") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Enum extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class Enum extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInEnum() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/enum"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("constructorAccessors.kt") public void testConstructorAccessors() throws Exception { runTest("compiler/testData/codegen/bytecodeText/enum/constructorAccessors.kt"); } + @Test @TestMetadata("enumCheckcasts.kt") public void testEnumCheckcasts() throws Exception { runTest("compiler/testData/codegen/bytecodeText/enum/enumCheckcasts.kt"); } + @Test @TestMetadata("kt18731.kt") public void testKt18731() throws Exception { runTest("compiler/testData/codegen/bytecodeText/enum/kt18731.kt"); } + @Test @TestMetadata("kt18731_2.kt") public void testKt18731_2() throws Exception { runTest("compiler/testData/codegen/bytecodeText/enum/kt18731_2.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/exclExcl") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ExclExcl extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class ExclExcl extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInExclExcl() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/exclExcl"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("primitive.kt") public void testPrimitive() throws Exception { runTest("compiler/testData/codegen/bytecodeText/exclExcl/primitive.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/fieldsForCapturedValues") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class FieldsForCapturedValues extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class FieldsForCapturedValues extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInFieldsForCapturedValues() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/fieldsForCapturedValues"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("extensionLambdaExtensionReceiver.kt") public void testExtensionLambdaExtensionReceiver() throws Exception { runTest("compiler/testData/codegen/bytecodeText/fieldsForCapturedValues/extensionLambdaExtensionReceiver.kt"); } + @Test @TestMetadata("extensionReceiver.kt") public void testExtensionReceiver() throws Exception { runTest("compiler/testData/codegen/bytecodeText/fieldsForCapturedValues/extensionReceiver.kt"); } + @Test @TestMetadata("innerAndOuterThis.kt") public void testInnerAndOuterThis() throws Exception { runTest("compiler/testData/codegen/bytecodeText/fieldsForCapturedValues/innerAndOuterThis.kt"); } + @Test @TestMetadata("labeledExtensionLambdaExtensionReceiver.kt") public void testLabeledExtensionLambdaExtensionReceiver() throws Exception { runTest("compiler/testData/codegen/bytecodeText/fieldsForCapturedValues/labeledExtensionLambdaExtensionReceiver.kt"); } + @Test @TestMetadata("multipleExtensionReceivers.kt") public void testMultipleExtensionReceivers() throws Exception { runTest("compiler/testData/codegen/bytecodeText/fieldsForCapturedValues/multipleExtensionReceivers.kt"); } + @Test @TestMetadata("outerThis.kt") public void testOuterThis() throws Exception { runTest("compiler/testData/codegen/bytecodeText/fieldsForCapturedValues/outerThis.kt"); } + @Test @TestMetadata("outerThisInInnerConstructor.kt") public void testOuterThisInInnerConstructor() throws Exception { runTest("compiler/testData/codegen/bytecodeText/fieldsForCapturedValues/outerThisInInnerConstructor.kt"); } + @Test @TestMetadata("outerThisInInnerInitBlock.kt") public void testOuterThisInInnerInitBlock() throws Exception { runTest("compiler/testData/codegen/bytecodeText/fieldsForCapturedValues/outerThisInInnerInitBlock.kt"); } + @Test @TestMetadata("this.kt") public void testThis() throws Exception { runTest("compiler/testData/codegen/bytecodeText/fieldsForCapturedValues/this.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/forLoop") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ForLoop extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class ForLoop extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInForLoop() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/forLoop"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("forInCharSequence.kt") public void testForInCharSequence() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInCharSequence.kt"); } + @Test @TestMetadata("forInCharSequenceTypeParameter.kt") public void testForInCharSequenceTypeParameter() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInCharSequenceTypeParameter.kt"); } + @Test @TestMetadata("forInDownToCharMinValue.kt") public void testForInDownToCharMinValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInDownToCharMinValue.kt"); } + @Test @TestMetadata("forInDownToIntMinValue.kt") public void testForInDownToIntMinValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInDownToIntMinValue.kt"); } + @Test @TestMetadata("forInDownToLongMinValue.kt") public void testForInDownToLongMinValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInDownToLongMinValue.kt"); } + @Test @TestMetadata("forInObjectArray.kt") public void testForInObjectArray() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInObjectArray.kt"); } + @Test @TestMetadata("forInPrimitiveArray.kt") public void testForInPrimitiveArray() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInPrimitiveArray.kt"); } + @Test @TestMetadata("forInRangeSpecializedToUntil.kt") public void testForInRangeSpecializedToUntil() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeSpecializedToUntil.kt"); } + @Test @TestMetadata("forInRangeToCharConst.kt") public void testForInRangeToCharConst() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeToCharConst.kt"); } + @Test @TestMetadata("forInRangeToCharMaxValue.kt") public void testForInRangeToCharMaxValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeToCharMaxValue.kt"); } + @Test @TestMetadata("forInRangeToConst.kt") public void testForInRangeToConst() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeToConst.kt"); } + @Test @TestMetadata("forInRangeToIntMaxValue.kt") public void testForInRangeToIntMaxValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeToIntMaxValue.kt"); } + @Test @TestMetadata("forInRangeToLongConst.kt") public void testForInRangeToLongConst() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeToLongConst.kt"); } + @Test @TestMetadata("forInRangeToLongMaxValue.kt") public void testForInRangeToLongMaxValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeToLongMaxValue.kt"); } + @Test @TestMetadata("forInRangeToQualifiedConst.kt") public void testForInRangeToQualifiedConst() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeToQualifiedConst.kt"); } + @Test @TestMetadata("forInRangeWithImplicitReceiver.kt") public void testForInRangeWithImplicitReceiver() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInRangeWithImplicitReceiver.kt"); } + @Test @TestMetadata("forInStringSpecialized.kt") public void testForInStringSpecialized() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInStringSpecialized.kt"); } + @Test @TestMetadata("forIntInDownTo.kt") public void testForIntInDownTo() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forIntInDownTo.kt"); } + @Test @TestMetadata("iincGeneration.kt") public void testIincGeneration() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/iincGeneration.kt"); } + @Test @TestMetadata("intrinsicArrayConstructorsUseCounterLoop.kt") public void testIntrinsicArrayConstructorsUseCounterLoop() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/intrinsicArrayConstructorsUseCounterLoop.kt"); } + @Test @TestMetadata("loopVarInterval.kt") public void testLoopVarInterval() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/loopVarInterval.kt"); } + @Test @TestMetadata("primitiveLiteralRange1.kt") public void testPrimitiveLiteralRange1() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/primitiveLiteralRange1.kt"); } + @Test @TestMetadata("primitiveLiteralRange2.kt") public void testPrimitiveLiteralRange2() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/primitiveLiteralRange2.kt"); } + @Test @TestMetadata("primitiveProgression.kt") public void testPrimitiveProgression() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/primitiveProgression.kt"); } + @Test @TestMetadata("primitiveRange.kt") public void testPrimitiveRange() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/primitiveRange.kt"); } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/forLoop/forInArrayWithIndex") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ForInArrayWithIndex extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class ForInArrayWithIndex extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInForInArrayWithIndex() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/forLoop/forInArrayWithIndex"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("forInArrayWithIndexNoElementVar.kt") public void testForInArrayWithIndexNoElementVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInArrayWithIndex/forInArrayWithIndexNoElementVar.kt"); } + @Test @TestMetadata("forInArrayWithIndexNoIndexVar.kt") public void testForInArrayWithIndexNoIndexVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInArrayWithIndex/forInArrayWithIndexNoIndexVar.kt"); } + @Test @TestMetadata("forInEmptyArrayWithIndex.kt") public void testForInEmptyArrayWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInArrayWithIndex/forInEmptyArrayWithIndex.kt"); } + @Test @TestMetadata("forInIntArrayWithIndex.kt") public void testForInIntArrayWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInArrayWithIndex/forInIntArrayWithIndex.kt"); } + @Test @TestMetadata("forInObjectArrayWithIndex.kt") public void testForInObjectArrayWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInArrayWithIndex/forInObjectArrayWithIndex.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/forLoop/forInCharSequenceWithIndex") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ForInCharSequenceWithIndex extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class ForInCharSequenceWithIndex extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInForInCharSequenceWithIndex() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/forLoop/forInCharSequenceWithIndex"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("forInCharSequenceWithIndex.kt") public void testForInCharSequenceWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInCharSequenceWithIndex/forInCharSequenceWithIndex.kt"); } + @Test @TestMetadata("forInEmptyStringWithIndex.kt") public void testForInEmptyStringWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInCharSequenceWithIndex/forInEmptyStringWithIndex.kt"); } + @Test @TestMetadata("forInStringWithIndex.kt") public void testForInStringWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInCharSequenceWithIndex/forInStringWithIndex.kt"); } + @Test @TestMetadata("forInStringWithIndexNoElementVar.kt") public void testForInStringWithIndexNoElementVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInCharSequenceWithIndex/forInStringWithIndexNoElementVar.kt"); } + @Test @TestMetadata("forInStringWithIndexNoIndexVar.kt") public void testForInStringWithIndexNoIndexVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInCharSequenceWithIndex/forInStringWithIndexNoIndexVar.kt"); } + @Test @TestMetadata("forInStringWithIndexWithExplicitlyTypedIndexVariable.kt") public void testForInStringWithIndexWithExplicitlyTypedIndexVariable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInCharSequenceWithIndex/forInStringWithIndexWithExplicitlyTypedIndexVariable.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/forLoop/forInIndices") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ForInIndices extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class ForInIndices extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInForInIndices() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/forLoop/forInIndices"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("forInArrayListIndices.kt") public void testForInArrayListIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIndices/forInArrayListIndices.kt"); } + @Test @TestMetadata("forInCharSequenceIndices.kt") public void testForInCharSequenceIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIndices/forInCharSequenceIndices.kt"); } + @Test @TestMetadata("forInCharSequenceTypeParameterIndices.kt") public void testForInCharSequenceTypeParameterIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIndices/forInCharSequenceTypeParameterIndices.kt"); } + @Test @TestMetadata("forInCollectionImplicitReceiverIndices.kt") public void testForInCollectionImplicitReceiverIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIndices/forInCollectionImplicitReceiverIndices.kt"); } + @Test @TestMetadata("forInCollectionIndices.kt") public void testForInCollectionIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIndices/forInCollectionIndices.kt"); } + @Test @TestMetadata("forInCollectionTypeParameterIndices.kt") public void testForInCollectionTypeParameterIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIndices/forInCollectionTypeParameterIndices.kt"); } + @Test @TestMetadata("forInNonOptimizedIndices.kt") public void testForInNonOptimizedIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIndices/forInNonOptimizedIndices.kt"); } + @Test @TestMetadata("forInObjectArrayIndices.kt") public void testForInObjectArrayIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIndices/forInObjectArrayIndices.kt"); } + @Test @TestMetadata("forInPrimitiveArrayIndices.kt") public void testForInPrimitiveArrayIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIndices/forInPrimitiveArrayIndices.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/forLoop/forInIterableWithIndex") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ForInIterableWithIndex extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class ForInIterableWithIndex extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInForInIterableWithIndex() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/forLoop/forInIterableWithIndex"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("forInEmptyListWithIndex.kt") public void testForInEmptyListWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIterableWithIndex/forInEmptyListWithIndex.kt"); } + @Test @TestMetadata("forInIterableTypeParameterWithIndex.kt") public void testForInIterableTypeParameterWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIterableWithIndex/forInIterableTypeParameterWithIndex.kt"); } + @Test @TestMetadata("forInListWithIndex.kt") public void testForInListWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIterableWithIndex/forInListWithIndex.kt"); } + @Test @TestMetadata("forInListWithIndexNoElementVar.kt") public void testForInListWithIndexNoElementVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIterableWithIndex/forInListWithIndexNoElementVar.kt"); } + @Test @TestMetadata("forInListWithIndexNoIndexVar.kt") public void testForInListWithIndexNoIndexVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIterableWithIndex/forInListWithIndexNoIndexVar.kt"); } + @Test @TestMetadata("forInListWithIndexWithExplicitlyTypedIndexVariable.kt") public void testForInListWithIndexWithExplicitlyTypedIndexVariable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInIterableWithIndex/forInListWithIndexWithExplicitlyTypedIndexVariable.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ForInProgressionWithIndex extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class ForInProgressionWithIndex extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInForInProgressionWithIndex() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("forInDownToWithIndex.kt") public void testForInDownToWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInDownToWithIndex.kt"); } + @Test @TestMetadata("forInIndicesWithIndex.kt") public void testForInIndicesWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInIndicesWithIndex.kt"); } + @Test @TestMetadata("forInRangeToWithIndex.kt") public void testForInRangeToWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInRangeToWithIndex.kt"); } + @Test @TestMetadata("forInReversedStepWithIndex.kt") public void testForInReversedStepWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInReversedStepWithIndex.kt"); } + @Test @TestMetadata("forInReversedWithIndex.kt") public void testForInReversedWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInReversedWithIndex.kt"); } + @Test @TestMetadata("forInStepReversedWithIndex.kt") public void testForInStepReversedWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInStepReversedWithIndex.kt"); } + @Test @TestMetadata("forInStepWithIndex.kt") public void testForInStepWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInStepWithIndex.kt"); } + @Test @TestMetadata("forInUntilWithIndex.kt") public void testForInUntilWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInUntilWithIndex.kt"); } + @Test @TestMetadata("forInWithIndexNoIndexOrElementVar.kt") public void testForInWithIndexNoIndexOrElementVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInWithIndexNoIndexOrElementVar.kt"); } + @Test @TestMetadata("forInWithIndexNotDestructured.kt") public void testForInWithIndexNotDestructured() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInWithIndexNotDestructured.kt"); } + @Test @TestMetadata("forInWithIndexReversed.kt") public void testForInWithIndexReversed() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInWithIndexReversed.kt"); } + @Test @TestMetadata("forInWithIndexWithIndex.kt") public void testForInWithIndexWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInProgressionWithIndex/forInWithIndexWithIndex.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/forLoop/forInReversed") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ForInReversed extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class ForInReversed extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInForInReversed() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/forLoop/forInReversed"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("forInReversedArrayIndices.kt") public void testForInReversedArrayIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInReversed/forInReversedArrayIndices.kt"); } + @Test @TestMetadata("forInReversedCharSequenceIndices.kt") public void testForInReversedCharSequenceIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInReversed/forInReversedCharSequenceIndices.kt"); } + @Test @TestMetadata("forInReversedCollectionIndices.kt") public void testForInReversedCollectionIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInReversed/forInReversedCollectionIndices.kt"); } + @Test @TestMetadata("forInReversedDownTo.kt") public void testForInReversedDownTo() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInReversed/forInReversedDownTo.kt"); } + @Test @TestMetadata("forInReversedEmptyRangeLiteral.kt") public void testForInReversedEmptyRangeLiteral() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInReversed/forInReversedEmptyRangeLiteral.kt"); } + @Test @TestMetadata("forInReversedRange.kt") public void testForInReversedRange() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInReversed/forInReversedRange.kt"); } + @Test @TestMetadata("forInReversedRangeLiteral.kt") public void testForInReversedRangeLiteral() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInReversed/forInReversedRangeLiteral.kt"); } + @Test @TestMetadata("forInReversedReversedArrayIndices.kt") public void testForInReversedReversedArrayIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInReversed/forInReversedReversedArrayIndices.kt"); } + @Test @TestMetadata("forInReversedReversedDownTo.kt") public void testForInReversedReversedDownTo() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInReversed/forInReversedReversedDownTo.kt"); } + @Test @TestMetadata("ForInReversedReversedRange.kt") public void testForInReversedReversedRange() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInReversed/ForInReversedReversedRange.kt"); } + @Test @TestMetadata("forInReversedReversedReversedRange.kt") public void testForInReversedReversedReversedRange() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInReversed/forInReversedReversedReversedRange.kt"); } + @Test @TestMetadata("forInReversedReversedUntil.kt") public void testForInReversedReversedUntil() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInReversed/forInReversedReversedUntil.kt"); } + @Test @TestMetadata("forInReversedUntil.kt") public void testForInReversedUntil() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInReversed/forInReversedUntil.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/forLoop/forInSequenceWithIndex") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ForInSequenceWithIndex extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class ForInSequenceWithIndex extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInForInSequenceWithIndex() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/forLoop/forInSequenceWithIndex"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("forInEmptySequenceWithIndex.kt") public void testForInEmptySequenceWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInSequenceWithIndex/forInEmptySequenceWithIndex.kt"); } + @Test @TestMetadata("forInSequenceTypeParameterWithIndex.kt") public void testForInSequenceTypeParameterWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInSequenceWithIndex/forInSequenceTypeParameterWithIndex.kt"); } + @Test @TestMetadata("forInSequenceWithIndex.kt") public void testForInSequenceWithIndex() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInSequenceWithIndex/forInSequenceWithIndex.kt"); } + @Test @TestMetadata("forInSequenceWithIndexNoElementVar.kt") public void testForInSequenceWithIndexNoElementVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInSequenceWithIndex/forInSequenceWithIndexNoElementVar.kt"); } + @Test @TestMetadata("forInSequenceWithIndexNoIndexVar.kt") public void testForInSequenceWithIndexNoIndexVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInSequenceWithIndex/forInSequenceWithIndexNoIndexVar.kt"); } + @Test @TestMetadata("forInSequenceWithIndexThrowsCME.kt") public void testForInSequenceWithIndexThrowsCME() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInSequenceWithIndex/forInSequenceWithIndexThrowsCME.kt"); } + @Test @TestMetadata("forInSequenceWithIndexWithExplicitlyTypedIndexVariable.kt") public void testForInSequenceWithIndexWithExplicitlyTypedIndexVariable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInSequenceWithIndex/forInSequenceWithIndexWithExplicitlyTypedIndexVariable.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/forLoop/forInUntil") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ForInUntil extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class ForInUntil extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInForInUntil() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/forLoop/forInUntil"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("forInUntilChar.kt") public void testForInUntilChar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInUntil/forInUntilChar.kt"); } + @Test @TestMetadata("forInUntilCharMaxValue.kt") public void testForInUntilCharMaxValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInUntil/forInUntilCharMaxValue.kt"); } + @Test @TestMetadata("forInUntilCharMinValue.kt") public void testForInUntilCharMinValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInUntil/forInUntilCharMinValue.kt"); } + @Test @TestMetadata("forInUntilInt.kt") public void testForInUntilInt() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInUntil/forInUntilInt.kt"); } + @Test @TestMetadata("forInUntilIntMaxValue.kt") public void testForInUntilIntMaxValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInUntil/forInUntilIntMaxValue.kt"); } + @Test @TestMetadata("forInUntilIntMinValue.kt") public void testForInUntilIntMinValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInUntil/forInUntilIntMinValue.kt"); } + @Test @TestMetadata("forInUntilLong.kt") public void testForInUntilLong() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInUntil/forInUntilLong.kt"); } + @Test @TestMetadata("forInUntilLongMaxValue.kt") public void testForInUntilLongMaxValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInUntil/forInUntilLongMaxValue.kt"); } + @Test @TestMetadata("forInUntilLongMinValue.kt") public void testForInUntilLongMinValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/forInUntil/forInUntilLongMinValue.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/forLoop/stepped") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Stepped extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class Stepped extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInStepped() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/forLoop/stepped"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("illegalStepConst.kt") public void testIllegalStepConst() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/stepped/illegalStepConst.kt"); } + @Test @TestMetadata("reversedThenStep.kt") public void testReversedThenStep() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/stepped/reversedThenStep.kt"); } + @Test @TestMetadata("stepConst.kt") public void testStepConst() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/stepped/stepConst.kt"); } + @Test @TestMetadata("stepConstOnNonLiteralProgression.kt") public void testStepConstOnNonLiteralProgression() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/stepped/stepConstOnNonLiteralProgression.kt"); } + @Test @TestMetadata("stepNonConst.kt") public void testStepNonConst() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/stepped/stepNonConst.kt"); } + @Test @TestMetadata("stepNonConstOnNonLiteralProgression.kt") public void testStepNonConstOnNonLiteralProgression() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/stepped/stepNonConstOnNonLiteralProgression.kt"); } + @Test @TestMetadata("stepOnNonLiteralRange.kt") public void testStepOnNonLiteralRange() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/stepped/stepOnNonLiteralRange.kt"); } + @Test @TestMetadata("stepOne.kt") public void testStepOne() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/stepped/stepOne.kt"); } + @Test @TestMetadata("stepOneThenStepOne.kt") public void testStepOneThenStepOne() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/stepped/stepOneThenStepOne.kt"); } + @Test @TestMetadata("stepThenDifferentStep.kt") public void testStepThenDifferentStep() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/stepped/stepThenDifferentStep.kt"); } + @Test @TestMetadata("stepThenReversed.kt") public void testStepThenReversed() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/stepped/stepThenReversed.kt"); } + @Test @TestMetadata("stepThenSameStep.kt") public void testStepThenSameStep() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/stepped/stepThenSameStep.kt"); } + @Test @TestMetadata("stepThenStepNonConst.kt") public void testStepThenStepNonConst() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/stepped/stepThenStepNonConst.kt"); } + @Test @TestMetadata("stepThenStepOne.kt") public void testStepThenStepOne() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/stepped/stepThenStepOne.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/forLoop/unsigned") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Unsigned extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class Unsigned extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInUnsigned() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/forLoop/unsigned"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("forInDownToUIntMinValue.kt") public void testForInDownToUIntMinValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInDownToUIntMinValue.kt"); } + @Test @TestMetadata("forInDownToULongMinValue.kt") public void testForInDownToULongMinValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInDownToULongMinValue.kt"); } + @Test @TestMetadata("forInOptimizableUnsignedRange.kt") public void testForInOptimizableUnsignedRange() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInOptimizableUnsignedRange.kt"); } + @Test @TestMetadata("forInRangeToUIntMaxValue.kt") public void testForInRangeToUIntMaxValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInRangeToUIntMaxValue.kt"); } + @Test @TestMetadata("forInRangeToULongMaxValue.kt") public void testForInRangeToULongMaxValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInRangeToULongMaxValue.kt"); } + @Test @TestMetadata("forInUntilUIntMaxValue.kt") public void testForInUntilUIntMaxValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInUntilUIntMaxValue.kt"); } + @Test @TestMetadata("forInUntilUIntMinValue.kt") public void testForInUntilUIntMinValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInUntilUIntMinValue.kt"); } + @Test @TestMetadata("forInUntilULongMaxValue.kt") public void testForInUntilULongMaxValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInUntilULongMaxValue.kt"); } + @Test @TestMetadata("forInUntilULongMinValue.kt") public void testForInUntilULongMinValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/forInUntilULongMinValue.kt"); } + @Test @TestMetadata("illegalStepConst.kt") public void testIllegalStepConst() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/illegalStepConst.kt"); } + @Test @TestMetadata("reversedThenStep.kt") public void testReversedThenStep() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/reversedThenStep.kt"); } + @Test @TestMetadata("stepConstOnNonLiteralProgression.kt") public void testStepConstOnNonLiteralProgression() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/stepConstOnNonLiteralProgression.kt"); } + @Test @TestMetadata("stepNonConstOnNonLiteralProgression.kt") public void testStepNonConstOnNonLiteralProgression() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/stepNonConstOnNonLiteralProgression.kt"); } + @Test @TestMetadata("stepOnNonLiteralRange.kt") public void testStepOnNonLiteralRange() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/stepOnNonLiteralRange.kt"); } + @Test @TestMetadata("stepThenDifferentStep.kt") public void testStepThenDifferentStep() throws Exception { runTest("compiler/testData/codegen/bytecodeText/forLoop/unsigned/stepThenDifferentStep.kt"); @@ -2796,201 +3109,219 @@ public class IrBytecodeTextTestGenerated extends AbstractIrBytecodeTextTest { } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/hashCode") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class HashCode extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class HashCode extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInHashCode() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/hashCode"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("hashCode.kt") public void testHashCode() throws Exception { runTest("compiler/testData/codegen/bytecodeText/hashCode/hashCode.kt"); } + @Test @TestMetadata("interfaceHashCode.kt") public void testInterfaceHashCode() throws Exception { runTest("compiler/testData/codegen/bytecodeText/hashCode/interfaceHashCode.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/ieee754") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Ieee754 extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class Ieee754 extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInIeee754() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/ieee754"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("nullableDoubleEquals.kt") public void testNullableDoubleEquals() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ieee754/nullableDoubleEquals.kt"); } + @Test @TestMetadata("nullableDoubleNotEquals.kt") public void testNullableDoubleNotEquals() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ieee754/nullableDoubleNotEquals.kt"); } + @Test @TestMetadata("nullableFloatEquals.kt") public void testNullableFloatEquals() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ieee754/nullableFloatEquals.kt"); } + @Test @TestMetadata("nullableFloatNotEquals.kt") public void testNullableFloatNotEquals() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ieee754/nullableFloatNotEquals.kt"); } + @Test @TestMetadata("smartCastsForDouble.kt") public void testSmartCastsForDouble() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ieee754/smartCastsForDouble.kt"); } + @Test @TestMetadata("smartCastsForFloat.kt") public void testSmartCastsForFloat() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ieee754/smartCastsForFloat.kt"); } + @Test @TestMetadata("when.kt") public void testWhen() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ieee754/when.kt"); } + @Test @TestMetadata("whenNullableSmartCast.kt") public void testWhenNullableSmartCast() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ieee754/whenNullableSmartCast.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/inline") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Inline extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class Inline extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInInline() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/inline"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("deleteClassOnTransformation.kt") public void testDeleteClassOnTransformation() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/deleteClassOnTransformation.kt"); } + @Test @TestMetadata("finallyMarkers.kt") public void testFinallyMarkers() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/finallyMarkers.kt"); } + @Test @TestMetadata("inlineArgumentSlots.kt") public void testInlineArgumentSlots() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/inlineArgumentSlots.kt"); } + @Test @TestMetadata("inlineReturnsNothing1.kt") public void testInlineReturnsNothing1() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/inlineReturnsNothing1.kt"); } + @Test @TestMetadata("inlineReturnsNothing2.kt") public void testInlineReturnsNothing2() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/inlineReturnsNothing2.kt"); } + @Test @TestMetadata("inlineReturnsNothing3.kt") public void testInlineReturnsNothing3() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/inlineReturnsNothing3.kt"); } + @Test @TestMetadata("inlineSuspendReifiedNoSpilling.kt") public void testInlineSuspendReifiedNoSpilling() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/inlineSuspendReifiedNoSpilling.kt"); } + @Test @TestMetadata("interfaceDefaultMethod.kt") public void testInterfaceDefaultMethod() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/interfaceDefaultMethod.kt"); } + @Test @TestMetadata("linenumberForOneParametersArgumentCall.kt") public void testLinenumberForOneParametersArgumentCall() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/linenumberForOneParametersArgumentCall.kt"); } + @Test @TestMetadata("noSynAccessor.kt") public void testNoSynAccessor() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/noSynAccessor.kt"); } + @Test @TestMetadata("noSynAccessorToDirectFieldAccess.kt") public void testNoSynAccessorToDirectFieldAccess() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/noSynAccessorToDirectFieldAccess.kt"); } + @Test @TestMetadata("noSynAccessorToSuper.kt") public void testNoSynAccessorToSuper() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/noSynAccessorToSuper.kt"); } + @Test @TestMetadata("notSplitedExceptionTable.kt") public void testNotSplitedExceptionTable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/notSplitedExceptionTable.kt"); } + @Test @TestMetadata("reifiedSafeAsWithMutable.kt") public void testReifiedSafeAsWithMutable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/reifiedSafeAsWithMutable.kt"); } + @Test @TestMetadata("remappedLocalVar.kt") public void testRemappedLocalVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/remappedLocalVar.kt"); } + @Test @TestMetadata("removedFinallyMarkers.kt") public void testRemovedFinallyMarkers() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/removedFinallyMarkers.kt"); } + @Test @TestMetadata("specialEnumFunction.kt") public void testSpecialEnumFunction() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/specialEnumFunction.kt"); } + @Test @TestMetadata("splitedExceptionTable.kt") public void testSplitedExceptionTable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/splitedExceptionTable.kt"); } + @Test @TestMetadata("whenMappingOnCallSite.kt") public void testWhenMappingOnCallSite() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/whenMappingOnCallSite.kt"); } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/inline/property") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Property extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class Property extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInProperty() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/inline/property"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inline/property/simple.kt"); @@ -2998,646 +3329,714 @@ public class IrBytecodeTextTestGenerated extends AbstractIrBytecodeTextTest { } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/inlineClasses") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class InlineClasses extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class InlineClasses extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInInlineClasses() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/inlineClasses"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("asCastForInlineClass.kt") public void testAsCastForInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/asCastForInlineClass.kt"); } + @Test @TestMetadata("assertionsForParametersOfInlineClassTypes.kt") public void testAssertionsForParametersOfInlineClassTypes() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/assertionsForParametersOfInlineClassTypes.kt"); } + @Test @TestMetadata("boxInlineClassInsideElvisWithNullConstant.kt") public void testBoxInlineClassInsideElvisWithNullConstant() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/boxInlineClassInsideElvisWithNullConstant.kt"); } + @Test @TestMetadata("boxInlineClassesOnPassingToVarargs.kt") public void testBoxInlineClassesOnPassingToVarargs() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/boxInlineClassesOnPassingToVarargs.kt"); } + @Test @TestMetadata("boxMethodCalledByInlineClass.kt") public void testBoxMethodCalledByInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/boxMethodCalledByInlineClass.kt"); } + @Test @TestMetadata("boxResultAfterConstructorCall.kt") public void testBoxResultAfterConstructorCall() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/boxResultAfterConstructorCall.kt"); } + @Test @TestMetadata("boxResultInlineClassOfConstructorCall.kt") public void testBoxResultInlineClassOfConstructorCall() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/boxResultInlineClassOfConstructorCall.kt"); } + @Test @TestMetadata("boxThisOfInlineClass.kt") public void testBoxThisOfInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/boxThisOfInlineClass.kt"); } + @Test @TestMetadata("boxUnboxInlineClassFromMethodReturnType.kt") public void testBoxUnboxInlineClassFromMethodReturnType() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/boxUnboxInlineClassFromMethodReturnType.kt"); } + @Test @TestMetadata("boxUnboxInsideLambdaAsLastExpression.kt") public void testBoxUnboxInsideLambdaAsLastExpression() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/boxUnboxInsideLambdaAsLastExpression.kt"); } + @Test @TestMetadata("boxUnboxOfInlineClassesWithFunctionalTypes.kt") public void testBoxUnboxOfInlineClassesWithFunctionalTypes() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/boxUnboxOfInlineClassesWithFunctionalTypes.kt"); } + @Test @TestMetadata("boxUnboxOnInlinedParameters.kt") public void testBoxUnboxOnInlinedParameters() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/boxUnboxOnInlinedParameters.kt"); } + @Test @TestMetadata("boxingForNonLocalAndLabeledReturnsOfInlineClasses.kt") public void testBoxingForNonLocalAndLabeledReturnsOfInlineClasses() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/boxingForNonLocalAndLabeledReturnsOfInlineClasses.kt"); } + @Test @TestMetadata("callMemberMethodsInsideInlineClass.kt") public void testCallMemberMethodsInsideInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/callMemberMethodsInsideInlineClass.kt"); } + @Test @TestMetadata("checkBoxingInInlineClass.kt") public void testCheckBoxingInInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/checkBoxingInInlineClass.kt"); } + @Test @TestMetadata("checkOuterInlineFunctionCall.kt") public void testCheckOuterInlineFunctionCall() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/checkOuterInlineFunctionCall.kt"); } + @Test @TestMetadata("constructorBridge.kt") public void testConstructorBridge() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/constructorBridge.kt"); } + @Test @TestMetadata("constructorWithDefaultArguments.kt") public void testConstructorWithDefaultArguments() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/constructorWithDefaultArguments.kt"); } + @Test @TestMetadata("defaultParametersDontBox.kt") public void testDefaultParametersDontBox() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/defaultParametersDontBox.kt"); } + @Test @TestMetadata("delegatedPropertyMangling.kt") public void testDelegatedPropertyMangling() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/delegatedPropertyMangling.kt"); } + @Test @TestMetadata("equalsDoesNotBox.kt") public void testEqualsDoesNotBox() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/equalsDoesNotBox.kt"); } + @Test @TestMetadata("equalsIsCalledByInlineClass.kt") public void testEqualsIsCalledByInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/equalsIsCalledByInlineClass.kt"); } + @Test @TestMetadata("factoryMethodForSecondaryConstructorsCalledByInlineClass.kt") public void testFactoryMethodForSecondaryConstructorsCalledByInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/factoryMethodForSecondaryConstructorsCalledByInlineClass.kt"); } + @Test @TestMetadata("functionsWithInlineClassParametersHaveStableMangledNames.kt") public void testFunctionsWithInlineClassParametersHaveStableMangledNames() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/functionsWithInlineClassParametersHaveStableMangledNames.kt"); } + @Test @TestMetadata("generationOfAccessorToUnderlyingValue.kt") public void testGenerationOfAccessorToUnderlyingValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/generationOfAccessorToUnderlyingValue.kt"); } + @Test @TestMetadata("hashCodeIsCalledByInlineClass.kt") public void testHashCodeIsCalledByInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/hashCodeIsCalledByInlineClass.kt"); } + @Test @TestMetadata("inlineClassBoxingOnAssignment.kt") public void testInlineClassBoxingOnAssignment() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/inlineClassBoxingOnAssignment.kt"); } + @Test @TestMetadata("inlineClassBoxingOnFunctionCall.kt") public void testInlineClassBoxingOnFunctionCall() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/inlineClassBoxingOnFunctionCall.kt"); } + @Test @TestMetadata("inlineClassBoxingUnboxingInsideInlinedLambda.kt") public void testInlineClassBoxingUnboxingInsideInlinedLambda() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/inlineClassBoxingUnboxingInsideInlinedLambda.kt"); } + @Test @TestMetadata("inlineClassInGeneratedToString.kt") public void testInlineClassInGeneratedToString() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/inlineClassInGeneratedToString.kt"); } + @Test @TestMetadata("inlineClassInStringTemplate.kt") public void testInlineClassInStringTemplate() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/inlineClassInStringTemplate.kt"); } + @Test @TestMetadata("inlineClassesUnboxingAfterAssertionOperator.kt") public void testInlineClassesUnboxingAfterAssertionOperator() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/inlineClassesUnboxingAfterAssertionOperator.kt"); } + @Test @TestMetadata("interfaceDefaultImplStubs.kt") public void testInterfaceDefaultImplStubs() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/interfaceDefaultImplStubs.kt"); } + @Test @TestMetadata("interfaceJvmDefaultImplStubs.kt") public void testInterfaceJvmDefaultImplStubs() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/interfaceJvmDefaultImplStubs.kt"); } + @Test @TestMetadata("isCheckForInlineClass.kt") public void testIsCheckForInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/isCheckForInlineClass.kt"); } + @Test @TestMetadata("mangledInlineClassInterfaceImplementation.kt") public void testMangledInlineClassInterfaceImplementation() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/mangledInlineClassInterfaceImplementation.kt"); } + @Test @TestMetadata("noActualCallsOfInlineFunctionsOfInlineClass.kt") public void testNoActualCallsOfInlineFunctionsOfInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/noActualCallsOfInlineFunctionsOfInlineClass.kt"); } + @Test @TestMetadata("noAssertionsForInlineClassesBasedOnNullableTypes.kt") public void testNoAssertionsForInlineClassesBasedOnNullableTypes() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/noAssertionsForInlineClassesBasedOnNullableTypes.kt"); } + @Test @TestMetadata("noBoxingInMethod.kt") public void testNoBoxingInMethod() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/noBoxingInMethod.kt"); } + @Test @TestMetadata("noBoxingOnCastOperations.kt") public void testNoBoxingOnCastOperations() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/noBoxingOnCastOperations.kt"); } + @Test @TestMetadata("noBoxingOperationsOnNonTrivialSpread.kt") public void testNoBoxingOperationsOnNonTrivialSpread() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/noBoxingOperationsOnNonTrivialSpread.kt"); } + @Test @TestMetadata("noBoxingUnboxingInAccessorsForDelegatedPropertyWithInlineClassDelegate.kt") public void testNoBoxingUnboxingInAccessorsForDelegatedPropertyWithInlineClassDelegate() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/noBoxingUnboxingInAccessorsForDelegatedPropertyWithInlineClassDelegate.kt"); } + @Test @TestMetadata("noManglingForFunctionsWithJvmName.kt") public void testNoManglingForFunctionsWithJvmName() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/noManglingForFunctionsWithJvmName.kt"); } + @Test @TestMetadata("noReturnTypeMangling.kt") public void testNoReturnTypeMangling() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/noReturnTypeMangling.kt"); } + @Test @TestMetadata("nonOverridingMethodsAreCalledByInlineClass.kt") public void testNonOverridingMethodsAreCalledByInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/nonOverridingMethodsAreCalledByInlineClass.kt"); } + @Test @TestMetadata("overridingMethodsAreCalledByInlineClass.kt") public void testOverridingMethodsAreCalledByInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/overridingMethodsAreCalledByInlineClass.kt"); } + @Test @TestMetadata("passInlineClassesWithSpreadOperatorToVarargs.kt") public void testPassInlineClassesWithSpreadOperatorToVarargs() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/passInlineClassesWithSpreadOperatorToVarargs.kt"); } + @Test @TestMetadata("primaryConstructorCalledByInlineClass.kt") public void testPrimaryConstructorCalledByInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/primaryConstructorCalledByInlineClass.kt"); } + @Test @TestMetadata("propertyAccessorsAreCalledByInlineClass.kt") public void testPropertyAccessorsAreCalledByInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/propertyAccessorsAreCalledByInlineClass.kt"); } + @Test @TestMetadata("propertySetterWithInlineClassTypeArgument.kt") public void testPropertySetterWithInlineClassTypeArgument() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/propertySetterWithInlineClassTypeArgument.kt"); } + @Test @TestMetadata("resultApiDoesntCallSpecializedEquals.kt") public void testResultApiDoesntCallSpecializedEquals() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/resultApiDoesntCallSpecializedEquals.kt"); } + @Test @TestMetadata("resultApiDoesntUseBox.kt") public void testResultApiDoesntUseBox() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/resultApiDoesntUseBox.kt"); } + @Test @TestMetadata("resultApiEqualsDoesntBox.kt") public void testResultApiEqualsDoesntBox() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/resultApiEqualsDoesntBox.kt"); } + @Test @TestMetadata("resultApiRunCatchingDoesntBox.kt") public void testResultApiRunCatchingDoesntBox() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/resultApiRunCatchingDoesntBox.kt"); } + @Test @TestMetadata("resultApiStringInterpolationDoesntBox.kt") public void testResultApiStringInterpolationDoesntBox() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/resultApiStringInterpolationDoesntBox.kt"); } + @Test @TestMetadata("resultMangling.kt") public void testResultMangling() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/resultMangling.kt"); } + @Test @TestMetadata("skipCallToUnderlyingValueOfInlineClass.kt") public void testSkipCallToUnderlyingValueOfInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/skipCallToUnderlyingValueOfInlineClass.kt"); } + @Test @TestMetadata("suspendFunctionMangling.kt") public void testSuspendFunctionMangling() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/suspendFunctionMangling.kt"); } + @Test @TestMetadata("toStringOfInlineClassValue.kt") public void testToStringOfInlineClassValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/toStringOfInlineClassValue.kt"); } + @Test @TestMetadata("toStringOfReferenceInlineClassValue.kt") public void testToStringOfReferenceInlineClassValue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/toStringOfReferenceInlineClassValue.kt"); } + @Test @TestMetadata("uIntArrayIteratorWithoutBoxing.kt") public void testUIntArrayIteratorWithoutBoxing() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/uIntArrayIteratorWithoutBoxing.kt"); } + @Test @TestMetadata("uIntArraySwapBoxing.kt") public void testUIntArraySwapBoxing() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/uIntArraySwapBoxing.kt"); } + @Test @TestMetadata("unboxInlineClassAfterElvis.kt") public void testUnboxInlineClassAfterElvis() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/unboxInlineClassAfterElvis.kt"); } + @Test @TestMetadata("unboxInlineClassAfterSafeCall.kt") public void testUnboxInlineClassAfterSafeCall() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/unboxInlineClassAfterSafeCall.kt"); } + @Test @TestMetadata("unboxInlineClassFromParameterizedType.kt") public void testUnboxInlineClassFromParameterizedType() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/unboxInlineClassFromParameterizedType.kt"); } + @Test @TestMetadata("unboxInlineClassesAfterSmartCasts.kt") public void testUnboxInlineClassesAfterSmartCasts() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/unboxInlineClassesAfterSmartCasts.kt"); } + @Test @TestMetadata("unboxMethodCalledByInlineClass.kt") public void testUnboxMethodCalledByInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/inlineClasses/unboxMethodCalledByInlineClass.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/innerClasses") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class InnerClasses extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class InnerClasses extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInInnerClasses() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/innerClasses"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("nestedClassInAnnotationArgument.kt") public void testNestedClassInAnnotationArgument() throws Exception { runTest("compiler/testData/codegen/bytecodeText/innerClasses/nestedClassInAnnotationArgument.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/interfaces") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Interfaces extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class Interfaces extends AbstractIrBytecodeTextTest { + @Test @TestMetadata("addedInterfaceBridge.kt") public void testAddedInterfaceBridge() throws Exception { runTest("compiler/testData/codegen/bytecodeText/interfaces/addedInterfaceBridge.kt"); } + @Test public void testAllFilesPresentInInterfaces() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/interfaces"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("firstInheritedMethodIsAbstract.kt") public void testFirstInheritedMethodIsAbstract() throws Exception { runTest("compiler/testData/codegen/bytecodeText/interfaces/firstInheritedMethodIsAbstract.kt"); } + @Test @TestMetadata("noAnyMethodsOnInterfaceInheritance.kt") public void testNoAnyMethodsOnInterfaceInheritance() throws Exception { runTest("compiler/testData/codegen/bytecodeText/interfaces/noAnyMethodsOnInterfaceInheritance.kt"); } + @Test @TestMetadata("noPrivateMemberInJavaInterface.kt") public void testNoPrivateMemberInJavaInterface() throws Exception { runTest("compiler/testData/codegen/bytecodeText/interfaces/noPrivateMemberInJavaInterface.kt"); } + @Test @TestMetadata("traitImplGeneratedOnce.kt") public void testTraitImplGeneratedOnce() throws Exception { runTest("compiler/testData/codegen/bytecodeText/interfaces/traitImplGeneratedOnce.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/intrinsics") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Intrinsics extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class Intrinsics extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInIntrinsics() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/intrinsics"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("javaObjectType.kt") public void testJavaObjectType() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsics/javaObjectType.kt"); } + @Test @TestMetadata("javaPrimitiveType.kt") public void testJavaPrimitiveType() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsics/javaPrimitiveType.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/intrinsicsCompare") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class IntrinsicsCompare extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class IntrinsicsCompare extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInIntrinsicsCompare() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/intrinsicsCompare"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("byteSmartCast_after.kt") public void testByteSmartCast_after() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsicsCompare/byteSmartCast_after.kt"); } + @Test @TestMetadata("byteSmartCast_before.kt") public void testByteSmartCast_before() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsicsCompare/byteSmartCast_before.kt"); } + @Test @TestMetadata("charSmartCast.kt") public void testCharSmartCast() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsicsCompare/charSmartCast.kt"); } + @Test @TestMetadata("differentTypes_after.kt") public void testDifferentTypes_after() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsicsCompare/differentTypes_after.kt"); } + @Test @TestMetadata("differentTypes_before.kt") public void testDifferentTypes_before() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsicsCompare/differentTypes_before.kt"); } + @Test @TestMetadata("intSmartCast_after.kt") public void testIntSmartCast_after() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsicsCompare/intSmartCast_after.kt"); } + @Test @TestMetadata("intSmartCast_before.kt") public void testIntSmartCast_before() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsicsCompare/intSmartCast_before.kt"); } + @Test @TestMetadata("longSmartCast.kt") public void testLongSmartCast() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsicsCompare/longSmartCast.kt"); } + @Test @TestMetadata("shortSmartCast_after.kt") public void testShortSmartCast_after() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsicsCompare/shortSmartCast_after.kt"); } + @Test @TestMetadata("shortSmartCast_before.kt") public void testShortSmartCast_before() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsicsCompare/shortSmartCast_before.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/intrinsicsTrim") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class IntrinsicsTrim extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class IntrinsicsTrim extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInIntrinsicsTrim() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/intrinsicsTrim"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("trimIndentNegative.kt") public void testTrimIndentNegative() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsicsTrim/trimIndentNegative.kt"); } + @Test @TestMetadata("trimIndentPositive.kt") public void testTrimIndentPositive() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsicsTrim/trimIndentPositive.kt"); } + @Test @TestMetadata("trimMarginNegative.kt") public void testTrimMarginNegative() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsicsTrim/trimMarginNegative.kt"); } + @Test @TestMetadata("trimMarginPositive.kt") public void testTrimMarginPositive() throws Exception { runTest("compiler/testData/codegen/bytecodeText/intrinsicsTrim/trimMarginPositive.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/jvm8") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Jvm8 extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class Jvm8 extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInJvm8() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/jvm8"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/jvm8/hashCode") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class HashCode extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class HashCode extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInHashCode() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/jvm8/hashCode"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("dataClass.kt") public void testDataClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/jvm8/hashCode/dataClass.kt"); } + @Test @TestMetadata("hashCode.kt") public void testHashCode() throws Exception { runTest("compiler/testData/codegen/bytecodeText/jvm8/hashCode/hashCode.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class JvmDefault extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class JvmDefault extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInJvmDefault() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault/allCompatibility") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class AllCompatibility extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class AllCompatibility extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInAllCompatibility() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault/allCompatibility"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("defaultArgs.kt") public void testDefaultArgs() throws Exception { runTest("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault/allCompatibility/defaultArgs.kt"); } + @Test @TestMetadata("simpleDiamond.kt") public void testSimpleDiamond() throws Exception { runTest("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault/allCompatibility/simpleDiamond.kt"); } + @Test @TestMetadata("simpleFunction.kt") public void testSimpleFunction() throws Exception { runTest("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault/allCompatibility/simpleFunction.kt"); } + @Test @TestMetadata("simpleFunctionWithAbstractOverride.kt") public void testSimpleFunctionWithAbstractOverride() throws Exception { runTest("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault/allCompatibility/simpleFunctionWithAbstractOverride.kt"); } + @Test @TestMetadata("simpleProperty.kt") public void testSimpleProperty() throws Exception { runTest("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault/allCompatibility/simpleProperty.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault/compatibility") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Compatibility extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class Compatibility extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInCompatibility() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault/compatibility"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("defaultArgs.kt") public void testDefaultArgs() throws Exception { runTest("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault/compatibility/defaultArgs.kt"); } + @Test @TestMetadata("simpleDiamond.kt") public void testSimpleDiamond() throws Exception { runTest("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault/compatibility/simpleDiamond.kt"); } + @Test @TestMetadata("simpleFunction.kt") public void testSimpleFunction() throws Exception { runTest("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault/compatibility/simpleFunction.kt"); } + @Test @TestMetadata("simpleFunctionWithAbstractOverride.kt") public void testSimpleFunctionWithAbstractOverride() throws Exception { runTest("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault/compatibility/simpleFunctionWithAbstractOverride.kt"); } + @Test @TestMetadata("simpleProperty.kt") public void testSimpleProperty() throws Exception { runTest("compiler/testData/codegen/bytecodeText/jvm8/jvmDefault/compatibility/simpleProperty.kt"); @@ -3646,498 +4045,553 @@ public class IrBytecodeTextTestGenerated extends AbstractIrBytecodeTextTest { } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/lazyCodegen") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class LazyCodegen extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class LazyCodegen extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInLazyCodegen() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/lazyCodegen"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("inlineConstInsideComparison.kt") public void testInlineConstInsideComparison() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lazyCodegen/inlineConstInsideComparison.kt"); } + @Test @TestMetadata("negateConst.kt") public void testNegateConst() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lazyCodegen/negateConst.kt"); } + @Test @TestMetadata("negateConstantCompare.kt") public void testNegateConstantCompare() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lazyCodegen/negateConstantCompare.kt"); } + @Test @TestMetadata("negateObjectComp.kt") public void testNegateObjectComp() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lazyCodegen/negateObjectComp.kt"); } + @Test @TestMetadata("negateObjectCompChaing.kt") public void testNegateObjectCompChaing() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lazyCodegen/negateObjectCompChaing.kt"); } + @Test @TestMetadata("negateVar.kt") public void testNegateVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lazyCodegen/negateVar.kt"); } + @Test @TestMetadata("negateVarChain.kt") public void testNegateVarChain() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lazyCodegen/negateVarChain.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/lineNumbers") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class LineNumbers extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class LineNumbers extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInLineNumbers() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/lineNumbers"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("ifConsts.kt") public void testIfConsts() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lineNumbers/ifConsts.kt"); } + @Test @TestMetadata("ifElse.kt") public void testIfElse() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lineNumbers/ifElse.kt"); } + @Test @TestMetadata("ifFalse.kt") public void testIfFalse() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lineNumbers/ifFalse.kt"); } + @Test @TestMetadata("ifFalseElse.kt") public void testIfFalseElse() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lineNumbers/ifFalseElse.kt"); } + @Test @TestMetadata("ifTrue.kt") public void testIfTrue() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lineNumbers/ifTrue.kt"); } + @Test @TestMetadata("ifTrueElse.kt") public void testIfTrueElse() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lineNumbers/ifTrueElse.kt"); } + @Test @TestMetadata("inlineCondition.kt") public void testInlineCondition() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lineNumbers/inlineCondition.kt"); } + @Test @TestMetadata("inlineCondition2.kt") public void testInlineCondition2() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lineNumbers/inlineCondition2.kt"); } + @Test @TestMetadata("inlineLambdaObjectInit.kt") public void testInlineLambdaObjectInit() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lineNumbers/inlineLambdaObjectInit.kt"); } + @Test @TestMetadata("singleThen.kt") public void testSingleThen() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lineNumbers/singleThen.kt"); } + @Test @TestMetadata("tryCatch.kt") public void testTryCatch() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lineNumbers/tryCatch.kt"); } + @Test @TestMetadata("when.kt") public void testWhen() throws Exception { runTest("compiler/testData/codegen/bytecodeText/lineNumbers/when.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/localInitializationLVT") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class LocalInitializationLVT extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class LocalInitializationLVT extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInLocalInitializationLVT() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/localInitializationLVT"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("boxing.kt") public void testBoxing() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/boxing.kt"); } + @Test @TestMetadata("boxingVar.kt") public void testBoxingVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/boxingVar.kt"); } + @Test @TestMetadata("contract.kt") public void testContract() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/contract.kt"); } + @Test @TestMetadata("contractVar.kt") public void testContractVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/contractVar.kt"); } + @Test @TestMetadata("generics.kt") public void testGenerics() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/generics.kt"); } + @Test @TestMetadata("genericsVar.kt") public void testGenericsVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/genericsVar.kt"); } + @Test @TestMetadata("ifStatement.kt") public void testIfStatement() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/ifStatement.kt"); } + @Test @TestMetadata("ifStatementVar.kt") public void testIfStatementVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/ifStatementVar.kt"); } + @Test @TestMetadata("ifStatementWithoutBlock.kt") public void testIfStatementWithoutBlock() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/ifStatementWithoutBlock.kt"); } + @Test @TestMetadata("ifStatementWithoutBlockVar.kt") public void testIfStatementWithoutBlockVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/ifStatementWithoutBlockVar.kt"); } + @Test @TestMetadata("inlineClass.kt") public void testInlineClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/inlineClass.kt"); } + @Test @TestMetadata("inlineClassVar.kt") public void testInlineClassVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/inlineClassVar.kt"); } + @Test @TestMetadata("lateinit.kt") public void testLateinit() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/lateinit.kt"); } + @Test @TestMetadata("run.kt") public void testRun() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/run.kt"); } + @Test @TestMetadata("runVar.kt") public void testRunVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/runVar.kt"); } + @Test @TestMetadata("singleBlock.kt") public void testSingleBlock() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/singleBlock.kt"); } + @Test @TestMetadata("singleBlockVar.kt") public void testSingleBlockVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/singleBlockVar.kt"); } + @Test @TestMetadata("whenStatement.kt") public void testWhenStatement() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/whenStatement.kt"); } + @Test @TestMetadata("whenStatementVar.kt") public void testWhenStatementVar() throws Exception { runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/whenStatementVar.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/mangling") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Mangling extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class Mangling extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInMangling() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/mangling"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("parentheses.kt") public void testParentheses() throws Exception { runTest("compiler/testData/codegen/bytecodeText/mangling/parentheses.kt"); } + @Test @TestMetadata("parenthesesNoSanitize.kt") public void testParenthesesNoSanitize() throws Exception { runTest("compiler/testData/codegen/bytecodeText/mangling/parenthesesNoSanitize.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/multifileClasses") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class MultifileClasses extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class MultifileClasses extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInMultifileClasses() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/multifileClasses"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("defaultFunctionInMultifileClass.kt") public void testDefaultFunctionInMultifileClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/multifileClasses/defaultFunctionInMultifileClass.kt"); } + @Test @TestMetadata("optimizedMultifileClassFacadeMethods.kt") public void testOptimizedMultifileClassFacadeMethods() throws Exception { runTest("compiler/testData/codegen/bytecodeText/multifileClasses/optimizedMultifileClassFacadeMethods.kt"); } + @Test @TestMetadata("privateFunctionName.kt") public void testPrivateFunctionName() throws Exception { runTest("compiler/testData/codegen/bytecodeText/multifileClasses/privateFunctionName.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/notNullAssertions") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class NotNullAssertions extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class NotNullAssertions extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInNotNullAssertions() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/notNullAssertions"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("arrayListGet.kt") public void testArrayListGet() throws Exception { runTest("compiler/testData/codegen/bytecodeText/notNullAssertions/arrayListGet.kt"); } + @Test @TestMetadata("assertionForNotNullCaptured.kt") public void testAssertionForNotNullCaptured() throws Exception { runTest("compiler/testData/codegen/bytecodeText/notNullAssertions/assertionForNotNullCaptured.kt"); } + @Test @TestMetadata("assertionForNotNullTypeParam.kt") public void testAssertionForNotNullTypeParam() throws Exception { runTest("compiler/testData/codegen/bytecodeText/notNullAssertions/assertionForNotNullTypeParam.kt"); } + @Test @TestMetadata("assertionForNotNullTypeParam_1_4.kt") public void testAssertionForNotNullTypeParam_1_4() throws Exception { runTest("compiler/testData/codegen/bytecodeText/notNullAssertions/assertionForNotNullTypeParam_1_4.kt"); } + @Test @TestMetadata("doNotGenerateParamAssertions.kt") public void testDoNotGenerateParamAssertions() throws Exception { runTest("compiler/testData/codegen/bytecodeText/notNullAssertions/doNotGenerateParamAssertions.kt"); } + @Test @TestMetadata("javaMultipleSubstitutions.kt") public void testJavaMultipleSubstitutions() throws Exception { runTest("compiler/testData/codegen/bytecodeText/notNullAssertions/javaMultipleSubstitutions.kt"); } + @Test @TestMetadata("noAssertionForNullableCaptured.kt") public void testNoAssertionForNullableCaptured() throws Exception { runTest("compiler/testData/codegen/bytecodeText/notNullAssertions/noAssertionForNullableCaptured.kt"); } + @Test @TestMetadata("noAssertionForNullableGenericMethod.kt") public void testNoAssertionForNullableGenericMethod() throws Exception { runTest("compiler/testData/codegen/bytecodeText/notNullAssertions/noAssertionForNullableGenericMethod.kt"); } + @Test @TestMetadata("noAssertionForNullableGenericMethodCall.kt") public void testNoAssertionForNullableGenericMethodCall() throws Exception { runTest("compiler/testData/codegen/bytecodeText/notNullAssertions/noAssertionForNullableGenericMethodCall.kt"); } + @Test @TestMetadata("noAssertionForPrivateMethod.kt") public void testNoAssertionForPrivateMethod() throws Exception { runTest("compiler/testData/codegen/bytecodeText/notNullAssertions/noAssertionForPrivateMethod.kt"); } + @Test @TestMetadata("noAssertionsForKotlin.kt") public void testNoAssertionsForKotlin() throws Exception { runTest("compiler/testData/codegen/bytecodeText/notNullAssertions/noAssertionsForKotlin.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/nullCheckOptimization") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class NullCheckOptimization extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class NullCheckOptimization extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInNullCheckOptimization() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/nullCheckOptimization"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("alreadyCheckedForIs.kt") public void testAlreadyCheckedForIs() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/alreadyCheckedForIs.kt"); } + @Test @TestMetadata("alreadyCheckedForNull.kt") public void testAlreadyCheckedForNull() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/alreadyCheckedForNull.kt"); } + @Test @TestMetadata("deterministicNotNullChecks.kt") public void testDeterministicNotNullChecks() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/deterministicNotNullChecks.kt"); } + @Test @TestMetadata("expressionValueIsNotNull.kt") public void testExpressionValueIsNotNull() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/expressionValueIsNotNull.kt"); } + @Test @TestMetadata("expressionValueIsNotNullAfterExclExcl.kt") public void testExpressionValueIsNotNullAfterExclExcl() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/expressionValueIsNotNullAfterExclExcl.kt"); } + @Test @TestMetadata("expressionValueIsNotNullTwice.kt") public void testExpressionValueIsNotNullTwice() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/expressionValueIsNotNullTwice.kt"); } + @Test @TestMetadata("ifNullEqualsNull.kt") public void testIfNullEqualsNull() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/ifNullEqualsNull.kt"); } + @Test @TestMetadata("ifNullEqualsNullInline.kt") public void testIfNullEqualsNullInline() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/ifNullEqualsNullInline.kt"); } + @Test @TestMetadata("ifUnitEqualsNull.kt") public void testIfUnitEqualsNull() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/ifUnitEqualsNull.kt"); } + @Test @TestMetadata("ifUnitEqualsNullInline.kt") public void testIfUnitEqualsNullInline() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/ifUnitEqualsNullInline.kt"); } + @Test @TestMetadata("kt12839.kt") public void testKt12839() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/kt12839.kt"); } + @Test @TestMetadata("multipleExclExcl_1_4.kt") public void testMultipleExclExcl_1_4() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/multipleExclExcl_1_4.kt"); } + @Test @TestMetadata("notNullAsNotNullable.kt") public void testNotNullAsNotNullable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/notNullAsNotNullable.kt"); } + @Test @TestMetadata("notNullExpressionValueTwice_1_4.kt") public void testNotNullExpressionValueTwice_1_4() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/notNullExpressionValueTwice_1_4.kt"); } + @Test @TestMetadata("nullCheckAfterExclExcl_1_4.kt") public void testNullCheckAfterExclExcl_1_4() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/nullCheckAfterExclExcl_1_4.kt"); } + @Test @TestMetadata("nullabilityAssertionOnDispatchReceiver.kt") public void testNullabilityAssertionOnDispatchReceiver() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/nullabilityAssertionOnDispatchReceiver.kt"); } + @Test @TestMetadata("primitiveCheck.kt") public void testPrimitiveCheck() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/primitiveCheck.kt"); } + @Test @TestMetadata("redundantSafeCall.kt") public void testRedundantSafeCall() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/redundantSafeCall.kt"); } + @Test @TestMetadata("redundantSafeCall_1_4.kt") public void testRedundantSafeCall_1_4() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/redundantSafeCall_1_4.kt"); } + @Test @TestMetadata("reifiedIs.kt") public void testReifiedIs() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/reifiedIs.kt"); } + @Test @TestMetadata("reifiedNullIs.kt") public void testReifiedNullIs() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/reifiedNullIs.kt"); } + @Test @TestMetadata("trivialInstanceOf.kt") public void testTrivialInstanceOf() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/trivialInstanceOf.kt"); } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/nullCheckOptimization/localLateinit") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class LocalLateinit extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class LocalLateinit extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInLocalLateinit() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/nullCheckOptimization/localLateinit"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("checkedAlways.kt") public void testCheckedAlways() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/localLateinit/checkedAlways.kt"); } + @Test @TestMetadata("checkedOnce.kt") public void testCheckedOnce() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/localLateinit/checkedOnce.kt"); } + @Test @TestMetadata("initialized.kt") public void testInitialized() throws Exception { runTest("compiler/testData/codegen/bytecodeText/nullCheckOptimization/localLateinit/initialized.kt"); @@ -4145,126 +4599,129 @@ public class IrBytecodeTextTestGenerated extends AbstractIrBytecodeTextTest { } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/optimizedDelegatedProperties") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class OptimizedDelegatedProperties extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class OptimizedDelegatedProperties extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInOptimizedDelegatedProperties() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/optimizedDelegatedProperties"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("definedInSources.kt") public void testDefinedInSources() throws Exception { runTest("compiler/testData/codegen/bytecodeText/optimizedDelegatedProperties/definedInSources.kt"); } + @Test @TestMetadata("inSeparateModule.kt") public void testInSeparateModule() throws Exception { runTest("compiler/testData/codegen/bytecodeText/optimizedDelegatedProperties/inSeparateModule.kt"); } + @Test @TestMetadata("lazy.kt") public void testLazy() throws Exception { runTest("compiler/testData/codegen/bytecodeText/optimizedDelegatedProperties/lazy.kt"); } + @Test @TestMetadata("withNonNullMetadataParameter.kt") public void testWithNonNullMetadataParameter() throws Exception { runTest("compiler/testData/codegen/bytecodeText/optimizedDelegatedProperties/withNonNullMetadataParameter.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/parameterlessMain") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ParameterlessMain extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class ParameterlessMain extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInParameterlessMain() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/parameterlessMain"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("dontGenerateOnExtensionReceiver.kt") public void testDontGenerateOnExtensionReceiver() throws Exception { runTest("compiler/testData/codegen/bytecodeText/parameterlessMain/dontGenerateOnExtensionReceiver.kt"); } + @Test @TestMetadata("dontGenerateOnJvmNameMain.kt") public void testDontGenerateOnJvmNameMain() throws Exception { runTest("compiler/testData/codegen/bytecodeText/parameterlessMain/dontGenerateOnJvmNameMain.kt"); } + @Test @TestMetadata("dontGenerateOnJvmOverloads.kt") public void testDontGenerateOnJvmOverloads() throws Exception { runTest("compiler/testData/codegen/bytecodeText/parameterlessMain/dontGenerateOnJvmOverloads.kt"); } + @Test @TestMetadata("dontGenerateOnMain.kt") public void testDontGenerateOnMain() throws Exception { runTest("compiler/testData/codegen/bytecodeText/parameterlessMain/dontGenerateOnMain.kt"); } + @Test @TestMetadata("dontGenerateOnMainExtension.kt") public void testDontGenerateOnMainExtension() throws Exception { runTest("compiler/testData/codegen/bytecodeText/parameterlessMain/dontGenerateOnMainExtension.kt"); } + @Test @TestMetadata("dontGenerateOnNullableArray.kt") public void testDontGenerateOnNullableArray() throws Exception { runTest("compiler/testData/codegen/bytecodeText/parameterlessMain/dontGenerateOnNullableArray.kt"); } + @Test @TestMetadata("dontGenerateOnVarargsString.kt") public void testDontGenerateOnVarargsString() throws Exception { runTest("compiler/testData/codegen/bytecodeText/parameterlessMain/dontGenerateOnVarargsString.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/properties") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Properties extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class Properties extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInProperties() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/properties"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("dataClass.kt") public void testDataClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/properties/dataClass.kt"); } + @Test @TestMetadata("openDataClass.kt") public void testOpenDataClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/properties/openDataClass.kt"); } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/properties/lateinit") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Lateinit extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class Lateinit extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInLateinit() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/properties/lateinit"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("companionObject.kt") public void testCompanionObject() throws Exception { runTest("compiler/testData/codegen/bytecodeText/properties/lateinit/companionObject.kt"); } + @Test @TestMetadata("companionObjectFromLambda.kt") public void testCompanionObjectFromLambda() throws Exception { runTest("compiler/testData/codegen/bytecodeText/properties/lateinit/companionObjectFromLambda.kt"); @@ -4272,791 +4729,882 @@ public class IrBytecodeTextTestGenerated extends AbstractIrBytecodeTextTest { } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/ranges") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Ranges extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class Ranges extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInRanges() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/ranges"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("ifNotInRange.kt") public void testIfNotInRange() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ranges/ifNotInRange.kt"); } + @Test @TestMetadata("inArrayIndices.kt") public void testInArrayIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ranges/inArrayIndices.kt"); } + @Test @TestMetadata("inCharSequenceIndices.kt") public void testInCharSequenceIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ranges/inCharSequenceIndices.kt"); } + @Test @TestMetadata("inCollectionIndices.kt") public void testInCollectionIndices() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ranges/inCollectionIndices.kt"); } + @Test @TestMetadata("inComparableRangeLiteral.kt") public void testInComparableRangeLiteral() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ranges/inComparableRangeLiteral.kt"); } + @Test @TestMetadata("inMixedUnsignedRange.kt") public void testInMixedUnsignedRange() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ranges/inMixedUnsignedRange.kt"); } + @Test @TestMetadata("inMixedUnsignedRange_2.kt") public void testInMixedUnsignedRange_2() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ranges/inMixedUnsignedRange_2.kt"); } + @Test @TestMetadata("inNonMatchingRangeIntrinsified.kt") public void testInNonMatchingRangeIntrinsified() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ranges/inNonMatchingRangeIntrinsified.kt"); } + @Test @TestMetadata("inOptimizableRange.kt") public void testInOptimizableRange() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ranges/inOptimizableRange.kt"); } + @Test @TestMetadata("inOptimizableUnsignedRange.kt") public void testInOptimizableUnsignedRange() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ranges/inOptimizableUnsignedRange.kt"); } + @Test @TestMetadata("inUntil.kt") public void testInUntil() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ranges/inUntil.kt"); } + @Test @TestMetadata("noDupXForLiteralRangeContains.kt") public void testNoDupXForLiteralRangeContains() throws Exception { runTest("compiler/testData/codegen/bytecodeText/ranges/noDupXForLiteralRangeContains.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/sam") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Sam extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class Sam extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInSam() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/sam"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("samWrapperForNullInitialization.kt") public void testSamWrapperForNullInitialization() throws Exception { runTest("compiler/testData/codegen/bytecodeText/sam/samWrapperForNullInitialization.kt"); } + @Test @TestMetadata("samWrapperForNullableInitialization.kt") public void testSamWrapperForNullableInitialization() throws Exception { runTest("compiler/testData/codegen/bytecodeText/sam/samWrapperForNullableInitialization.kt"); } + @Test @TestMetadata("samWrapperInInlineLambda.kt") public void testSamWrapperInInlineLambda() throws Exception { runTest("compiler/testData/codegen/bytecodeText/sam/samWrapperInInlineLambda.kt"); } + @Test @TestMetadata("samWrapperOfLambda.kt") public void testSamWrapperOfLambda() throws Exception { runTest("compiler/testData/codegen/bytecodeText/sam/samWrapperOfLambda.kt"); } + @Test @TestMetadata("samWrapperOfReference.kt") public void testSamWrapperOfReference() throws Exception { runTest("compiler/testData/codegen/bytecodeText/sam/samWrapperOfReference.kt"); } + @Test @TestMetadata("samWrapperRawTypes.kt") public void testSamWrapperRawTypes() throws Exception { runTest("compiler/testData/codegen/bytecodeText/sam/samWrapperRawTypes.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/statements") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Statements extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class Statements extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInStatements() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/statements"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("ifSingleBranch.kt") public void testIfSingleBranch() throws Exception { runTest("compiler/testData/codegen/bytecodeText/statements/ifSingleBranch.kt"); } + @Test @TestMetadata("ifThenElse.kt") public void testIfThenElse() throws Exception { runTest("compiler/testData/codegen/bytecodeText/statements/ifThenElse.kt"); } + @Test @TestMetadata("ifThenElseEmpty.kt") public void testIfThenElseEmpty() throws Exception { runTest("compiler/testData/codegen/bytecodeText/statements/ifThenElseEmpty.kt"); } + @Test @TestMetadata("labeled.kt") public void testLabeled() throws Exception { runTest("compiler/testData/codegen/bytecodeText/statements/labeled.kt"); } + @Test @TestMetadata("statementsComposition.kt") public void testStatementsComposition() throws Exception { runTest("compiler/testData/codegen/bytecodeText/statements/statementsComposition.kt"); } + @Test @TestMetadata("tryCatchFinally.kt") public void testTryCatchFinally() throws Exception { runTest("compiler/testData/codegen/bytecodeText/statements/tryCatchFinally.kt"); } + @Test @TestMetadata("when.kt") public void testWhen() throws Exception { runTest("compiler/testData/codegen/bytecodeText/statements/when.kt"); } + @Test @TestMetadata("whenSubject.kt") public void testWhenSubject() throws Exception { runTest("compiler/testData/codegen/bytecodeText/statements/whenSubject.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/staticFields") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class StaticFields extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class StaticFields extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInStaticFields() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/staticFields"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("classObject.kt") public void testClassObject() throws Exception { runTest("compiler/testData/codegen/bytecodeText/staticFields/classObject.kt"); } + @Test @TestMetadata("object.kt") public void testObject() throws Exception { runTest("compiler/testData/codegen/bytecodeText/staticFields/object.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/storeStackBeforeInline") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class StoreStackBeforeInline extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class StoreStackBeforeInline extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInStoreStackBeforeInline() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/storeStackBeforeInline"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("differentTypes.kt") public void testDifferentTypes() throws Exception { runTest("compiler/testData/codegen/bytecodeText/storeStackBeforeInline/differentTypes.kt"); } + @Test @TestMetadata("primitiveMerge.kt") public void testPrimitiveMerge() throws Exception { runTest("compiler/testData/codegen/bytecodeText/storeStackBeforeInline/primitiveMerge.kt"); } + @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { runTest("compiler/testData/codegen/bytecodeText/storeStackBeforeInline/simple.kt"); } + @Test @TestMetadata("unreachableMarker.kt") public void testUnreachableMarker() throws Exception { runTest("compiler/testData/codegen/bytecodeText/storeStackBeforeInline/unreachableMarker.kt"); } + @Test @TestMetadata("withLambda.kt") public void testWithLambda() throws Exception { runTest("compiler/testData/codegen/bytecodeText/storeStackBeforeInline/withLambda.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/stringOperations") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class StringOperations extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class StringOperations extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInStringOperations() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/stringOperations"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("concat.kt") public void testConcat() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/concat.kt"); } + @Test @TestMetadata("concatDynamic.kt") public void testConcatDynamic() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/concatDynamic.kt"); } + @Test @TestMetadata("concatDynamic200.kt") public void testConcatDynamic200() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/concatDynamic200.kt"); } + @Test @TestMetadata("concatDynamic201.kt") public void testConcatDynamic201() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/concatDynamic201.kt"); } + @Test @TestMetadata("concatDynamicConstants.kt") public void testConcatDynamicConstants() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/concatDynamicConstants.kt"); } + @Test @TestMetadata("concatDynamicDataClass.kt") public void testConcatDynamicDataClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/concatDynamicDataClass.kt"); } + @Test @TestMetadata("concatDynamicIndy.kt") public void testConcatDynamicIndy() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/concatDynamicIndy.kt"); } + @Test @TestMetadata("concatDynamicIndy201.kt") public void testConcatDynamicIndy201() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/concatDynamicIndy201.kt"); } + @Test @TestMetadata("concatDynamicIndyDataClass.kt") public void testConcatDynamicIndyDataClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/concatDynamicIndyDataClass.kt"); } + @Test @TestMetadata("concatNotDynamic.kt") public void testConcatNotDynamic() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/concatNotDynamic.kt"); } + @Test @TestMetadata("constConcat.kt") public void testConstConcat() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/constConcat.kt"); } + @Test @TestMetadata("constValConcat.kt") public void testConstValConcat() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/constValConcat.kt"); } + @Test @TestMetadata("doNotAppendEmptyString.kt") public void testDoNotAppendEmptyString() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/doNotAppendEmptyString.kt"); } + @Test @TestMetadata("interpolation.kt") public void testInterpolation() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/interpolation.kt"); } + @Test @TestMetadata("kt15235.kt") public void testKt15235() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/kt15235.kt"); } + @Test @TestMetadata("kt19037.kt") public void testKt19037() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/kt19037.kt"); } + @Test @TestMetadata("kt42457_old.kt") public void testKt42457_old() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/kt42457_old.kt"); } + @Test @TestMetadata("multipleNestedConcat.kt") public void testMultipleNestedConcat() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/multipleNestedConcat.kt"); } + @Test @TestMetadata("nestedConcat.kt") public void testNestedConcat() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/nestedConcat.kt"); } + @Test @TestMetadata("nonNullableStringPlus.kt") public void testNonNullableStringPlus() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/nonNullableStringPlus.kt"); } + @Test @TestMetadata("nullableStringPlus.kt") public void testNullableStringPlus() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/nullableStringPlus.kt"); } + @Test @TestMetadata("partiallyConstConcat.kt") public void testPartiallyConstConcat() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/partiallyConstConcat.kt"); } + @Test @TestMetadata("plusAssign.kt") public void testPlusAssign() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/plusAssign.kt"); } + @Test @TestMetadata("primitiveToString.kt") public void testPrimitiveToString() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/primitiveToString.kt"); } + @Test @TestMetadata("primitiveToStringNotOptimizable.kt") public void testPrimitiveToStringNotOptimizable() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/primitiveToStringNotOptimizable.kt"); } + @Test @TestMetadata("primitivesAsStringTemplates.kt") public void testPrimitivesAsStringTemplates() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/primitivesAsStringTemplates.kt"); } + @Test @TestMetadata("singleConcat.kt") public void testSingleConcat() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/singleConcat.kt"); } + @Test @TestMetadata("stringBuilderToString.kt") public void testStringBuilderToString() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/stringBuilderToString.kt"); } + @Test @TestMetadata("stringPlus.kt") public void testStringPlus() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/stringPlus.kt"); } + @Test @TestMetadata("useAppendCharForOneCharStringInTemplate.kt") public void testUseAppendCharForOneCharStringInTemplate() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/useAppendCharForOneCharStringInTemplate.kt"); } + @Test @TestMetadata("useAppendCharForOneCharStringInTemplate_2.kt") public void testUseAppendCharForOneCharStringInTemplate_2() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/useAppendCharForOneCharStringInTemplate_2.kt"); } + @Test @TestMetadata("useAppendCharForOneCharStringUsingPlus.kt") public void testUseAppendCharForOneCharStringUsingPlus() throws Exception { runTest("compiler/testData/codegen/bytecodeText/stringOperations/useAppendCharForOneCharStringUsingPlus.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/toArray") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ToArray extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class ToArray extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInToArray() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/toArray"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("noAccessorForToArray.kt") public void testNoAccessorForToArray() throws Exception { runTest("compiler/testData/codegen/bytecodeText/toArray/noAccessorForToArray.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/unsignedTypes") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class UnsignedTypes extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class UnsignedTypes extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInUnsignedTypes() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/unsignedTypes"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("unsignedIntCompare_before.kt") public void testUnsignedIntCompare_before() throws Exception { runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntCompare_before.kt"); } + @Test @TestMetadata("unsignedIntCompare_jvm18.kt") public void testUnsignedIntCompare_jvm18() throws Exception { runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntCompare_jvm18.kt"); } + @Test @TestMetadata("unsignedIntDivide_jvm18.kt") public void testUnsignedIntDivide_jvm18() throws Exception { runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntDivide_jvm18.kt"); } + @Test @TestMetadata("unsignedIntRemainder_jvm18.kt") public void testUnsignedIntRemainder_jvm18() throws Exception { runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntRemainder_jvm18.kt"); } + @Test @TestMetadata("unsignedIntSmartCasts_jvm18.kt") public void testUnsignedIntSmartCasts_jvm18() throws Exception { runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntSmartCasts_jvm18.kt"); } + @Test @TestMetadata("unsignedIntToString_jvm18.kt") public void testUnsignedIntToString_jvm18() throws Exception { runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedIntToString_jvm18.kt"); } + @Test @TestMetadata("unsignedLongCompare_jvm18.kt") public void testUnsignedLongCompare_jvm18() throws Exception { runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedLongCompare_jvm18.kt"); } + @Test @TestMetadata("unsignedLongDivide_jvm18.kt") public void testUnsignedLongDivide_jvm18() throws Exception { runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedLongDivide_jvm18.kt"); } + @Test @TestMetadata("unsignedLongRemainder_jvm18.kt") public void testUnsignedLongRemainder_jvm18() throws Exception { runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedLongRemainder_jvm18.kt"); } + @Test @TestMetadata("unsignedLongToString_jvm18.kt") public void testUnsignedLongToString_jvm18() throws Exception { runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/unsignedLongToString_jvm18.kt"); } + @Test @TestMetadata("whenByUnsigned.kt") public void testWhenByUnsigned() throws Exception { runTest("compiler/testData/codegen/bytecodeText/unsignedTypes/whenByUnsigned.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/varargs") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Varargs extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class Varargs extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInVarargs() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/varargs"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("doNotCopyImmediatelyCreatedArrays.kt") public void testDoNotCopyImmediatelyCreatedArrays() throws Exception { runTest("compiler/testData/codegen/bytecodeText/varargs/doNotCopyImmediatelyCreatedArrays.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/when") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class When extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class When extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInWhen() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/when"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("edgeCases.kt") public void testEdgeCases() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/edgeCases.kt"); } + @Test @TestMetadata("exhaustiveWhenInitialization.kt") public void testExhaustiveWhenInitialization() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/exhaustiveWhenInitialization.kt"); } + @Test @TestMetadata("exhaustiveWhenReturn.kt") public void testExhaustiveWhenReturn() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/exhaustiveWhenReturn.kt"); } + @Test @TestMetadata("exhaustiveWhenSpecialCases.kt") public void testExhaustiveWhenSpecialCases() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/exhaustiveWhenSpecialCases.kt"); } + @Test @TestMetadata("exhaustiveWhenUnit.kt") public void testExhaustiveWhenUnit() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/exhaustiveWhenUnit.kt"); } + @Test @TestMetadata("exhaustiveWhenUnitStatement.kt") public void testExhaustiveWhenUnitStatement() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/exhaustiveWhenUnitStatement.kt"); } + @Test @TestMetadata("inlineConstValsInsideWhen.kt") public void testInlineConstValsInsideWhen() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/inlineConstValsInsideWhen.kt"); } + @Test @TestMetadata("integralWhenWithNoInlinedConstants.kt") public void testIntegralWhenWithNoInlinedConstants() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/integralWhenWithNoInlinedConstants.kt"); } + @Test @TestMetadata("kt18818.kt") public void testKt18818() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/kt18818.kt"); } + @Test @TestMetadata("lookupSwitch.kt") public void testLookupSwitch() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/lookupSwitch.kt"); } + @Test @TestMetadata("lookupSwitchWithSubjectVal.kt") public void testLookupSwitchWithSubjectVal() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/lookupSwitchWithSubjectVal.kt"); } + @Test @TestMetadata("noBoxingInDefaultWhenWithSpecialCases.kt") public void testNoBoxingInDefaultWhenWithSpecialCases() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/noBoxingInDefaultWhenWithSpecialCases.kt"); } + @Test @TestMetadata("qualifiedConstValsInsideWhen.kt") public void testQualifiedConstValsInsideWhen() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/qualifiedConstValsInsideWhen.kt"); } + @Test @TestMetadata("sealedWhenInitialization.kt") public void testSealedWhenInitialization() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/sealedWhenInitialization.kt"); } + @Test @TestMetadata("simpleConstValsInsideWhen.kt") public void testSimpleConstValsInsideWhen() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/simpleConstValsInsideWhen.kt"); } + @Test @TestMetadata("stringSwitchWithSubjectVal.kt") public void testStringSwitchWithSubjectVal() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/stringSwitchWithSubjectVal.kt"); } + @Test @TestMetadata("subjectValHasLocalVariableSlot.kt") public void testSubjectValHasLocalVariableSlot() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/subjectValHasLocalVariableSlot.kt"); } + @Test @TestMetadata("subjectValInEnumWhenHasLocalVariableSlot.kt") public void testSubjectValInEnumWhenHasLocalVariableSlot() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/subjectValInEnumWhenHasLocalVariableSlot.kt"); } + @Test @TestMetadata("subjectValInIntWhenHasLocalVariableSlot.kt") public void testSubjectValInIntWhenHasLocalVariableSlot() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/subjectValInIntWhenHasLocalVariableSlot.kt"); } + @Test @TestMetadata("subjectValInStringWhenHasLocalVariableSlot.kt") public void testSubjectValInStringWhenHasLocalVariableSlot() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/subjectValInStringWhenHasLocalVariableSlot.kt"); } + @Test @TestMetadata("switchOptimizationDuplicates.kt") public void testSwitchOptimizationDuplicates() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/switchOptimizationDuplicates.kt"); } + @Test @TestMetadata("tableSwitch.kt") public void testTableSwitch() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/tableSwitch.kt"); } + @Test @TestMetadata("tableSwitchWithSubjectVal.kt") public void testTableSwitchWithSubjectVal() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/tableSwitchWithSubjectVal.kt"); } + @Test @TestMetadata("whenNull.kt") public void testWhenNull() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/whenNull.kt"); } + @Test @TestMetadata("whenZero.kt") public void testWhenZero() throws Exception { runTest("compiler/testData/codegen/bytecodeText/when/whenZero.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/whenEnumOptimization") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class WhenEnumOptimization extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class WhenEnumOptimization extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInWhenEnumOptimization() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/whenEnumOptimization"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("bigEnum.kt") public void testBigEnum() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/bigEnum.kt"); } + @Test @TestMetadata("differentEnumClasses.kt") public void testDifferentEnumClasses() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/differentEnumClasses.kt"); } + @Test @TestMetadata("differentEnumClasses2.kt") public void testDifferentEnumClasses2() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/differentEnumClasses2.kt"); } + @Test @TestMetadata("duplicatingItems.kt") public void testDuplicatingItems() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/duplicatingItems.kt"); } + @Test @TestMetadata("expression.kt") public void testExpression() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/expression.kt"); } + @Test @TestMetadata("functionLiteralInTopLevel.kt") public void testFunctionLiteralInTopLevel() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/functionLiteralInTopLevel.kt"); } + @Test @TestMetadata("importedEnumEntry.kt") public void testImportedEnumEntry() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/importedEnumEntry.kt"); } + @Test @TestMetadata("kt14597_full.kt") public void testKt14597_full() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/kt14597_full.kt"); } + @Test @TestMetadata("kt14802.kt") public void testKt14802() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/kt14802.kt"); } + @Test @TestMetadata("manyWhensWithinClass.kt") public void testManyWhensWithinClass() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/manyWhensWithinClass.kt"); } + @Test @TestMetadata("nonConstantEnum.kt") public void testNonConstantEnum() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/nonConstantEnum.kt"); } + @Test @TestMetadata("nullability.kt") public void testNullability() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/nullability.kt"); } + @Test @TestMetadata("subjectAny.kt") public void testSubjectAny() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/subjectAny.kt"); } + @Test @TestMetadata("withoutElse.kt") public void testWithoutElse() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenEnumOptimization/withoutElse.kt"); } } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/whenStringOptimization") @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class WhenStringOptimization extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - + public class WhenStringOptimization extends AbstractIrBytecodeTextTest { + @Test public void testAllFilesPresentInWhenStringOptimization() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/whenStringOptimization"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test @TestMetadata("denseHashCode.kt") public void testDenseHashCode() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenStringOptimization/denseHashCode.kt"); } + @Test @TestMetadata("duplicatingItems.kt") public void testDuplicatingItems() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenStringOptimization/duplicatingItems.kt"); } + @Test @TestMetadata("duplicatingItemsSameHashCodeFewBranches.kt") public void testDuplicatingItemsSameHashCodeFewBranches() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenStringOptimization/duplicatingItemsSameHashCodeFewBranches.kt"); } + @Test @TestMetadata("duplicatingItemsSameHashCodeMoreBranches.kt") public void testDuplicatingItemsSameHashCodeMoreBranches() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenStringOptimization/duplicatingItemsSameHashCodeMoreBranches.kt"); } + @Test @TestMetadata("expression.kt") public void testExpression() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenStringOptimization/expression.kt"); } + @Test @TestMetadata("inlineStringConstInsideWhen.kt") public void testInlineStringConstInsideWhen() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenStringOptimization/inlineStringConstInsideWhen.kt"); } + @Test @TestMetadata("nonInlinedConst.kt") public void testNonInlinedConst() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenStringOptimization/nonInlinedConst.kt"); } + @Test @TestMetadata("nullability.kt") public void testNullability() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenStringOptimization/nullability.kt"); } + @Test @TestMetadata("sameHashCode.kt") public void testSameHashCode() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenStringOptimization/sameHashCode.kt"); } + @Test @TestMetadata("statement.kt") public void testStatement() throws Exception { runTest("compiler/testData/codegen/bytecodeText/whenStringOptimization/statement.kt"); diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/BytecodeTextHandler.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/BytecodeTextHandler.kt new file mode 100644 index 00000000000..99e48999447 --- /dev/null +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/BytecodeTextHandler.kt @@ -0,0 +1,63 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.test.backend.handlers + +import org.jetbrains.kotlin.codegen.* +import org.jetbrains.kotlin.test.TargetBackend +import org.jetbrains.kotlin.test.directives.CodegenTestDirectives +import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.TREAT_AS_ONE_FILE +import org.jetbrains.kotlin.test.directives.model.DirectivesContainer +import org.jetbrains.kotlin.test.model.BinaryArtifacts +import org.jetbrains.kotlin.test.model.TestFile +import org.jetbrains.kotlin.test.model.TestModule +import org.jetbrains.kotlin.test.services.TestServices +import org.jetbrains.kotlin.test.services.isKtFile +import java.util.LinkedHashMap + +class BytecodeTextHandler(testServices: TestServices) : JvmBinaryArtifactHandler(testServices) { + companion object { + private const val IGNORED_PREFIX = "helpers/" + } + + override val directivesContainers: List + get() = listOf(CodegenTestDirectives) + + override fun processModule(module: TestModule, info: BinaryArtifacts.Jvm) { + val targetBackend = module.targetBackend!! + val isIgnored = targetBackend in module.directives[CodegenTestDirectives.IGNORE_BACKEND] + val files = module.files.filter { it.isKtFile } + if (files.size > 1 && TREAT_AS_ONE_FILE !in module.directives) { + processMultiFileTest(files, info, targetBackend, !isIgnored) + } else { + val file = files.first { !it.isAdditional } + val expected = readExpectedOccurrences(file.originalContent.split("\n")) + val actual = info.classFileFactory.createText(IGNORED_PREFIX) + checkGeneratedTextAgainstExpectedOccurrences(actual, expected, targetBackend, !isIgnored, assertions) + } + } + + private fun processMultiFileTest( + files: List, + info: BinaryArtifacts.Jvm, + targetBackend: TargetBackend, + reportProblems: Boolean + ) { + val expectedOccurrencesByOutputFile = LinkedHashMap>() + for (file in files) { + readExpectedOccurrencesForMultiFileTest(file.name, file.originalContent, expectedOccurrencesByOutputFile) + } + + val generated = info.classFileFactory.createTextForEachFile() + for (expectedOutputFile in expectedOccurrencesByOutputFile.keys) { + assertTextWasGenerated(expectedOutputFile, generated, assertions) + val generatedText = generated[expectedOutputFile]!! + val expectedOccurrences = expectedOccurrencesByOutputFile[expectedOutputFile]!! + checkGeneratedTextAgainstExpectedOccurrences(generatedText, expectedOccurrences, targetBackend, reportProblems, assertions) + } + } + + override fun processAfterAllModules(someAssertionWasFailed: Boolean) {} +} diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/CodegenTestDirectives.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/CodegenTestDirectives.kt index 0cacf9dcfee..dbb639e7e88 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/CodegenTestDirectives.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/CodegenTestDirectives.kt @@ -6,6 +6,7 @@ package org.jetbrains.kotlin.test.directives import org.jetbrains.kotlin.test.TargetBackend +import org.jetbrains.kotlin.test.backend.handlers.BytecodeTextHandler import org.jetbrains.kotlin.test.backend.handlers.IrPrettyKotlinDumpHandler import org.jetbrains.kotlin.test.backend.handlers.IrTextDumpHandler import org.jetbrains.kotlin.test.backend.handlers.NoCompilationErrorsHandler @@ -85,4 +86,8 @@ object CodegenTestDirectives : SimpleDirectivesContainer() { val SKIP_KT_DUMP by directive( description = "Skips check pretty kt IR dump (disables ${IrPrettyKotlinDumpHandler::class})" ) + + val TREAT_AS_ONE_FILE by directive( + description = "Treat bytecode from all files as one in ${BytecodeTextHandler::class}" + ) } diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/codegen/AbstractBytecodeTextTest.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/codegen/AbstractBytecodeTextTest.kt new file mode 100644 index 00000000000..291492e8a82 --- /dev/null +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/codegen/AbstractBytecodeTextTest.kt @@ -0,0 +1,101 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.test.runners.codegen + +import org.jetbrains.kotlin.test.Constructor +import org.jetbrains.kotlin.test.TargetBackend +import org.jetbrains.kotlin.test.backend.BlackBoxCodegenSuppressor +import org.jetbrains.kotlin.test.backend.classic.ClassicJvmBackendFacade +import org.jetbrains.kotlin.test.backend.handlers.BytecodeTextHandler +import org.jetbrains.kotlin.test.backend.ir.JvmIrBackendFacade +import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder +import org.jetbrains.kotlin.test.directives.JvmEnvironmentConfigurationDirectives +import org.jetbrains.kotlin.test.directives.JvmEnvironmentConfigurationDirectives.USE_PSI_CLASS_FILES_READING +import org.jetbrains.kotlin.test.directives.JvmEnvironmentConfigurationDirectives.WITH_REFLECT +import org.jetbrains.kotlin.test.directives.JvmEnvironmentConfigurationDirectives.WITH_STDLIB +import org.jetbrains.kotlin.test.frontend.classic.ClassicFrontend2ClassicBackendConverter +import org.jetbrains.kotlin.test.frontend.classic.ClassicFrontend2IrConverter +import org.jetbrains.kotlin.test.frontend.classic.ClassicFrontendFacade +import org.jetbrains.kotlin.test.frontend.classic.ClassicFrontendOutputArtifact +import org.jetbrains.kotlin.test.frontend.fir.Fir2IrResultsConverter +import org.jetbrains.kotlin.test.frontend.fir.FirFrontendFacade +import org.jetbrains.kotlin.test.frontend.fir.FirOutputArtifact +import org.jetbrains.kotlin.test.model.* +import org.jetbrains.kotlin.test.runners.AbstractKotlinCompilerWithTargetBackendTest + +abstract class AbstractBytecodeTextTestBase>( + targetBackend: TargetBackend, + val targetFrontend: FrontendKind<*> +) : AbstractKotlinCompilerWithTargetBackendTest(targetBackend) { + abstract val frontendFacade: Constructor> + abstract val frontendToBackendConverter: Constructor> + abstract val backendFacade: Constructor> + + override fun TestConfigurationBuilder.configuration() { + commonConfigurationForCodegenTest(targetFrontend, frontendFacade, frontendToBackendConverter, backendFacade) + + defaultDirectives { + +WITH_STDLIB + +WITH_REFLECT + } + + useArtifactsHandlers(::BytecodeTextHandler) + + useAfterAnalysisCheckers(::BlackBoxCodegenSuppressor) + } +} + +open class AbstractBytecodeTextTest : AbstractBytecodeTextTestBase( + targetBackend = TargetBackend.JVM, + targetFrontend = FrontendKinds.ClassicFrontend +) { + override val frontendFacade: Constructor> + get() = ::ClassicFrontendFacade + + override val frontendToBackendConverter: Constructor> + get() = ::ClassicFrontend2ClassicBackendConverter + + override val backendFacade: Constructor> + get() = ::ClassicJvmBackendFacade +} + +open class AbstractIrBytecodeTextTest : AbstractBytecodeTextTestBase( + targetBackend = TargetBackend.JVM_IR, + targetFrontend = FrontendKinds.ClassicFrontend +) { + override val frontendFacade: Constructor> + get() = ::ClassicFrontendFacade + + override val frontendToBackendConverter: Constructor> + get() = ::ClassicFrontend2IrConverter + + override val backendFacade: Constructor> + get() = ::JvmIrBackendFacade +} + +open class AbstractFirBytecodeTextTest : AbstractBytecodeTextTestBase( + targetBackend = TargetBackend.JVM_IR, + targetFrontend = FrontendKinds.FIR +) { + override val frontendFacade: Constructor> + get() = ::FirFrontendFacade + + override val frontendToBackendConverter: Constructor> + get() = ::Fir2IrResultsConverter + + override val backendFacade: Constructor> + get() = ::JvmIrBackendFacade + + override fun configure(builder: TestConfigurationBuilder) { + super.configure(builder) + with(builder) { + defaultDirectives { + // See KT-44152 + -USE_PSI_CLASS_FILES_READING + } + } + } +} diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/codegen/AbstractJvmBlackBoxCodegenTestBase.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/codegen/AbstractJvmBlackBoxCodegenTestBase.kt index 8f66f2aad3d..a15425fbfbe 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/codegen/AbstractJvmBlackBoxCodegenTestBase.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/codegen/AbstractJvmBlackBoxCodegenTestBase.kt @@ -5,21 +5,13 @@ package org.jetbrains.kotlin.test.runners.codegen -import org.jetbrains.kotlin.platform.jvm.JvmPlatforms import org.jetbrains.kotlin.test.Constructor import org.jetbrains.kotlin.test.TargetBackend import org.jetbrains.kotlin.test.backend.BlackBoxCodegenSuppressor import org.jetbrains.kotlin.test.backend.handlers.* import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder -import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.RUN_DEX_CHECKER -import org.jetbrains.kotlin.test.directives.JvmEnvironmentConfigurationDirectives.USE_PSI_CLASS_FILES_READING import org.jetbrains.kotlin.test.model.* import org.jetbrains.kotlin.test.runners.AbstractKotlinCompilerWithTargetBackendTest -import org.jetbrains.kotlin.test.services.configuration.CommonEnvironmentConfigurator -import org.jetbrains.kotlin.test.services.configuration.JvmEnvironmentConfigurator -import org.jetbrains.kotlin.test.services.sourceProviders.AdditionalDiagnosticsSourceFilesProvider -import org.jetbrains.kotlin.test.services.sourceProviders.CodegenHelpersSourceFilesProvider -import org.jetbrains.kotlin.test.services.sourceProviders.CoroutineHelpersSourceFilesProvider abstract class AbstractJvmBlackBoxCodegenTestBase>( val targetFrontend: FrontendKind, @@ -30,31 +22,7 @@ abstract class AbstractJvmBlackBoxCodegenTestBase> override fun TestConfigurationBuilder.configuration() { - globalDefaults { - frontend = targetFrontend - targetPlatform = JvmPlatforms.defaultJvmPlatform - dependencyKind = DependencyKind.Binary - } - - defaultDirectives { - +USE_PSI_CLASS_FILES_READING - +RUN_DEX_CHECKER - } - - useConfigurators( - ::CommonEnvironmentConfigurator, - ::JvmEnvironmentConfigurator - ) - - useAdditionalSourceProviders( - ::AdditionalDiagnosticsSourceFilesProvider, - ::CoroutineHelpersSourceFilesProvider, - ::CodegenHelpersSourceFilesProvider, - ) - - useFrontendFacades(frontendFacade) - useFrontend2BackendConverters(frontendToBackendConverter) - useBackendFacades(backendFacade) + commonConfigurationForCodegenTest(targetFrontend, frontendFacade, frontendToBackendConverter, backendFacade) useFrontendHandlers( ::NoCompilationErrorsHandler, diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/codegen/BaseCodegenConfiguration.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/codegen/BaseCodegenConfiguration.kt new file mode 100644 index 00000000000..1a62f6f016c --- /dev/null +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/codegen/BaseCodegenConfiguration.kt @@ -0,0 +1,51 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.test.runners.codegen + +import org.jetbrains.kotlin.platform.jvm.JvmPlatforms +import org.jetbrains.kotlin.test.Constructor +import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder +import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.RUN_DEX_CHECKER +import org.jetbrains.kotlin.test.directives.JvmEnvironmentConfigurationDirectives.USE_PSI_CLASS_FILES_READING +import org.jetbrains.kotlin.test.model.* +import org.jetbrains.kotlin.test.services.configuration.CommonEnvironmentConfigurator +import org.jetbrains.kotlin.test.services.configuration.JvmEnvironmentConfigurator +import org.jetbrains.kotlin.test.services.sourceProviders.AdditionalDiagnosticsSourceFilesProvider +import org.jetbrains.kotlin.test.services.sourceProviders.CodegenHelpersSourceFilesProvider +import org.jetbrains.kotlin.test.services.sourceProviders.CoroutineHelpersSourceFilesProvider + +fun > TestConfigurationBuilder.commonConfigurationForCodegenTest( + targetFrontend: FrontendKind<*>, + frontendFacade: Constructor>, + frontendToBackendConverter: Constructor>, + backendFacade: Constructor> +) { + globalDefaults { + frontend = targetFrontend + targetPlatform = JvmPlatforms.defaultJvmPlatform + dependencyKind = DependencyKind.Binary + } + + defaultDirectives { + +USE_PSI_CLASS_FILES_READING + +RUN_DEX_CHECKER + } + + useConfigurators( + ::CommonEnvironmentConfigurator, + ::JvmEnvironmentConfigurator + ) + + useAdditionalSourceProviders( + ::AdditionalDiagnosticsSourceFilesProvider, + ::CoroutineHelpersSourceFilesProvider, + ::CodegenHelpersSourceFilesProvider, + ) + + useFrontendFacades(frontendFacade) + useFrontend2BackendConverters(frontendToBackendConverter) + useBackendFacades(backendFacade) +} diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractBytecodeTextTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractBytecodeTextTest.kt index e7901f937b1..0fe5fa5dcca 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractBytecodeTextTest.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractBytecodeTextTest.kt @@ -5,16 +5,14 @@ package org.jetbrains.kotlin.codegen -import com.intellij.openapi.util.text.StringUtil +import org.jetbrains.kotlin.ObsoleteTestInfrastructure import org.jetbrains.kotlin.test.ConfigurationKind import org.jetbrains.kotlin.test.InTextDirectivesUtils -import org.jetbrains.kotlin.test.TargetBackend -import org.junit.Assert +import org.jetbrains.kotlin.test.util.JUnit4Assertions import java.io.File import java.util.* -import java.util.regex.Matcher -import java.util.regex.Pattern +@ObsoleteTestInfrastructure abstract class AbstractBytecodeTextTest : CodegenTestCase() { override fun doMultiFileTest(wholeFile: File, files: List) { val isIgnored = InTextDirectivesUtils.isIgnoredTarget(backend, wholeFile) @@ -31,57 +29,26 @@ abstract class AbstractBytecodeTextTest : CodegenTestCase() { } else { val expected = readExpectedOccurrences(wholeFile.path) val actual = generateToText("helpers/") - checkGeneratedTextAgainstExpectedOccurrences(actual, expected, backend, !isIgnored) + checkGeneratedTextAgainstExpectedOccurrences(actual, expected, backend, !isIgnored, JUnit4Assertions) } } private fun doTestMultiFile(files: List, reportProblems: Boolean) { val expectedOccurrencesByOutputFile = LinkedHashMap>() for (file in files) { - readExpectedOccurrencesForMultiFileTest(file, expectedOccurrencesByOutputFile) + readExpectedOccurrencesForMultiFileTest(file.name, file.content, expectedOccurrencesByOutputFile) } val generated = generateEachFileToText() for (expectedOutputFile in expectedOccurrencesByOutputFile.keys) { - assertTextWasGenerated(expectedOutputFile, generated) + assertTextWasGenerated(expectedOutputFile, generated, JUnit4Assertions) val generatedText = generated[expectedOutputFile]!! val expectedOccurrences = expectedOccurrencesByOutputFile[expectedOutputFile]!! - checkGeneratedTextAgainstExpectedOccurrences(generatedText, expectedOccurrences, backend, reportProblems) - } - } - - protected fun readExpectedOccurrences(filename: String): List { - val result = ArrayList() - val lines = File(filename).readLines().dropLastWhile(String::isEmpty) - var backend = TargetBackend.ANY - for (line in lines) { - if (line.contains(JVM_TEMPLATES)) backend = TargetBackend.JVM - else if (line.contains(JVM_IR_TEMPLATES)) backend = TargetBackend.JVM_IR - - val matcher = EXPECTED_OCCURRENCES_PATTERN.matcher(line) - if (matcher.matches()) { - result.add(parseOccurrenceInfo(matcher, backend)) - } - } - - return result - } - - class OccurrenceInfo constructor(private val numberOfOccurrences: Int, private val needle: String, val backend: TargetBackend) { - fun getActualOccurrence(text: String): String? { - val actualCount = StringUtil.findMatches(text, Pattern.compile("($needle)")).size - return "$actualCount $needle" - } - - override fun toString(): String { - return "$numberOfOccurrences $needle" + checkGeneratedTextAgainstExpectedOccurrences(generatedText, expectedOccurrences, backend, reportProblems, JUnit4Assertions) } } companion object { - private val AT_OUTPUT_FILE_PATTERN = Pattern.compile("^\\s*//\\s*@(.*):$") - private val EXPECTED_OCCURRENCES_PATTERN = Pattern.compile("^\\s*//\\s*(\\d+)\\s*(.*)$") - private fun isMultiFileTest(files: List): Boolean { var kotlinFiles = 0 for (file in files) { @@ -91,95 +58,5 @@ abstract class AbstractBytecodeTextTest : CodegenTestCase() { } return kotlinFiles > 1 } - - fun checkGeneratedTextAgainstExpectedOccurrences( - text: String, - expectedOccurrences: List, - currentBackend: TargetBackend, - reportProblems: Boolean - ) { - val expected = StringBuilder() - val actual = StringBuilder() - var lastBackend = TargetBackend.ANY - for (info in expectedOccurrences) { - if (lastBackend != info.backend) { - when (info.backend) { - TargetBackend.JVM -> JVM_TEMPLATES - TargetBackend.JVM_IR -> JVM_IR_TEMPLATES - else -> error("Common part should be first one: ${expectedOccurrences.joinToString("\n")}") - }.also { - actual.append("\n$it\n") - expected.append("\n$it\n") - } - lastBackend = info.backend - } - - expected.append(info).append("\n") - if (info.backend == TargetBackend.ANY || info.backend == currentBackend) { - actual.append(info.getActualOccurrence(text)).append("\n") - } else { - actual.append(info).append("\n") - } - } - - try { - Assert.assertEquals(text, expected.toString(), actual.toString()) - } catch (e: Throwable) { - if (reportProblems) { - println(text) - } - throw e - } - - } - - private fun assertTextWasGenerated(expectedOutputFile: String, generated: Map) { - if (!generated.containsKey(expectedOutputFile)) { - val failMessage = StringBuilder() - failMessage.append("Missing output file ").append(expectedOutputFile).append(", got ").append(generated.size).append(": ") - for (generatedFile in generated.keys) { - failMessage.append(generatedFile).append(" ") - } - Assert.fail(failMessage.toString()) - } - } - - private const val JVM_TEMPLATES = "// JVM_TEMPLATES" - - private const val JVM_IR_TEMPLATES = "// JVM_IR_TEMPLATES" - - private fun readExpectedOccurrencesForMultiFileTest(file: TestFile, occurrenceMap: MutableMap>) { - var currentOccurrenceInfos: MutableList? = null - var backend = TargetBackend.ANY - for (line in file.content.split("\n".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()) { - if (line.contains(JVM_TEMPLATES)) backend = TargetBackend.JVM - else if (line.contains(JVM_IR_TEMPLATES)) backend = TargetBackend.JVM_IR - - val atOutputFileMatcher = AT_OUTPUT_FILE_PATTERN.matcher(line) - if (atOutputFileMatcher.matches()) { - val outputFileName = atOutputFileMatcher.group(1) - if (occurrenceMap.containsKey(outputFileName)) { - throw AssertionError("${file.name}: Expected occurrences for output file $outputFileName were already provided") - } - currentOccurrenceInfos = ArrayList() - occurrenceMap[outputFileName] = currentOccurrenceInfos - } - - val expectedOccurrencesMatcher = EXPECTED_OCCURRENCES_PATTERN.matcher(line) - if (expectedOccurrencesMatcher.matches()) { - if (currentOccurrenceInfos == null) { - throw AssertionError("${file.name}: Should specify output file with '// @:' before expectations") - } - val occurrenceInfo = parseOccurrenceInfo(expectedOccurrencesMatcher, backend) - currentOccurrenceInfos.add(occurrenceInfo) - } - } - } - - private fun parseOccurrenceInfo(matcher: Matcher, backend: TargetBackend): OccurrenceInfo { - val numberOfOccurrences = Integer.parseInt(matcher.group(1)) - val needle = matcher.group(2) - return OccurrenceInfo(numberOfOccurrences, needle, backend) - } } } diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractTopLevelMembersInvocationTest.java b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractTopLevelMembersInvocationTest.java index e62336dfb78..c8a0fae9054 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractTopLevelMembersInvocationTest.java +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractTopLevelMembersInvocationTest.java @@ -24,12 +24,16 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.kotlin.cli.jvm.compiler.EnvironmentConfigFiles; import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment; import org.jetbrains.kotlin.test.*; +import org.jetbrains.kotlin.test.util.JUnit4Assertions; import org.jetbrains.kotlin.test.util.KtTestUtil; import java.io.File; import java.util.Collections; import java.util.List; +import static org.jetbrains.kotlin.codegen.BytecodeTextUtilsKt.checkGeneratedTextAgainstExpectedOccurrences; +import static org.jetbrains.kotlin.codegen.BytecodeTextUtilsKt.readExpectedOccurrences; + public abstract class AbstractTopLevelMembersInvocationTest extends AbstractBytecodeTextTest { @Override public void doTest(@NotNull String filename) throws Exception { @@ -60,6 +64,6 @@ public abstract class AbstractTopLevelMembersInvocationTest extends AbstractByte List expected = readExpectedOccurrences(KtTestUtil.getTestDataPathBase() + "/codegen/" + sourceFiles.get(0)); String actual = generateToText(); - Companion.checkGeneratedTextAgainstExpectedOccurrences(actual, expected, TargetBackend.ANY, true); + checkGeneratedTextAgainstExpectedOccurrences(actual, expected, TargetBackend.ANY, true, JUnit4Assertions.INSTANCE); } } diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/ir/AbstractComposeLikeIrBytecodeTextTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/ir/AbstractComposeLikeIrBytecodeTextTest.kt index c63f8f6ee85..64f4aa5ca2b 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/ir/AbstractComposeLikeIrBytecodeTextTest.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/ir/AbstractComposeLikeIrBytecodeTextTest.kt @@ -5,10 +5,12 @@ package org.jetbrains.kotlin.codegen.ir +import org.jetbrains.kotlin.ObsoleteTestInfrastructure import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment import org.jetbrains.kotlin.codegen.AbstractBytecodeTextTest import org.jetbrains.kotlin.test.TargetBackend +@OptIn(ObsoleteTestInfrastructure::class) abstract class AbstractComposeLikeIrBytecodeTextTest : AbstractBytecodeTextTest() { override val backend = TargetBackend.JVM_IR diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/ir/AbstractFirBytecodeTextTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/ir/AbstractFirBytecodeTextTest.kt deleted file mode 100644 index 024be2c2b94..00000000000 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/ir/AbstractFirBytecodeTextTest.kt +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package org.jetbrains.kotlin.codegen.ir - -import org.jetbrains.kotlin.config.CommonConfigurationKeys -import org.jetbrains.kotlin.config.CompilerConfiguration -import org.jetbrains.kotlin.config.JVMConfigurationKeys - -abstract class AbstractFirBytecodeTextTest : AbstractIrBytecodeTextTest() { - override fun updateConfiguration(configuration: CompilerConfiguration) { - super.updateConfiguration(configuration) - configuration.put(CommonConfigurationKeys.USE_FIR, true) - configuration.put(JVMConfigurationKeys.IR, true) - } -} diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/ir/AbstractIrBytecodeTextTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/ir/AbstractIrBytecodeTextTest.kt deleted file mode 100644 index b90e521193c..00000000000 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/ir/AbstractIrBytecodeTextTest.kt +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package org.jetbrains.kotlin.codegen.ir - -import org.jetbrains.kotlin.codegen.AbstractBytecodeTextTest -import org.jetbrains.kotlin.test.TargetBackend - -abstract class AbstractIrBytecodeTextTest : AbstractBytecodeTextTest() { - override val backend = TargetBackend.JVM_IR -} diff --git a/compiler/tests-compiler-utils/tests/org/jetbrains/kotlin/test/JvmCompilationUtils.kt b/compiler/tests-compiler-utils/tests/org/jetbrains/kotlin/test/JvmCompilationUtils.kt index 099e1460c83..fbd55b95280 100644 --- a/compiler/tests-compiler-utils/tests/org/jetbrains/kotlin/test/JvmCompilationUtils.kt +++ b/compiler/tests-compiler-utils/tests/org/jetbrains/kotlin/test/JvmCompilationUtils.kt @@ -32,14 +32,19 @@ fun compileJavaFiles( val diagnosticCollector = DiagnosticCollector() javaCompiler.getStandardFileManager(diagnosticCollector, Locale.ENGLISH, Charset.forName("utf-8")).use { fileManager -> val javaFileObjectsFromFiles = fileManager.getJavaFileObjectsFromFiles(files) - val task = javaCompiler.getTask( - StringWriter(), // do not write to System.err - fileManager, - diagnosticCollector, - options, - null, - javaFileObjectsFromFiles - ) + val task = try { + javaCompiler.getTask( + StringWriter(), // do not write to System.err + fileManager, + diagnosticCollector, + options, + null, + javaFileObjectsFromFiles + ) + } catch (e: Throwable) { + if (ignoreJavaErrors) return false + else throw e + } val success = task.call() // do NOT inline this variable, call() should complete before errorsToString() if (javaErrorFile == null || !javaErrorFile.exists()) { assertions.assertTrue(success || ignoreJavaErrors) { errorsToString(diagnosticCollector, true) } diff --git a/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit3CompilerTests.kt b/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit3CompilerTests.kt index 762bc10c62f..dffe91dede0 100644 --- a/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit3CompilerTests.kt +++ b/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit3CompilerTests.kt @@ -140,10 +140,6 @@ fun generateJUnit3CompilerTests(args: Array) { model("codegen/customScript", pattern = "^(.*)$") } - testClass { - model("codegen/bytecodeText", targetBackend = TargetBackend.JVM) - } - testClass { model("ir/irJsText", pattern = "^(.+)\\.kt(s)?\$") } @@ -484,10 +480,6 @@ fun generateJUnit3CompilerTests(args: Array) { model("codegen/boxInline", targetBackend = TargetBackend.JVM_IR) } - testClass { - model("codegen/bytecodeText", targetBackend = TargetBackend.JVM_IR, excludeDirs = listOf("oldLanguageVersions")) - } - testClass { model("codegen/asmLike", targetBackend = TargetBackend.JVM_IR) } @@ -510,10 +502,6 @@ fun generateJUnit3CompilerTests(args: Array) { model("codegen/boxAgainstJava", targetBackend = TargetBackend.JVM_IR, excludeDirs = listOf("oldLanguageVersions")) } - testClass { - model("codegen/bytecodeText", targetBackend = TargetBackend.JVM_IR, excludeDirs = listOf("oldLanguageVersions")) - } - testClass { model("compileKotlinAgainstKotlin", targetBackend = TargetBackend.JVM_IR) } diff --git a/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit5CompilerTests.kt b/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit5CompilerTests.kt index 41409bd3563..c2d4c24b273 100644 --- a/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit5CompilerTests.kt +++ b/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit5CompilerTests.kt @@ -9,9 +9,7 @@ import org.jetbrains.kotlin.generators.model.annotation import org.jetbrains.kotlin.generators.util.TestGeneratorUtil import org.jetbrains.kotlin.test.TargetBackend import org.jetbrains.kotlin.test.runners.* -import org.jetbrains.kotlin.test.runners.codegen.AbstractBlackBoxCodegenTest -import org.jetbrains.kotlin.test.runners.codegen.AbstractFirBlackBoxCodegenTest -import org.jetbrains.kotlin.test.runners.codegen.AbstractIrBlackBoxCodegenTest +import org.jetbrains.kotlin.test.runners.codegen.* import org.jetbrains.kotlin.test.runners.ir.AbstractFir2IrTextTest import org.jetbrains.kotlin.test.runners.ir.AbstractIrTextTest import org.junit.jupiter.api.parallel.Execution @@ -73,6 +71,14 @@ fun generateJUnit5CompilerTests(args: Array) { testClass { model("ir/irText") } + + testClass { + model("codegen/bytecodeText") + } + + testClass { + model("codegen/bytecodeText", excludeDirs = listOf("oldLanguageVersions")) + } } // ---------------------------------------------- FIR tests ---------------------------------------------- @@ -105,6 +111,10 @@ fun generateJUnit5CompilerTests(args: Array) { testClass { model("ir/irText") } + + testClass { + model("codegen/bytecodeText", excludeDirs = listOf("oldLanguageVersions")) + } } } } diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/CustomBytecodeTextTest.kt b/compiler/tests/org/jetbrains/kotlin/codegen/CustomBytecodeTextTest.kt index 9009bd902fd..652f7b4a37f 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/CustomBytecodeTextTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/codegen/CustomBytecodeTextTest.kt @@ -16,9 +16,11 @@ package org.jetbrains.kotlin.codegen +import org.jetbrains.kotlin.ObsoleteTestInfrastructure import org.jetbrains.kotlin.test.ConfigurationKind import org.jetbrains.kotlin.test.testFramework.KtUsefulTestCase +@OptIn(ObsoleteTestInfrastructure::class) class CustomBytecodeTextTest : AbstractBytecodeTextTest() { fun testEnumMapping() { createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.ALL) diff --git a/plugins/android-extensions/android-extensions-compiler/test/org/jetbrains/kotlin/android/synthetic/test/AbstractAndroidBytecodeShapeTest.kt b/plugins/android-extensions/android-extensions-compiler/test/org/jetbrains/kotlin/android/synthetic/test/AbstractAndroidBytecodeShapeTest.kt index cb55b9fea70..9178e7d6d97 100755 --- a/plugins/android-extensions/android-extensions-compiler/test/org/jetbrains/kotlin/android/synthetic/test/AbstractAndroidBytecodeShapeTest.kt +++ b/plugins/android-extensions/android-extensions-compiler/test/org/jetbrains/kotlin/android/synthetic/test/AbstractAndroidBytecodeShapeTest.kt @@ -16,13 +16,18 @@ package org.jetbrains.kotlin.android.synthetic.test +import org.jetbrains.kotlin.ObsoleteTestInfrastructure import org.jetbrains.kotlin.codegen.AbstractBytecodeTextTest +import org.jetbrains.kotlin.codegen.checkGeneratedTextAgainstExpectedOccurrences +import org.jetbrains.kotlin.codegen.readExpectedOccurrences import org.jetbrains.kotlin.config.CompilerConfiguration import org.jetbrains.kotlin.test.ConfigurationKind import org.jetbrains.kotlin.test.KotlinTestUtils import org.jetbrains.kotlin.test.TargetBackend import org.jetbrains.kotlin.test.TestJdkKind +import org.jetbrains.kotlin.test.util.JUnit4Assertions +@OptIn(ObsoleteTestInfrastructure::class) abstract class AbstractAndroidBytecodeShapeTest : AbstractBytecodeTextTest() { private fun createAndroidAPIEnvironment(path: String) { return createEnvironmentForConfiguration(KotlinTestUtils.newConfiguration(ConfigurationKind.ALL, TestJdkKind.ANDROID_API), path) @@ -40,6 +45,6 @@ abstract class AbstractAndroidBytecodeShapeTest : AbstractBytecodeTextTest() { loadFileByFullPath(fileName) val expected = readExpectedOccurrences(fileName) val actual = generateToText() - checkGeneratedTextAgainstExpectedOccurrences(actual, expected, TargetBackend.ANY, true) + checkGeneratedTextAgainstExpectedOccurrences(actual, expected, TargetBackend.ANY, true, JUnit4Assertions) } } From ca3bb02897cbe90da2689eece5ece8463e894e49 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Mon, 25 Jan 2021 17:16:54 +0300 Subject: [PATCH 024/212] [TD] Update spec testdata after f06a5321 --- .../diagnostics/notLinked/dfa/pos/12.kt | 44 +++++++++---------- .../diagnostics/notLinked/dfa/pos/13.kt | 44 +++++++++---------- 2 files changed, 44 insertions(+), 44 deletions(-) diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/12.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/12.kt index 448bc09db02..9b3e5f24816 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/12.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/12.kt @@ -473,7 +473,7 @@ fun T?.case_11() { equals(this) itest1() apply { - this + this equals(null) propT propAny @@ -484,29 +484,29 @@ fun T?.case_11() { funNullableT() funNullableAny() itest1() - this.equals(null) - this.propT - this.propAny - this.propNullableT - this.propNullableAny - this.funT() - this.funAny() - this.funNullableT() - this.funNullableAny() - this.itest1() + this.equals(null) + this.propT + this.propAny + this.propNullableT + this.propNullableAny + this.funT() + this.funAny() + this.funNullableT() + this.funNullableAny() + this.itest1() } also { - it - it.itest1() - it.equals(null) - it.propT - it.propAny - it.propNullableT - it.propNullableAny - it.funT() - it.funAny() - it.funNullableT() - it.funNullableAny() + it + it.itest1() + it.equals(null) + it.propT + it.propAny + it.propNullableT + it.propNullableAny + it.funT() + it.funAny() + it.funNullableT() + it.funNullableAny() } } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/13.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/13.kt index f074ec8b9ef..2647f5a8890 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/13.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/13.kt @@ -573,7 +573,7 @@ fun case_11(x: T?) { x.funNullableAny() x.itest() x.apply { - this + this equals(null) propT propAny @@ -584,29 +584,29 @@ fun case_11(x: T?) { funNullableT() funNullableAny() itest() - this.equals(null) - this.propT - this.propAny - this.propNullableT - this.propNullableAny - this.funT() - this.funAny() - this.funNullableT() - this.funNullableAny() - this.itest() + this.equals(null) + this.propT + this.propAny + this.propNullableT + this.propNullableAny + this.funT() + this.funAny() + this.funNullableT() + this.funNullableAny() + this.itest() } x.also { - it - it.itest() - it.equals(null) - it.propT - it.propAny - it.propNullableT - it.propNullableAny - it.funT() - it.funAny() - it.funNullableT() - it.funNullableAny() + it + it.itest() + it.equals(null) + it.propT + it.propAny + it.propNullableT + it.propNullableAny + it.funT() + it.funAny() + it.funNullableT() + it.funNullableAny() } } } From 708e6914bd4234a99f9e079441d60099c5781bfe Mon Sep 17 00:00:00 2001 From: Dmitry Petrov Date: Fri, 22 Jan 2021 15:31:56 +0300 Subject: [PATCH 025/212] JVM JVM_IR hide sealed class constructors --- .../kotlin/codegen/ConstructorCodegen.java | 16 +++-- .../kotlin/codegen/DescriptorAsmUtil.java | 30 ++++++++- .../kotlin/codegen/ExpressionCodegen.java | 36 ++++++++--- .../FirBlackBoxCodegenTestGenerated.java | 24 +++++-- .../jvm/lower/SyntheticAccessorLowering.kt | 56 +++++++++++----- .../box/sealed/constructorAnnotations.kt | 24 +++++++ .../box/sealed/delegatingConstructor.kt | 7 ++ .../{classes => sealed}/sealedInSameFile.kt | 0 .../inlineClasses/hiddenConstructor.kt | 13 ++++ .../inlineClasses/hiddenConstructor.txt | 58 +++++++++++++++++ .../sealed/annotationsOnSealedConstructor.kt | 3 + .../sealed/annotationsOnSealedConstructor.txt | 14 ++++ .../sealed/sealedClassConstructor_1_4.kt | 14 ++++ .../sealed/sealedClassConstructor_1_4.txt | 64 +++++++++++++++++++ .../sealed/sealedClassConstructor_1_5.kt | 14 ++++ .../sealed/sealedClassConstructor_1_5.txt | 64 +++++++++++++++++++ ...sealedClassConstructorWithDefaultParams.kt | 3 - ...ealedClassConstructorWithDefaultParams.txt | 8 --- .../codegen/BlackBoxCodegenTestGenerated.java | 24 +++++-- .../IrBlackBoxCodegenTestGenerated.java | 24 +++++-- .../codegen/BytecodeListingTestGenerated.java | 38 +++++++++-- .../LightAnalysisModeTestGenerated.java | 20 ++++-- .../ir/IrBytecodeListingTestGenerated.java | 38 +++++++++-- .../IrJsCodegenBoxES6TestGenerated.java | 15 +++-- .../IrJsCodegenBoxTestGenerated.java | 15 +++-- .../semantics/JsCodegenBoxTestGenerated.java | 15 +++-- .../IrCodegenBoxWasmTestGenerated.java | 15 +++-- 27 files changed, 555 insertions(+), 97 deletions(-) create mode 100644 compiler/testData/codegen/box/sealed/constructorAnnotations.kt create mode 100644 compiler/testData/codegen/box/sealed/delegatingConstructor.kt rename compiler/testData/codegen/box/{classes => sealed}/sealedInSameFile.kt (100%) create mode 100644 compiler/testData/codegen/bytecodeListing/inlineClasses/hiddenConstructor.kt create mode 100644 compiler/testData/codegen/bytecodeListing/inlineClasses/hiddenConstructor.txt create mode 100644 compiler/testData/codegen/bytecodeListing/sealed/annotationsOnSealedConstructor.kt create mode 100644 compiler/testData/codegen/bytecodeListing/sealed/annotationsOnSealedConstructor.txt create mode 100644 compiler/testData/codegen/bytecodeListing/sealed/sealedClassConstructor_1_4.kt create mode 100644 compiler/testData/codegen/bytecodeListing/sealed/sealedClassConstructor_1_4.txt create mode 100644 compiler/testData/codegen/bytecodeListing/sealed/sealedClassConstructor_1_5.kt create mode 100644 compiler/testData/codegen/bytecodeListing/sealed/sealedClassConstructor_1_5.txt delete mode 100644 compiler/testData/codegen/bytecodeListing/sealedClassConstructorWithDefaultParams.kt delete mode 100644 compiler/testData/codegen/bytecodeListing/sealedClassConstructorWithDefaultParams.txt diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/ConstructorCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/ConstructorCodegen.java index cf1bb8fab10..5d6cdd92961 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/ConstructorCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/ConstructorCodegen.java @@ -19,7 +19,6 @@ import org.jetbrains.kotlin.resolve.BindingContext; import org.jetbrains.kotlin.resolve.DescriptorToSourceUtils; import org.jetbrains.kotlin.resolve.InlineClassesUtilsKt; import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall; -import org.jetbrains.kotlin.resolve.jvm.InlineClassManglingRulesKt; import org.jetbrains.kotlin.resolve.jvm.diagnostics.JvmDeclarationOrigin; import org.jetbrains.kotlin.resolve.jvm.diagnostics.JvmDeclarationOriginKt; import org.jetbrains.kotlin.resolve.jvm.jvmSignature.JvmMethodParameterKind; @@ -118,8 +117,9 @@ public class ConstructorCodegen { } private void registerAccessorForHiddenConstructorIfNeeded(ClassConstructorDescriptor descriptor) { - if (!InlineClassManglingRulesKt.shouldHideConstructorDueToInlineClassTypeValueParameters(descriptor)) return; - context.getAccessor(descriptor, AccessorKind.NORMAL, null, null); + if (DescriptorAsmUtil.isHiddenConstructor(descriptor)) { + context.getAccessor(descriptor, AccessorKind.NORMAL, null, null); + } } public void generateSecondaryConstructor( @@ -371,11 +371,13 @@ public class ConstructorCodegen { JvmMethodParameterKind delegatingKind = delegatingParameters.get(index).getKind(); if (delegatingKind == JvmMethodParameterKind.VALUE) { assert index == parameters.size() || parameters.get(index).getKind() == JvmMethodParameterKind.VALUE: - "Delegating constructor has not enough implicit parameters"; + "Delegating constructor has not enough implicit parameters: " + delegatingConstructor; break; } - assert index < parameters.size() && parameters.get(index).getKind() == delegatingKind : - "Constructors of the same class should have the same set of implicit arguments"; + if (index >= parameters.size() || parameters.get(index).getKind() != delegatingKind) { + throw new AssertionError( + "Constructors of the same class should have the same set of implicit arguments: " + delegatingConstructor); + } JvmMethodParameterSignature parameter = parameters.get(index); iv.load(offset, parameter.getAsmType()); @@ -383,7 +385,7 @@ public class ConstructorCodegen { } assert index == parameters.size() || parameters.get(index).getKind() == JvmMethodParameterKind.VALUE : - "Delegating constructor has not enough parameters"; + "Delegating constructor has not enough parameters: " + delegatingConstructor; return new CallBasedArgumentGenerator(codegen, codegen.defaultCallGenerator, delegatingConstructor.getValueParameters(), delegatingCallable.getValueParameterTypes()); diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/DescriptorAsmUtil.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/DescriptorAsmUtil.java index 2ab32eba3b0..2764a922a58 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/DescriptorAsmUtil.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/DescriptorAsmUtil.java @@ -61,7 +61,8 @@ import static org.jetbrains.kotlin.codegen.JvmCodegenUtil.isJvmInterface; import static org.jetbrains.kotlin.resolve.DescriptorUtils.*; import static org.jetbrains.kotlin.resolve.inline.InlineOnlyKt.isInlineOnlyPrivateInBytecode; import static org.jetbrains.kotlin.resolve.inline.InlineOnlyKt.isInlineWithReified; -import static org.jetbrains.kotlin.resolve.jvm.AsmTypes.*; +import static org.jetbrains.kotlin.resolve.jvm.AsmTypes.JAVA_STRING_TYPE; +import static org.jetbrains.kotlin.resolve.jvm.AsmTypes.OBJECT_TYPE; import static org.jetbrains.kotlin.resolve.jvm.annotations.JvmAnnotationUtilKt.hasJvmSyntheticAnnotation; import static org.jetbrains.kotlin.types.TypeUtils.isNullableType; import static org.jetbrains.org.objectweb.asm.Opcodes.*; @@ -368,6 +369,18 @@ public class DescriptorAsmUtil { return ACC_PRIVATE; } + // Sealed class constructors should be ACC_PRIVATE. + // In 1.4 and before, sealed class constructors had PRIVATE visibility, and were represented as private methods in bytecode. + // In 1.5 (+AllowSealedInheritorsInDifferentFilesOfSamePackage), sealed class constructors became INTERNAL, + // but still should be represented as private methods in bytecode in order to prevent inheriting from sealed classes on JVM. + if (memberDescriptor instanceof ConstructorDescriptor && + !(memberDescriptor instanceof AccessorForConstructorDescriptor) && + isSealedClass(((ConstructorDescriptor) memberDescriptor).getConstructedClass()) && + memberDescriptor.getVisibility() != DescriptorVisibilities.PUBLIC + ) { + return ACC_PRIVATE; + } + if (isInlineOnlyPrivateInBytecode(memberDescriptor)) { return ACC_PRIVATE; } @@ -893,4 +906,19 @@ public class DescriptorAsmUtil { //Trait always should have this descriptor return kind != OwnerKind.DEFAULT_IMPLS && isStaticMethod(kind, descriptor) ? 0 : 1; } + + public static boolean isHiddenConstructor(FunctionDescriptor descriptor) { + if (!(descriptor instanceof ClassConstructorDescriptor)) return false; + + ClassConstructorDescriptor classConstructorDescriptor = (ClassConstructorDescriptor) descriptor; + if (InlineClassManglingRulesKt.shouldHideConstructorDueToInlineClassTypeValueParameters(descriptor)) { + return true; + } + if (isSealedClass(classConstructorDescriptor.getConstructedClass()) && + classConstructorDescriptor.getVisibility() != DescriptorVisibilities.PUBLIC + ) { + return true; + } + return false; + } } diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java index 7abf69564b4..974f617c47d 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java @@ -2523,21 +2523,39 @@ public class ExpressionCodegen extends KtVisitor impleme // $default method is not private, so you need no accessor to call it return descriptor; } - else if (InlineClassManglingRulesKt.shouldHideConstructorDueToInlineClassTypeValueParameters(descriptor.getOriginal())) { - // Constructors with inline class type value parameters should always be called using an accessor. - // NB this will require accessors even if the constructor itself is in a different module. - return new AccessorForConstructorDescriptor( - (ClassConstructorDescriptor) descriptor.getOriginal(), - descriptor.getContainingDeclaration(), - getSuperCallTarget(resolvedCall.getCall()), - AccessorKind.NORMAL - ); + else if (shouldForceAccessorForConstructor(descriptor.getOriginal())) { + return createAccessorForHiddenConstructor(resolvedCall, descriptor); } else { return context.accessibleDescriptor(descriptor, getSuperCallTarget(resolvedCall.getCall())); } } + private boolean shouldForceAccessorForConstructor(FunctionDescriptor descriptor) { + // Force using accessors on hidden constructors only + if (!isHiddenConstructor(descriptor)) { + return false; + } + // Don't use accessor when calling hidden constructor from the same class. + if (descriptor.getContainingDeclaration() == context.getContextDescriptor().getContainingDeclaration()) { + return false; + } + return true; + } + + @NotNull + private AccessorForConstructorDescriptor createAccessorForHiddenConstructor( + @NotNull ResolvedCall resolvedCall, + FunctionDescriptor descriptor + ) { + return new AccessorForConstructorDescriptor( + (ClassConstructorDescriptor) descriptor.getOriginal(), + descriptor.getContainingDeclaration(), + getSuperCallTarget(resolvedCall.getCall()), + AccessorKind.NORMAL + ); + } + @NotNull public StackValue invokeFunction(@NotNull ResolvedCall resolvedCall, @NotNull StackValue receiver) { return invokeFunction(resolvedCall.getCall(), resolvedCall, receiver); diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java index 0da9a2ee212..162e67b96b6 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java @@ -4906,12 +4906,6 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/classes/rightHandOverride.kt"); } - @Test - @TestMetadata("sealedInSameFile.kt") - public void testSealedInSameFile() throws Exception { - runTest("compiler/testData/codegen/box/classes/sealedInSameFile.kt"); - } - @Test @TestMetadata("selfcreate.kt") public void testSelfcreate() throws Exception { @@ -34494,6 +34488,18 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/sealed"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test + @TestMetadata("constructorAnnotations.kt") + public void testConstructorAnnotations() throws Exception { + runTest("compiler/testData/codegen/box/sealed/constructorAnnotations.kt"); + } + + @Test + @TestMetadata("delegatingConstructor.kt") + public void testDelegatingConstructor() throws Exception { + runTest("compiler/testData/codegen/box/sealed/delegatingConstructor.kt"); + } + @Test @TestMetadata("multipleFiles_enabled.kt") public void testMultipleFiles_enabled() throws Exception { @@ -34506,6 +34512,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/sealed/objects.kt"); } + @Test + @TestMetadata("sealedInSameFile.kt") + public void testSealedInSameFile() throws Exception { + runTest("compiler/testData/codegen/box/sealed/sealedInSameFile.kt"); + } + @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/SyntheticAccessorLowering.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/SyntheticAccessorLowering.kt index 0af9cf5f60a..62e5b8d0a60 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/SyntheticAccessorLowering.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/SyntheticAccessorLowering.kt @@ -210,28 +210,46 @@ internal class SyntheticAccessorLowering(val context: JvmBackendContext) : IrEle } private val IrConstructor.isOrShouldBeHidden: Boolean - get() = this in context.hiddenConstructors || ( - !DescriptorVisibilities.isPrivate(visibility) && !constructedClass.isInline && hasMangledParameters && - origin != IrDeclarationOrigin.FUNCTION_FOR_DEFAULT_PARAMETER && - origin != JvmLoweredDeclarationOrigin.SYNTHETIC_ACCESSOR && - origin != JvmLoweredDeclarationOrigin.SYNTHETIC_ACCESSOR_FOR_HIDDEN_CONSTRUCTOR) + get() { + if (this in context.hiddenConstructors) + return true + + if (origin == IrDeclarationOrigin.FUNCTION_FOR_DEFAULT_PARAMETER || + origin == JvmLoweredDeclarationOrigin.SYNTHETIC_ACCESSOR || + origin == JvmLoweredDeclarationOrigin.SYNTHETIC_ACCESSOR_FOR_HIDDEN_CONSTRUCTOR + ) { + return false + } + + val constructedClass = constructedClass + + if (!DescriptorVisibilities.isPrivate(visibility) && !constructedClass.isInline && hasMangledParameters) + return true + + if (visibility != DescriptorVisibilities.PUBLIC && constructedClass.modality == Modality.SEALED) + return true + + return false + } private fun handleHiddenConstructor(declaration: IrConstructor): IrConstructor { require(declaration.isOrShouldBeHidden, declaration::render) return context.hiddenConstructors.getOrPut(declaration) { declaration.makeConstructorAccessor(JvmLoweredDeclarationOrigin.SYNTHETIC_ACCESSOR_FOR_HIDDEN_CONSTRUCTOR).also { accessor -> - // There's a special case in the JVM backend for serializing the metadata of hidden - // constructors - we serialize the descriptor of the original constructor, but the - // signature of the accessor. We implement this special case in the JVM IR backend by - // attaching the metadata directly to the accessor. We also have to move all annotations - // to the accessor. Parameter annotations are already moved by the copyTo method. - if (declaration.metadata != null) { - accessor.metadata = declaration.metadata - declaration.metadata = null + if (declaration.constructedClass.modality != Modality.SEALED) { + // There's a special case in the JVM backend for serializing the metadata of hidden + // constructors - we serialize the descriptor of the original constructor, but the + // signature of the accessor. We implement this special case in the JVM IR backend by + // attaching the metadata directly to the accessor. We also have to move all annotations + // to the accessor. Parameter annotations are already moved by the copyTo method. + if (declaration.metadata != null) { + accessor.metadata = declaration.metadata + declaration.metadata = null + } + accessor.annotations += declaration.annotations + declaration.annotations = emptyList() + declaration.valueParameters.forEach { it.annotations = emptyList() } } - accessor.annotations += declaration.annotations - declaration.annotations = emptyList() - declaration.valueParameters.forEach { it.annotations = emptyList() } } } } @@ -263,6 +281,12 @@ internal class SyntheticAccessorLowering(val context: JvmBackendContext) : IrEle accessor.copyTypeParametersFrom(source, JvmLoweredDeclarationOrigin.SYNTHETIC_ACCESSOR) accessor.copyValueParametersToStatic(source, JvmLoweredDeclarationOrigin.SYNTHETIC_ACCESSOR) + if (source.constructedClass.modality == Modality.SEALED) { + for (accessorValueParameter in accessor.valueParameters) { + accessorValueParameter.annotations = emptyList() + } + } + accessor.returnType = source.returnType.remapTypeParameters(source, accessor) accessor.addValueParameter( diff --git a/compiler/testData/codegen/box/sealed/constructorAnnotations.kt b/compiler/testData/codegen/box/sealed/constructorAnnotations.kt new file mode 100644 index 00000000000..d50d938a067 --- /dev/null +++ b/compiler/testData/codegen/box/sealed/constructorAnnotations.kt @@ -0,0 +1,24 @@ +// TARGET_BACKEND: JVM +// WITH_REFLECT + +annotation class Ann + +sealed class Test @Ann constructor(@Ann val x: String) + +fun box(): String { + val testCtor = Test::class.constructors.single() + + val testCtorAnnClasses = testCtor.annotations.map { it.annotationClass } + if (testCtorAnnClasses != listOf(Ann::class)) { + throw AssertionError("Annotations on constructor: $testCtorAnnClasses") + } + + for (param in testCtor.parameters) { + val paramAnnClasses = param.annotations.map { it.annotationClass } + if (paramAnnClasses != listOf(Ann::class)) { + throw AssertionError("Annotations on constructor parameter $param: $paramAnnClasses") + } + } + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/sealed/delegatingConstructor.kt b/compiler/testData/codegen/box/sealed/delegatingConstructor.kt new file mode 100644 index 00000000000..8ad9684fe1f --- /dev/null +++ b/compiler/testData/codegen/box/sealed/delegatingConstructor.kt @@ -0,0 +1,7 @@ +sealed class Sealed(val value: String) { + constructor() : this("OK") +} + +class Derived : Sealed() + +fun box() = Derived().value \ No newline at end of file diff --git a/compiler/testData/codegen/box/classes/sealedInSameFile.kt b/compiler/testData/codegen/box/sealed/sealedInSameFile.kt similarity index 100% rename from compiler/testData/codegen/box/classes/sealedInSameFile.kt rename to compiler/testData/codegen/box/sealed/sealedInSameFile.kt diff --git a/compiler/testData/codegen/bytecodeListing/inlineClasses/hiddenConstructor.kt b/compiler/testData/codegen/bytecodeListing/inlineClasses/hiddenConstructor.kt new file mode 100644 index 00000000000..ed1f3abb4fb --- /dev/null +++ b/compiler/testData/codegen/bytecodeListing/inlineClasses/hiddenConstructor.kt @@ -0,0 +1,13 @@ +inline class Z(val x: Int) + +class Test1(val z: Z) + +class Test2(val x: String) { + constructor(z: Z) : this(z.toString()) +} + +class Test3(val z: Z = Z(0)) + +class Test4(val x: String) { + constructor(z: Z = Z(0)) : this(z.toString()) +} \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeListing/inlineClasses/hiddenConstructor.txt b/compiler/testData/codegen/bytecodeListing/inlineClasses/hiddenConstructor.txt new file mode 100644 index 00000000000..1afb869415c --- /dev/null +++ b/compiler/testData/codegen/bytecodeListing/inlineClasses/hiddenConstructor.txt @@ -0,0 +1,58 @@ +@kotlin.Metadata +public final class Test1 { + // source: 'hiddenConstructor.kt' + private final field z: int + private method (p0: int): void + public synthetic method (p0: int, p1: kotlin.jvm.internal.DefaultConstructorMarker): void + public final method getZ-a_XrcN0(): int +} + +@kotlin.Metadata +public final class Test2 { + // source: 'hiddenConstructor.kt' + private final @org.jetbrains.annotations.NotNull field x: java.lang.String + public method (@org.jetbrains.annotations.NotNull p0: java.lang.String): void + private method (p0: int): void + public synthetic method (p0: int, p1: kotlin.jvm.internal.DefaultConstructorMarker): void + public final @org.jetbrains.annotations.NotNull method getX(): java.lang.String +} + +@kotlin.Metadata +public final class Test3 { + // source: 'hiddenConstructor.kt' + private final field z: int + private method (p0: int): void + public synthetic method (p0: int, p1: int, p2: kotlin.jvm.internal.DefaultConstructorMarker): void + public synthetic method (p0: int, p1: kotlin.jvm.internal.DefaultConstructorMarker): void + public final method getZ-a_XrcN0(): int +} + +@kotlin.Metadata +public final class Test4 { + // source: 'hiddenConstructor.kt' + private final @org.jetbrains.annotations.NotNull field x: java.lang.String + public method (@org.jetbrains.annotations.NotNull p0: java.lang.String): void + private method (p0: int): void + public synthetic method (p0: int, p1: int, p2: kotlin.jvm.internal.DefaultConstructorMarker): void + public synthetic method (p0: int, p1: kotlin.jvm.internal.DefaultConstructorMarker): void + public final @org.jetbrains.annotations.NotNull method getX(): java.lang.String +} + +@kotlin.jvm.JvmInline +@kotlin.Metadata +public final class Z { + // source: 'hiddenConstructor.kt' + private final field x: int + private synthetic method (p0: int): void + public synthetic final static method box-impl(p0: int): Z + public static method constructor-impl(p0: int): int + public method equals(p0: java.lang.Object): boolean + public static method equals-impl(p0: int, p1: java.lang.Object): boolean + public final static method equals-impl0(p0: int, p1: int): boolean + public final method getX(): int + public method hashCode(): int + public static method hashCode-impl(p0: int): int + public method toString(): java.lang.String + public static method toString-impl(p0: int): java.lang.String + public synthetic final method unbox-impl(): int +} diff --git a/compiler/testData/codegen/bytecodeListing/sealed/annotationsOnSealedConstructor.kt b/compiler/testData/codegen/bytecodeListing/sealed/annotationsOnSealedConstructor.kt new file mode 100644 index 00000000000..59e8e65a14d --- /dev/null +++ b/compiler/testData/codegen/bytecodeListing/sealed/annotationsOnSealedConstructor.kt @@ -0,0 +1,3 @@ +annotation class Ann + +sealed class Sealed @Ann constructor(@Ann val x: String) \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeListing/sealed/annotationsOnSealedConstructor.txt b/compiler/testData/codegen/bytecodeListing/sealed/annotationsOnSealedConstructor.txt new file mode 100644 index 00000000000..f1027cc7182 --- /dev/null +++ b/compiler/testData/codegen/bytecodeListing/sealed/annotationsOnSealedConstructor.txt @@ -0,0 +1,14 @@ +@java.lang.annotation.Retention +@kotlin.Metadata +public annotation class Ann { + // source: 'annotationsOnSealedConstructor.kt' +} + +@kotlin.Metadata +public abstract class Sealed { + // source: 'annotationsOnSealedConstructor.kt' + private final @org.jetbrains.annotations.NotNull field x: java.lang.String + private @Ann method (@Ann p0: java.lang.String): void + public synthetic method (p0: java.lang.String, p1: kotlin.jvm.internal.DefaultConstructorMarker): void + public final @org.jetbrains.annotations.NotNull method getX(): java.lang.String +} diff --git a/compiler/testData/codegen/bytecodeListing/sealed/sealedClassConstructor_1_4.kt b/compiler/testData/codegen/bytecodeListing/sealed/sealedClassConstructor_1_4.kt new file mode 100644 index 00000000000..070b143bfb4 --- /dev/null +++ b/compiler/testData/codegen/bytecodeListing/sealed/sealedClassConstructor_1_4.kt @@ -0,0 +1,14 @@ +// !LANGUAGE: -AllowSealedInheritorsInDifferentFilesOfSamePackage + +sealed class TestNoSubclasses(val x: Int) + +sealed class TestSubclassAfter(val x: Int) +class X1 : TestSubclassAfter(42) + +sealed class TestNoSubclassesAllDefaults(val x: Int = 0) + +sealed class TestSubclassAfterAllDefaults(val x: Int = 0) +class X3 : TestSubclassAfterAllDefaults() + +class X4: TestSubclassBefore(1) +sealed class TestSubclassBefore(val x: Int) \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeListing/sealed/sealedClassConstructor_1_4.txt b/compiler/testData/codegen/bytecodeListing/sealed/sealedClassConstructor_1_4.txt new file mode 100644 index 00000000000..5d8e527ebbd --- /dev/null +++ b/compiler/testData/codegen/bytecodeListing/sealed/sealedClassConstructor_1_4.txt @@ -0,0 +1,64 @@ +@kotlin.Metadata +public abstract class TestNoSubclasses { + // source: 'sealedClassConstructor_1_4.kt' + private final field x: int + private method (p0: int): void + public synthetic method (p0: int, p1: kotlin.jvm.internal.DefaultConstructorMarker): void + public final method getX(): int +} + +@kotlin.Metadata +public abstract class TestNoSubclassesAllDefaults { + // source: 'sealedClassConstructor_1_4.kt' + private final field x: int + private method (p0: int): void + synthetic method (p0: int, p1: int, p2: kotlin.jvm.internal.DefaultConstructorMarker): void + public synthetic method (p0: int, p1: kotlin.jvm.internal.DefaultConstructorMarker): void + public final method getX(): int +} + +@kotlin.Metadata +public abstract class TestSubclassAfter { + // source: 'sealedClassConstructor_1_4.kt' + private final field x: int + private method (p0: int): void + public synthetic method (p0: int, p1: kotlin.jvm.internal.DefaultConstructorMarker): void + public final method getX(): int +} + +@kotlin.Metadata +public abstract class TestSubclassAfterAllDefaults { + // source: 'sealedClassConstructor_1_4.kt' + private final field x: int + private method (p0: int): void + synthetic method (p0: int, p1: int, p2: kotlin.jvm.internal.DefaultConstructorMarker): void + public synthetic method (p0: int, p1: kotlin.jvm.internal.DefaultConstructorMarker): void + public final method getX(): int +} + +@kotlin.Metadata +public abstract class TestSubclassBefore { + // source: 'sealedClassConstructor_1_4.kt' + private final field x: int + private method (p0: int): void + public synthetic method (p0: int, p1: kotlin.jvm.internal.DefaultConstructorMarker): void + public final method getX(): int +} + +@kotlin.Metadata +public final class X1 { + // source: 'sealedClassConstructor_1_4.kt' + public method (): void +} + +@kotlin.Metadata +public final class X3 { + // source: 'sealedClassConstructor_1_4.kt' + public method (): void +} + +@kotlin.Metadata +public final class X4 { + // source: 'sealedClassConstructor_1_4.kt' + public method (): void +} diff --git a/compiler/testData/codegen/bytecodeListing/sealed/sealedClassConstructor_1_5.kt b/compiler/testData/codegen/bytecodeListing/sealed/sealedClassConstructor_1_5.kt new file mode 100644 index 00000000000..ba125795acf --- /dev/null +++ b/compiler/testData/codegen/bytecodeListing/sealed/sealedClassConstructor_1_5.kt @@ -0,0 +1,14 @@ +// !LANGUAGE: +AllowSealedInheritorsInDifferentFilesOfSamePackage + +sealed class TestNoSubclasses(val x: Int) + +sealed class TestSubclassAfter(val x: Int) +class X1 : TestSubclassAfter(42) + +sealed class TestNoSubclassesAllDefaults(val x: Int = 0) + +sealed class TestSubclassAfterAllDefaults(val x: Int = 0) +class X3 : TestSubclassAfterAllDefaults() + +class X4: TestSubclassBefore(1) +sealed class TestSubclassBefore(val x: Int) \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeListing/sealed/sealedClassConstructor_1_5.txt b/compiler/testData/codegen/bytecodeListing/sealed/sealedClassConstructor_1_5.txt new file mode 100644 index 00000000000..81f26fefd28 --- /dev/null +++ b/compiler/testData/codegen/bytecodeListing/sealed/sealedClassConstructor_1_5.txt @@ -0,0 +1,64 @@ +@kotlin.Metadata +public abstract class TestNoSubclasses { + // source: 'sealedClassConstructor_1_5.kt' + private final field x: int + private method (p0: int): void + public synthetic method (p0: int, p1: kotlin.jvm.internal.DefaultConstructorMarker): void + public final method getX(): int +} + +@kotlin.Metadata +public abstract class TestNoSubclassesAllDefaults { + // source: 'sealedClassConstructor_1_5.kt' + private final field x: int + private method (p0: int): void + public synthetic method (p0: int, p1: int, p2: kotlin.jvm.internal.DefaultConstructorMarker): void + public synthetic method (p0: int, p1: kotlin.jvm.internal.DefaultConstructorMarker): void + public final method getX(): int +} + +@kotlin.Metadata +public abstract class TestSubclassAfter { + // source: 'sealedClassConstructor_1_5.kt' + private final field x: int + private method (p0: int): void + public synthetic method (p0: int, p1: kotlin.jvm.internal.DefaultConstructorMarker): void + public final method getX(): int +} + +@kotlin.Metadata +public abstract class TestSubclassAfterAllDefaults { + // source: 'sealedClassConstructor_1_5.kt' + private final field x: int + private method (p0: int): void + public synthetic method (p0: int, p1: int, p2: kotlin.jvm.internal.DefaultConstructorMarker): void + public synthetic method (p0: int, p1: kotlin.jvm.internal.DefaultConstructorMarker): void + public final method getX(): int +} + +@kotlin.Metadata +public abstract class TestSubclassBefore { + // source: 'sealedClassConstructor_1_5.kt' + private final field x: int + private method (p0: int): void + public synthetic method (p0: int, p1: kotlin.jvm.internal.DefaultConstructorMarker): void + public final method getX(): int +} + +@kotlin.Metadata +public final class X1 { + // source: 'sealedClassConstructor_1_5.kt' + public method (): void +} + +@kotlin.Metadata +public final class X3 { + // source: 'sealedClassConstructor_1_5.kt' + public method (): void +} + +@kotlin.Metadata +public final class X4 { + // source: 'sealedClassConstructor_1_5.kt' + public method (): void +} diff --git a/compiler/testData/codegen/bytecodeListing/sealedClassConstructorWithDefaultParams.kt b/compiler/testData/codegen/bytecodeListing/sealedClassConstructorWithDefaultParams.kt deleted file mode 100644 index 3162a07b22c..00000000000 --- a/compiler/testData/codegen/bytecodeListing/sealedClassConstructorWithDefaultParams.kt +++ /dev/null @@ -1,3 +0,0 @@ -// !LANGUAGE: +AllowSealedInheritorsInDifferentFilesOfSamePackage - -sealed class Test(val x: Int = 0) \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeListing/sealedClassConstructorWithDefaultParams.txt b/compiler/testData/codegen/bytecodeListing/sealedClassConstructorWithDefaultParams.txt deleted file mode 100644 index 87a02147c1a..00000000000 --- a/compiler/testData/codegen/bytecodeListing/sealedClassConstructorWithDefaultParams.txt +++ /dev/null @@ -1,8 +0,0 @@ -@kotlin.Metadata -public abstract class Test { - // source: 'sealedClassConstructorWithDefaultParams.kt' - private final field x: int - public method (p0: int): void - public synthetic method (p0: int, p1: int, p2: kotlin.jvm.internal.DefaultConstructorMarker): void - public final method getX(): int -} diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index 3e005c6199c..bffd9fc2e07 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -4906,12 +4906,6 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/classes/rightHandOverride.kt"); } - @Test - @TestMetadata("sealedInSameFile.kt") - public void testSealedInSameFile() throws Exception { - runTest("compiler/testData/codegen/box/classes/sealedInSameFile.kt"); - } - @Test @TestMetadata("selfcreate.kt") public void testSelfcreate() throws Exception { @@ -34694,6 +34688,18 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/sealed"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test + @TestMetadata("constructorAnnotations.kt") + public void testConstructorAnnotations() throws Exception { + runTest("compiler/testData/codegen/box/sealed/constructorAnnotations.kt"); + } + + @Test + @TestMetadata("delegatingConstructor.kt") + public void testDelegatingConstructor() throws Exception { + runTest("compiler/testData/codegen/box/sealed/delegatingConstructor.kt"); + } + @Test @TestMetadata("multipleFiles_enabled.kt") public void testMultipleFiles_enabled() throws Exception { @@ -34706,6 +34712,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/sealed/objects.kt"); } + @Test + @TestMetadata("sealedInSameFile.kt") + public void testSealedInSameFile() throws Exception { + runTest("compiler/testData/codegen/box/sealed/sealedInSameFile.kt"); + } + @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index 3b5da1b20ab..5ccba3a78a5 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -4906,12 +4906,6 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/classes/rightHandOverride.kt"); } - @Test - @TestMetadata("sealedInSameFile.kt") - public void testSealedInSameFile() throws Exception { - runTest("compiler/testData/codegen/box/classes/sealedInSameFile.kt"); - } - @Test @TestMetadata("selfcreate.kt") public void testSelfcreate() throws Exception { @@ -34494,6 +34488,18 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/sealed"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test + @TestMetadata("constructorAnnotations.kt") + public void testConstructorAnnotations() throws Exception { + runTest("compiler/testData/codegen/box/sealed/constructorAnnotations.kt"); + } + + @Test + @TestMetadata("delegatingConstructor.kt") + public void testDelegatingConstructor() throws Exception { + runTest("compiler/testData/codegen/box/sealed/delegatingConstructor.kt"); + } + @Test @TestMetadata("multipleFiles_enabled.kt") public void testMultipleFiles_enabled() throws Exception { @@ -34506,6 +34512,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/sealed/objects.kt"); } + @Test + @TestMetadata("sealedInSameFile.kt") + public void testSealedInSameFile() throws Exception { + runTest("compiler/testData/codegen/box/sealed/sealedInSameFile.kt"); + } + @Test @TestMetadata("simple.kt") public void testSimple() throws Exception { diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/BytecodeListingTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/BytecodeListingTestGenerated.java index 9ebdc0c348a..ff9c69c972a 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/BytecodeListingTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/BytecodeListingTestGenerated.java @@ -235,11 +235,6 @@ public class BytecodeListingTestGenerated extends AbstractBytecodeListingTest { runTest("compiler/testData/codegen/bytecodeListing/rawTypeInSignature.kt"); } - @TestMetadata("sealedClassConstructorWithDefaultParams.kt") - public void testSealedClassConstructorWithDefaultParams() throws Exception { - runTest("compiler/testData/codegen/bytecodeListing/sealedClassConstructorWithDefaultParams.kt"); - } - @TestMetadata("strictfpFlag.kt") public void testStrictfpFlag() throws Exception { runTest("compiler/testData/codegen/bytecodeListing/strictfpFlag.kt"); @@ -1057,6 +1052,11 @@ public class BytecodeListingTestGenerated extends AbstractBytecodeListingTest { runTest("compiler/testData/codegen/bytecodeListing/inlineClasses/genericChild.kt"); } + @TestMetadata("hiddenConstructor.kt") + public void testHiddenConstructor() throws Exception { + runTest("compiler/testData/codegen/bytecodeListing/inlineClasses/hiddenConstructor.kt"); + } + @TestMetadata("inlineCharSequence.kt") public void testInlineCharSequence() throws Exception { runTest("compiler/testData/codegen/bytecodeListing/inlineClasses/inlineCharSequence.kt"); @@ -1639,6 +1639,34 @@ public class BytecodeListingTestGenerated extends AbstractBytecodeListingTest { } } + @TestMetadata("compiler/testData/codegen/bytecodeListing/sealed") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Sealed extends AbstractBytecodeListingTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInSealed() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeListing/sealed"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); + } + + @TestMetadata("annotationsOnSealedConstructor.kt") + public void testAnnotationsOnSealedConstructor() throws Exception { + runTest("compiler/testData/codegen/bytecodeListing/sealed/annotationsOnSealedConstructor.kt"); + } + + @TestMetadata("sealedClassConstructor_1_4.kt") + public void testSealedClassConstructor_1_4() throws Exception { + runTest("compiler/testData/codegen/bytecodeListing/sealed/sealedClassConstructor_1_4.kt"); + } + + @TestMetadata("sealedClassConstructor_1_5.kt") + public void testSealedClassConstructor_1_5() throws Exception { + runTest("compiler/testData/codegen/bytecodeListing/sealed/sealedClassConstructor_1_5.kt"); + } + } + @TestMetadata("compiler/testData/codegen/bytecodeListing/specialBridges") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 93d7d5e89fa..00323b09d18 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -4284,11 +4284,6 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/classes/rightHandOverride.kt"); } - @TestMetadata("sealedInSameFile.kt") - public void testSealedInSameFile() throws Exception { - runTest("compiler/testData/codegen/box/classes/sealedInSameFile.kt"); - } - @TestMetadata("selfcreate.kt") public void testSelfcreate() throws Exception { runTest("compiler/testData/codegen/box/classes/selfcreate.kt"); @@ -28314,6 +28309,16 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/sealed"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @TestMetadata("constructorAnnotations.kt") + public void testConstructorAnnotations() throws Exception { + runTest("compiler/testData/codegen/box/sealed/constructorAnnotations.kt"); + } + + @TestMetadata("delegatingConstructor.kt") + public void testDelegatingConstructor() throws Exception { + runTest("compiler/testData/codegen/box/sealed/delegatingConstructor.kt"); + } + @TestMetadata("multipleFiles_enabled.kt") public void testMultipleFiles_enabled() throws Exception { runTest("compiler/testData/codegen/box/sealed/multipleFiles_enabled.kt"); @@ -28324,6 +28329,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/sealed/objects.kt"); } + @TestMetadata("sealedInSameFile.kt") + public void testSealedInSameFile() throws Exception { + runTest("compiler/testData/codegen/box/sealed/sealedInSameFile.kt"); + } + @TestMetadata("simple.kt") public void testSimple() throws Exception { runTest("compiler/testData/codegen/box/sealed/simple.kt"); diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrBytecodeListingTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrBytecodeListingTestGenerated.java index cb0deeb7551..096199f57f7 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrBytecodeListingTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrBytecodeListingTestGenerated.java @@ -235,11 +235,6 @@ public class IrBytecodeListingTestGenerated extends AbstractIrBytecodeListingTes runTest("compiler/testData/codegen/bytecodeListing/rawTypeInSignature.kt"); } - @TestMetadata("sealedClassConstructorWithDefaultParams.kt") - public void testSealedClassConstructorWithDefaultParams() throws Exception { - runTest("compiler/testData/codegen/bytecodeListing/sealedClassConstructorWithDefaultParams.kt"); - } - @TestMetadata("strictfpFlag.kt") public void testStrictfpFlag() throws Exception { runTest("compiler/testData/codegen/bytecodeListing/strictfpFlag.kt"); @@ -1057,6 +1052,11 @@ public class IrBytecodeListingTestGenerated extends AbstractIrBytecodeListingTes runTest("compiler/testData/codegen/bytecodeListing/inlineClasses/genericChild.kt"); } + @TestMetadata("hiddenConstructor.kt") + public void testHiddenConstructor() throws Exception { + runTest("compiler/testData/codegen/bytecodeListing/inlineClasses/hiddenConstructor.kt"); + } + @TestMetadata("inlineCharSequence.kt") public void testInlineCharSequence() throws Exception { runTest("compiler/testData/codegen/bytecodeListing/inlineClasses/inlineCharSequence.kt"); @@ -1639,6 +1639,34 @@ public class IrBytecodeListingTestGenerated extends AbstractIrBytecodeListingTes } } + @TestMetadata("compiler/testData/codegen/bytecodeListing/sealed") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Sealed extends AbstractIrBytecodeListingTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + } + + public void testAllFilesPresentInSealed() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeListing/sealed"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @TestMetadata("annotationsOnSealedConstructor.kt") + public void testAnnotationsOnSealedConstructor() throws Exception { + runTest("compiler/testData/codegen/bytecodeListing/sealed/annotationsOnSealedConstructor.kt"); + } + + @TestMetadata("sealedClassConstructor_1_4.kt") + public void testSealedClassConstructor_1_4() throws Exception { + runTest("compiler/testData/codegen/bytecodeListing/sealed/sealedClassConstructor_1_4.kt"); + } + + @TestMetadata("sealedClassConstructor_1_5.kt") + public void testSealedClassConstructor_1_5() throws Exception { + runTest("compiler/testData/codegen/bytecodeListing/sealed/sealedClassConstructor_1_5.kt"); + } + } + @TestMetadata("compiler/testData/codegen/bytecodeListing/specialBridges") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java index e46e1454e62..360ee393f14 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java @@ -3414,11 +3414,6 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes runTest("compiler/testData/codegen/box/classes/rightHandOverride.kt"); } - @TestMetadata("sealedInSameFile.kt") - public void testSealedInSameFile() throws Exception { - runTest("compiler/testData/codegen/box/classes/sealedInSameFile.kt"); - } - @TestMetadata("selfcreate.kt") public void testSelfcreate() throws Exception { runTest("compiler/testData/codegen/box/classes/selfcreate.kt"); @@ -24565,6 +24560,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/sealed"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); } + @TestMetadata("delegatingConstructor.kt") + public void testDelegatingConstructor() throws Exception { + runTest("compiler/testData/codegen/box/sealed/delegatingConstructor.kt"); + } + @TestMetadata("multipleFiles_enabled.kt") public void testMultipleFiles_enabled() throws Exception { runTest("compiler/testData/codegen/box/sealed/multipleFiles_enabled.kt"); @@ -24575,6 +24575,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes runTest("compiler/testData/codegen/box/sealed/objects.kt"); } + @TestMetadata("sealedInSameFile.kt") + public void testSealedInSameFile() throws Exception { + runTest("compiler/testData/codegen/box/sealed/sealedInSameFile.kt"); + } + @TestMetadata("simple.kt") public void testSimple() throws Exception { runTest("compiler/testData/codegen/box/sealed/simple.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java index 79d643230e5..9c921643b65 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java @@ -3414,11 +3414,6 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/classes/rightHandOverride.kt"); } - @TestMetadata("sealedInSameFile.kt") - public void testSealedInSameFile() throws Exception { - runTest("compiler/testData/codegen/box/classes/sealedInSameFile.kt"); - } - @TestMetadata("selfcreate.kt") public void testSelfcreate() throws Exception { runTest("compiler/testData/codegen/box/classes/selfcreate.kt"); @@ -24565,6 +24560,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/sealed"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); } + @TestMetadata("delegatingConstructor.kt") + public void testDelegatingConstructor() throws Exception { + runTest("compiler/testData/codegen/box/sealed/delegatingConstructor.kt"); + } + @TestMetadata("multipleFiles_enabled.kt") public void testMultipleFiles_enabled() throws Exception { runTest("compiler/testData/codegen/box/sealed/multipleFiles_enabled.kt"); @@ -24575,6 +24575,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/sealed/objects.kt"); } + @TestMetadata("sealedInSameFile.kt") + public void testSealedInSameFile() throws Exception { + runTest("compiler/testData/codegen/box/sealed/sealedInSameFile.kt"); + } + @TestMetadata("simple.kt") public void testSimple() throws Exception { runTest("compiler/testData/codegen/box/sealed/simple.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index 30ef2e712cc..52787c0d968 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -3414,11 +3414,6 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/classes/rightHandOverride.kt"); } - @TestMetadata("sealedInSameFile.kt") - public void testSealedInSameFile() throws Exception { - runTest("compiler/testData/codegen/box/classes/sealedInSameFile.kt"); - } - @TestMetadata("selfcreate.kt") public void testSelfcreate() throws Exception { runTest("compiler/testData/codegen/box/classes/selfcreate.kt"); @@ -24530,6 +24525,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/sealed"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true); } + @TestMetadata("delegatingConstructor.kt") + public void testDelegatingConstructor() throws Exception { + runTest("compiler/testData/codegen/box/sealed/delegatingConstructor.kt"); + } + @TestMetadata("multipleFiles_enabled.kt") public void testMultipleFiles_enabled() throws Exception { runTest("compiler/testData/codegen/box/sealed/multipleFiles_enabled.kt"); @@ -24540,6 +24540,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/sealed/objects.kt"); } + @TestMetadata("sealedInSameFile.kt") + public void testSealedInSameFile() throws Exception { + runTest("compiler/testData/codegen/box/sealed/sealedInSameFile.kt"); + } + @TestMetadata("simple.kt") public void testSimple() throws Exception { runTest("compiler/testData/codegen/box/sealed/simple.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java index 32c76383dda..99f5351fe67 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java @@ -2315,11 +2315,6 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest runTest("compiler/testData/codegen/box/classes/rightHandOverride.kt"); } - @TestMetadata("sealedInSameFile.kt") - public void testSealedInSameFile() throws Exception { - runTest("compiler/testData/codegen/box/classes/sealedInSameFile.kt"); - } - @TestMetadata("selfcreate.kt") public void testSelfcreate() throws Exception { runTest("compiler/testData/codegen/box/classes/selfcreate.kt"); @@ -13064,6 +13059,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/sealed"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true); } + @TestMetadata("delegatingConstructor.kt") + public void testDelegatingConstructor() throws Exception { + runTest("compiler/testData/codegen/box/sealed/delegatingConstructor.kt"); + } + @TestMetadata("multipleFiles_enabled.kt") public void testMultipleFiles_enabled() throws Exception { runTest("compiler/testData/codegen/box/sealed/multipleFiles_enabled.kt"); @@ -13074,6 +13074,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest runTest("compiler/testData/codegen/box/sealed/objects.kt"); } + @TestMetadata("sealedInSameFile.kt") + public void testSealedInSameFile() throws Exception { + runTest("compiler/testData/codegen/box/sealed/sealedInSameFile.kt"); + } + @TestMetadata("simple.kt") public void testSimple() throws Exception { runTest("compiler/testData/codegen/box/sealed/simple.kt"); From cb3b1f8ae28a870871d57e0e9fada914fdb0fe0a Mon Sep 17 00:00:00 2001 From: Svyatoslav Kuzmich Date: Fri, 22 Jan 2021 15:24:05 +0300 Subject: [PATCH 026/212] [JS IR] Fix referencing Kotin variables in inline JS code Fixed by outlining JS code that uses Kotlin variables making usages of these locals explicit and preventing bugs due to one-sided variable renaming. This prevents using Kotlin variables as lvalue in JS code. --- .../kotlin/ir/backend/js/JsIntrinsics.kt | 6 +- .../kotlin/ir/backend/js/JsLoweringPhases.kt | 7 + .../js/lower/JsCodeOutliningLowering.kt | 187 ++++++++++++++++++ .../js/transformers/irToJs/jsAstUtils.kt | 8 + .../backend/js/transformers/irToJs/jsCode.kt | 2 +- .../ir/backend/js/utils/AnnotationUtils.kt | 9 +- .../testData/box/inline/jsCode.kt | 2 - .../testData/box/inline/jsCodeVarDeclared.kt | 2 - js/js.translator/testData/box/jsCode/break.kt | 1 + .../testData/box/jsCode/continue.kt | 1 + js/js.translator/testData/box/jsCode/label.kt | 1 + .../testData/box/jsCode/labelSiblingClash.kt | 1 + .../testData/box/jsCode/operators.kt | 32 +-- .../stdlib/js-ir/runtime/kotlinJsHacks.kt | 16 ++ 14 files changed, 253 insertions(+), 22 deletions(-) create mode 100644 compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/JsCodeOutliningLowering.kt diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsIntrinsics.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsIntrinsics.kt index d20400aab4a..1bac938a8c6 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsIntrinsics.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsIntrinsics.kt @@ -17,9 +17,12 @@ import org.jetbrains.kotlin.ir.declarations.IrSimpleFunction import org.jetbrains.kotlin.ir.declarations.impl.IrExternalPackageFragmentImpl import org.jetbrains.kotlin.ir.descriptors.IrBuiltIns import org.jetbrains.kotlin.ir.symbols.IrSimpleFunctionSymbol -import org.jetbrains.kotlin.ir.types.* +import org.jetbrains.kotlin.ir.types.IrType +import org.jetbrains.kotlin.ir.types.defaultType import org.jetbrains.kotlin.ir.types.impl.IrSimpleTypeBuilder import org.jetbrains.kotlin.ir.types.impl.buildSimpleType +import org.jetbrains.kotlin.ir.types.isLong +import org.jetbrains.kotlin.ir.types.typeWithParameters import org.jetbrains.kotlin.ir.util.constructors import org.jetbrains.kotlin.ir.util.findDeclaration import org.jetbrains.kotlin.ir.util.kotlinPackageFqn @@ -278,6 +281,7 @@ class JsIntrinsics(private val irBuiltIns: IrBuiltIns, val context: JsIrBackendC // TODO move to IntrinsifyCallsLowering val doNotIntrinsifyAnnotationSymbol = context.symbolTable.referenceClass(context.getJsInternalClass("DoNotIntrinsify")) + val jsFunAnnotationSymbol = context.symbolTable.referenceClass(context.getJsInternalClass("JsFun")) // TODO move CharSequence-related stiff to IntrinsifyCallsLowering val charSequenceClassSymbol = context.symbolTable.referenceClass(context.getClass(FqName("kotlin.CharSequence"))) diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsLoweringPhases.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsLoweringPhases.kt index ab113f67d14..f4852f3c3e5 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsLoweringPhases.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsLoweringPhases.kt @@ -185,6 +185,12 @@ private val stripTypeAliasDeclarationsPhase = makeDeclarationTransformerPhase( description = "Strip typealias declarations" ) +private val jsCodeOutliningPhase = makeBodyLoweringPhase( + ::JsCodeOutliningLowering, + name = "JsCodeOutliningLowering", + description = "Outline js() calls where JS code references Kotlin locals" +) + private val arrayConstructorPhase = makeBodyLoweringPhase( ::ArrayConstructorLowering, name = "ArrayConstructor", @@ -713,6 +719,7 @@ private val loweringList = listOf( validateIrBeforeLowering, expectDeclarationsRemovingPhase, stripTypeAliasDeclarationsPhase, + jsCodeOutliningPhase, arrayConstructorPhase, lateinitNullableFieldsPhase, lateinitDeclarationLoweringPhase, diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/JsCodeOutliningLowering.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/JsCodeOutliningLowering.kt new file mode 100644 index 00000000000..42a762e2c26 --- /dev/null +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/JsCodeOutliningLowering.kt @@ -0,0 +1,187 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.ir.backend.js.lower + +import org.jetbrains.kotlin.backend.common.BodyLoweringPass +import org.jetbrains.kotlin.backend.common.IrElementTransformerVoidWithContext +import org.jetbrains.kotlin.backend.common.lower.createIrBuilder +import org.jetbrains.kotlin.backend.common.pop +import org.jetbrains.kotlin.backend.common.push +import org.jetbrains.kotlin.descriptors.DescriptorVisibilities +import org.jetbrains.kotlin.ir.IrStatement +import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET +import org.jetbrains.kotlin.ir.backend.js.JsIrBackendContext +import org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.translateJsCodeIntoStatementList +import org.jetbrains.kotlin.ir.backend.js.utils.emptyScope +import org.jetbrains.kotlin.ir.builders.declarations.addValueParameter +import org.jetbrains.kotlin.ir.builders.declarations.buildFun +import org.jetbrains.kotlin.ir.builders.irCall +import org.jetbrains.kotlin.ir.builders.irComposite +import org.jetbrains.kotlin.ir.builders.irGet +import org.jetbrains.kotlin.ir.builders.irString +import org.jetbrains.kotlin.ir.declarations.* +import org.jetbrains.kotlin.ir.expressions.IrBody +import org.jetbrains.kotlin.ir.expressions.IrCall +import org.jetbrains.kotlin.ir.expressions.IrContainerExpression +import org.jetbrains.kotlin.ir.expressions.IrExpression +import org.jetbrains.kotlin.ir.util.constructors +import org.jetbrains.kotlin.ir.visitors.transformChildrenVoid +import org.jetbrains.kotlin.js.backend.ast.* +import org.jetbrains.kotlin.name.Name +import org.jetbrains.kotlin.utils.addIfNotNull + +// Outlines `kotlin.js.js(code: String)` calls where JS code references Kotlin locals. +// Makes locals usages explicit. +class JsCodeOutliningLowering(val backendContext: JsIrBackendContext) : BodyLoweringPass { + override fun lower(irBody: IrBody, container: IrDeclaration) { + val replacer = JsCodeOutlineTransformer(backendContext, container) + irBody.transformChildrenVoid(replacer) + } +} + +private class JsCodeOutlineTransformer( + val backendContext: JsIrBackendContext, + val container: IrDeclaration, +) : IrElementTransformerVoidWithContext() { + val localScopes: MutableList> = + mutableListOf(mutableMapOf()) + + init { + if (container is IrFunction) { + container.valueParameters.forEach { + registerValueDeclaration(it) + } + } + } + + inline fun withLocalScope(body: () -> T): T { + localScopes.push(mutableMapOf()) + val res = body() + localScopes.pop() + return res + } + + fun registerValueDeclaration(irValueDeclaration: IrValueDeclaration) { + val name = irValueDeclaration.name + if (!name.isSpecial) { + val identifier = name.identifier + val currentScope = localScopes.lastOrNull() ?: error("Expecting a scope") + currentScope[identifier] = irValueDeclaration + } + } + + fun findValueDeclarationWithName(name: String): IrValueDeclaration? { + for (i in (localScopes.size - 1) downTo 0) { + val scope = localScopes[i] + return scope[name] ?: continue + } + return null + } + + override fun visitContainerExpression(expression: IrContainerExpression): IrExpression { + return withLocalScope { super.visitContainerExpression(expression) } + } + + override fun visitDeclaration(declaration: IrDeclarationBase): IrStatement { + return withLocalScope { super.visitDeclaration(declaration) } + } + + override fun visitValueParameterNew(declaration: IrValueParameter): IrStatement { + return super.visitValueParameterNew(declaration).also { registerValueDeclaration(declaration) } + } + + override fun visitVariable(declaration: IrVariable): IrStatement { + return super.visitVariable(declaration).also { registerValueDeclaration(declaration) } + } + + override fun visitCall(expression: IrCall): IrExpression { + return outlineJsCodeIfNeeded(expression) ?: super.visitCall(expression) + } + + fun outlineJsCodeIfNeeded(expression: IrCall): IrExpression? { + if (expression.symbol != backendContext.intrinsics.jsCode) + return null + + val jsCodeArg = expression.getValueArgument(0) ?: error("Expected js code string") + val jsStatements = translateJsCodeIntoStatementList(jsCodeArg) + + // Collect used Kotlin local variables and parameters. + val kotlinLocalsUsedInJs = mutableListOf() + val processedNames = mutableSetOf() + jsStatements.forEach { statement -> + object : RecursiveJsVisitor() { + override fun visitNameRef(nameRef: JsNameRef) { + super.visitNameRef(nameRef) + val name = nameRef.name + // With this approach we should be able to find all usages of Kotlin variables in JS code. + // We will also collect shadowed usages, but it is OK since the same shadowing will be present in generated JS code. + if (name != null && nameRef.qualifier == null) { + // Keeping track of processed names to avoid registering them multiple times + if (processedNames.add(name.ident)) { + kotlinLocalsUsedInJs.addIfNotNull(findValueDeclarationWithName(name.ident)) + } + } + } + }.accept(statement) + } + if (kotlinLocalsUsedInJs.isEmpty()) + return null + + // Building outlined IR function skeleton + val outlinedFunction = backendContext.irFactory.buildFun { + name = Name.identifier("outlinedJsCode$") + visibility = DescriptorVisibilities.LOCAL + returnType = backendContext.dynamicType + } + // We don't need this function's body. Using empty block body stub, because some code might expect all functions to have bodies. + outlinedFunction.body = backendContext.irFactory.createBlockBody(UNDEFINED_OFFSET, UNDEFINED_OFFSET) + outlinedFunction.parent = container as IrDeclarationParent + kotlinLocalsUsedInJs.forEach { local -> + outlinedFunction.addValueParameter { + name = local.name + type = local.type + } + } + + // Building JS Ast function + val lastStatement = jsStatements.last() + val newStatements = jsStatements.toMutableList() + when (lastStatement) { + is JsReturn -> { + } + is JsExpressionStatement -> { + newStatements[jsStatements.lastIndex] = JsReturn(lastStatement.expression) + } + else -> { + newStatements += JsReturn(JsPrefixOperation(JsUnaryOperator.VOID, JsIntLiteral(3))) + } + } + val newFun = JsFunction(emptyScope, JsBlock(newStatements), "") + kotlinLocalsUsedInJs.forEach { irParameter -> + newFun.parameters.add(JsParameter(JsName(irParameter.name.identifier))) + } + + with(backendContext.createIrBuilder(container.symbol)) { + // Add @JsFun("function (used_local1, used_local2, ..) { ... }") annotation to outlined function + val jsFunCtor = backendContext.intrinsics.jsFunAnnotationSymbol.constructors.single() + val jsFunCall = + irCall(jsFunCtor).apply { + putValueArgument(0, irString(newFun.toString())) + } + outlinedFunction.annotations = listOf(jsFunCall) + + val outlinedFunctionCall = irCall(outlinedFunction).apply { + kotlinLocalsUsedInJs.forEachIndexed { index, local -> + putValueArgument(index, irGet(local)) + } + } + return irComposite { + +outlinedFunction + +outlinedFunctionCall + } + } + } +} \ No newline at end of file diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/jsAstUtils.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/jsAstUtils.kt index 03c62fa6da7..a4b64bb3fa6 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/jsAstUtils.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/jsAstUtils.kt @@ -42,6 +42,14 @@ fun jsAssignment(left: JsExpression, right: JsExpression) = JsBinaryOperation(Js fun prototypeOf(classNameRef: JsExpression) = JsNameRef(Namer.PROTOTYPE_NAME, classNameRef) fun translateFunction(declaration: IrFunction, name: JsName?, context: JsGenerationContext): JsFunction { + val jsFun = declaration.getJsFunAnnotation() + if (jsFun != null) { + // JsFun internal annotation must have string containing valid function expression + val function = (parseJsCode(jsFun)!!.single() as JsExpressionStatement).expression as JsFunction + function.name = name + return function + } + val functionContext = context.newDeclaration(declaration) val functionParams = declaration.valueParameters.map { functionContext.getNameForValueDeclaration(it) } val body = declaration.body?.accept(IrElementToJsStatementTransformer(), functionContext) as? JsBlock ?: JsBlock() diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/jsCode.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/jsCode.kt index d64d9494239..66e2976b23a 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/jsCode.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/jsCode.kt @@ -44,7 +44,7 @@ fun translateJsCodeIntoStatementList(code: IrExpression): List { return parseJsCode(foldString(code)) ?: emptyList() } -private fun parseJsCode(jsCode: String): List? { +fun parseJsCode(jsCode: String): List? { // Parser can change local or global scope. // In case of js we want to keep new local names, // but no new global ones. diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/AnnotationUtils.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/AnnotationUtils.kt index 0f787ec4e40..7df5ec5df78 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/AnnotationUtils.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/AnnotationUtils.kt @@ -5,8 +5,9 @@ package org.jetbrains.kotlin.ir.backend.js.utils -import org.jetbrains.kotlin.ir.declarations.* -import org.jetbrains.kotlin.ir.expressions.IrCall +import org.jetbrains.kotlin.ir.declarations.IrAnnotationContainer +import org.jetbrains.kotlin.ir.declarations.IrClass +import org.jetbrains.kotlin.ir.declarations.IrDeclarationWithName import org.jetbrains.kotlin.ir.expressions.IrClassReference import org.jetbrains.kotlin.ir.expressions.IrConst import org.jetbrains.kotlin.ir.expressions.IrConstructorCall @@ -24,6 +25,7 @@ object JsAnnotations { val jsNativeGetter = FqName("kotlin.js.nativeGetter") val jsNativeSetter = FqName("kotlin.js.nativeSetter") val jsNativeInvoke = FqName("kotlin.js.nativeInvoke") + val jsFunFqn = FqName("kotlin.js.JsFun") } @Suppress("UNCHECKED_CAST") @@ -42,6 +44,9 @@ fun IrAnnotationContainer.getJsQualifier(): String? = fun IrAnnotationContainer.getJsName(): String? = getAnnotation(JsAnnotations.jsNameFqn)?.getSingleConstStringArgument() +fun IrAnnotationContainer.getJsFunAnnotation(): String? = + getAnnotation(JsAnnotations.jsFunFqn)?.getSingleConstStringArgument() + fun IrAnnotationContainer.isJsExport(): Boolean = hasAnnotation(JsAnnotations.jsExportFqn) diff --git a/js/js.translator/testData/box/inline/jsCode.kt b/js/js.translator/testData/box/inline/jsCode.kt index 65842c22ba6..1288a6f4960 100644 --- a/js/js.translator/testData/box/inline/jsCode.kt +++ b/js/js.translator/testData/box/inline/jsCode.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: JS_IR -// IGNORE_BACKEND: JS_IR_ES6 // EXPECTED_REACHABLE_NODES: 1283 package foo diff --git a/js/js.translator/testData/box/inline/jsCodeVarDeclared.kt b/js/js.translator/testData/box/inline/jsCodeVarDeclared.kt index 8e2b563084c..f01e5e69c1b 100644 --- a/js/js.translator/testData/box/inline/jsCodeVarDeclared.kt +++ b/js/js.translator/testData/box/inline/jsCodeVarDeclared.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND: JS_IR -// IGNORE_BACKEND: JS_IR_ES6 // EXPECTED_REACHABLE_NODES: 1283 package foo diff --git a/js/js.translator/testData/box/jsCode/break.kt b/js/js.translator/testData/box/jsCode/break.kt index a2e99e47b86..701e8689e31 100644 --- a/js/js.translator/testData/box/jsCode/break.kt +++ b/js/js.translator/testData/box/jsCode/break.kt @@ -1,3 +1,4 @@ +// IGNORE_BACKEND: JS_IR // EXPECTED_REACHABLE_NODES: 1282 package foo diff --git a/js/js.translator/testData/box/jsCode/continue.kt b/js/js.translator/testData/box/jsCode/continue.kt index 9613a3b282d..bef5cdb7aec 100644 --- a/js/js.translator/testData/box/jsCode/continue.kt +++ b/js/js.translator/testData/box/jsCode/continue.kt @@ -1,4 +1,5 @@ // EXPECTED_REACHABLE_NODES: 1282 +// IGNORE_BACKEND: JS_IR package foo fun box(): String { diff --git a/js/js.translator/testData/box/jsCode/label.kt b/js/js.translator/testData/box/jsCode/label.kt index e93df0cf9f6..f2cfcb6d4a8 100644 --- a/js/js.translator/testData/box/jsCode/label.kt +++ b/js/js.translator/testData/box/jsCode/label.kt @@ -1,3 +1,4 @@ +// IGNORE_BACKEND: JS_IR // EXPECTED_REACHABLE_NODES: 1285 package foo diff --git a/js/js.translator/testData/box/jsCode/labelSiblingClash.kt b/js/js.translator/testData/box/jsCode/labelSiblingClash.kt index 4602c4de8b1..d271ac2f6f0 100644 --- a/js/js.translator/testData/box/jsCode/labelSiblingClash.kt +++ b/js/js.translator/testData/box/jsCode/labelSiblingClash.kt @@ -1,4 +1,5 @@ // EXPECTED_REACHABLE_NODES: 1282 +// IGNORE_BACKEND: JS_IR package foo // CHECK_LABELS_COUNT: function=box name=block count=2 diff --git a/js/js.translator/testData/box/jsCode/operators.kt b/js/js.translator/testData/box/jsCode/operators.kt index 85baf167cab..a7f806c8ef8 100644 --- a/js/js.translator/testData/box/jsCode/operators.kt +++ b/js/js.translator/testData/box/jsCode/operators.kt @@ -21,13 +21,15 @@ fun box(): String { assertEquals(1, js("0 ^ 1"), "^") assertEquals(-2, js("~1"), "~") - var i = 2 - assertEquals(1, js("--i"), "-- prefix") - assertEquals(1, js("i--"), "-- postfix (1)") - assertEquals(0, js("i"), "-- postfix (0)") - assertEquals(1, js("++i"), "++ prefix") - assertEquals(1, js("i++"), "++ postfix (1)") - assertEquals(2, js("i"), "++ postfix (0)") + if (testUtils.isLegacyBackend()) { + var i = 2 + assertEquals(1, js("--i"), "-- prefix") + assertEquals(1, js("i--"), "-- postfix (1)") + assertEquals(0, js("i"), "-- postfix (0)") + assertEquals(1, js("++i"), "++ prefix") + assertEquals(1, js("i++"), "++ postfix (1)") + assertEquals(2, js("i"), "++ postfix (0)") + } assertEquals(true , js("true || false"), "||") assertEquals(false , js("true && false"), "&&") @@ -47,13 +49,15 @@ fun box(): String { assertEquals("even", js("(4 % 2 === 0)?'even':'odd'"), "?:") assertEquals(3, js("1,2,3"), ", (comma)") - var j = 0 - assertEquals(1, js("j = 1"), "=") - assertEquals(3, js("j += 2"), "+=") - assertEquals(2, js("j -= 1"), "-=") - assertEquals(14, js("j *= 7"), "*=") - assertEquals(7, js("j /= 2"), "/=") - assertEquals(1, js("j %= 2"), "%=") + if (testUtils.isLegacyBackend()) { + var j = 0 + assertEquals(1, js("j = 1"), "=") + assertEquals(3, js("j += 2"), "+=") + assertEquals(2, js("j -= 1"), "-=") + assertEquals(14, js("j *= 7"), "*=") + assertEquals(7, js("j /= 2"), "/=") + assertEquals(1, js("j %= 2"), "%=") + } assertEquals(undefined, js("(void 0)"), "void") assertEquals(true, js("'key' in {'key': 10}"), "in") diff --git a/libraries/stdlib/js-ir/runtime/kotlinJsHacks.kt b/libraries/stdlib/js-ir/runtime/kotlinJsHacks.kt index d9cebb5b850..2754a6c4f60 100644 --- a/libraries/stdlib/js-ir/runtime/kotlinJsHacks.kt +++ b/libraries/stdlib/js-ir/runtime/kotlinJsHacks.kt @@ -12,3 +12,19 @@ internal fun > enumValuesIntrinsic(): Array = @PublishedApi internal fun > enumValueOfIntrinsic(@Suppress("UNUSED_PARAMETER") name: String): T = throw IllegalStateException("Should be replaced by compiler") + + +/** + * Implements annotated function in JavaScript. + * [code] string must contain JS expression that evaluates to JS function with signature that matches annotated kotlin function + * + * For example, a function that adds two Doubles: + * + * @JsFun("(x, y) => x + y") + * fun jsAdd(x: Double, y: Double): Double = + * error("...") + * + * Code gets inserted as is without syntax verification. + */ +@Target(AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER) +internal annotation class JsFun(val code: String) \ No newline at end of file From f85263ca7f9b072cae8142c1738145bc61025046 Mon Sep 17 00:00:00 2001 From: Svyatoslav Kuzmich Date: Mon, 25 Jan 2021 14:10:51 +0300 Subject: [PATCH 027/212] [JS IR] Add fast path to JsCodeOutliningLowering --- .../js/lower/JsCodeOutliningLowering.kt | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/JsCodeOutliningLowering.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/JsCodeOutliningLowering.kt index 42a762e2c26..62c74bc1a21 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/JsCodeOutliningLowering.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/JsCodeOutliningLowering.kt @@ -11,6 +11,7 @@ import org.jetbrains.kotlin.backend.common.lower.createIrBuilder import org.jetbrains.kotlin.backend.common.pop import org.jetbrains.kotlin.backend.common.push import org.jetbrains.kotlin.descriptors.DescriptorVisibilities +import org.jetbrains.kotlin.ir.IrElement import org.jetbrains.kotlin.ir.IrStatement import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET import org.jetbrains.kotlin.ir.backend.js.JsIrBackendContext @@ -27,7 +28,10 @@ import org.jetbrains.kotlin.ir.expressions.IrBody import org.jetbrains.kotlin.ir.expressions.IrCall import org.jetbrains.kotlin.ir.expressions.IrContainerExpression import org.jetbrains.kotlin.ir.expressions.IrExpression +import org.jetbrains.kotlin.ir.symbols.IrFunctionSymbol import org.jetbrains.kotlin.ir.util.constructors +import org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid +import org.jetbrains.kotlin.ir.visitors.acceptChildrenVoid import org.jetbrains.kotlin.ir.visitors.transformChildrenVoid import org.jetbrains.kotlin.js.backend.ast.* import org.jetbrains.kotlin.name.Name @@ -37,11 +41,33 @@ import org.jetbrains.kotlin.utils.addIfNotNull // Makes locals usages explicit. class JsCodeOutliningLowering(val backendContext: JsIrBackendContext) : BodyLoweringPass { override fun lower(irBody: IrBody, container: IrDeclaration) { + // Fast path to avoid tracking locals scopes for bodies without js() calls + if (!irBody.containsCallsTo(backendContext.intrinsics.jsCode)) + return + val replacer = JsCodeOutlineTransformer(backendContext, container) irBody.transformChildrenVoid(replacer) } } +private fun IrElement.containsCallsTo(symbol: IrFunctionSymbol): Boolean { + var result = false + acceptChildrenVoid(object : IrElementVisitorVoid { + override fun visitElement(element: IrElement) { + element.acceptChildrenVoid(this) + } + + override fun visitCall(expression: IrCall) { + if (expression.symbol == symbol) { + result = true + } + super.visitCall(expression) + } + }) + + return result +} + private class JsCodeOutlineTransformer( val backendContext: JsIrBackendContext, val container: IrDeclaration, From 3e820ff3b16ca0510b30d5beca4f0ae1818a5ad2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steven=20Sch=C3=A4fer?= Date: Fri, 22 Jan 2021 16:57:55 +0100 Subject: [PATCH 028/212] JVM: Take inline class mangling state into account for default methods --- .../kotlin/codegen/state/KotlinTypeMapper.kt | 18 ++++++- ...mpileKotlinAgainstKotlinTestGenerated.java | 50 +++++++++++++++++++ ...llDeserializedPropertyOnInlineClassType.kt | 1 + ...zedPropertyOnInlineClassTypeOldMangling.kt | 21 ++++++++ ...rametersInBinaryDependenciesOldMangling.kt | 14 ++++++ ...tWithInlineClassAndReceiversOldMangling.kt | 16 ++++++ ...ineClassFakeOverrideManglingOldMangling.kt | 23 +++++++++ ...eClassFromBinaryDependenciesOldMangling.kt | 40 +++++++++++++++ .../inlineClassInlineFunctionCall.kt | 1 + ...nlineClassInlineFunctionCallOldMangling.kt | 14 ++++++ .../inlineClassInlinePropertyOldMangling.kt | 17 +++++++ ...vateCompanionObjectValInDifferentModule.kt | 1 + ...onObjectValInDifferentModuleOldMangling.kt | 24 +++++++++ .../privateTopLevelValInDifferentModule.kt | 1 + ...TopLevelValInDifferentModuleOldMangling.kt | 21 ++++++++ .../suspendFunWithDefaultMangling.kt | 1 + .../suspendFunWithDefaultOldMangling.kt | 32 ++++++++++++ ...mpileKotlinAgainstKotlinTestGenerated.java | 50 +++++++++++++++++++ ...mpileKotlinAgainstKotlinTestGenerated.java | 50 +++++++++++++++++++ .../ir/JvmIrAgainstOldBoxTestGenerated.java | 50 +++++++++++++++++++ .../ir/JvmOldAgainstIrBoxTestGenerated.java | 50 +++++++++++++++++++ 21 files changed, 493 insertions(+), 2 deletions(-) create mode 100644 compiler/testData/compileKotlinAgainstKotlin/callDeserializedPropertyOnInlineClassTypeOldMangling.kt create mode 100644 compiler/testData/compileKotlinAgainstKotlin/constructorWithInlineClassParametersInBinaryDependenciesOldMangling.kt create mode 100644 compiler/testData/compileKotlinAgainstKotlin/defaultWithInlineClassAndReceiversOldMangling.kt create mode 100644 compiler/testData/compileKotlinAgainstKotlin/inlineClassFakeOverrideManglingOldMangling.kt create mode 100644 compiler/testData/compileKotlinAgainstKotlin/inlineClassFromBinaryDependenciesOldMangling.kt create mode 100644 compiler/testData/compileKotlinAgainstKotlin/inlineClassInlineFunctionCallOldMangling.kt create mode 100644 compiler/testData/compileKotlinAgainstKotlin/inlineClassInlinePropertyOldMangling.kt create mode 100644 compiler/testData/compileKotlinAgainstKotlin/privateCompanionObjectValInDifferentModuleOldMangling.kt create mode 100644 compiler/testData/compileKotlinAgainstKotlin/privateTopLevelValInDifferentModuleOldMangling.kt create mode 100644 compiler/testData/compileKotlinAgainstKotlin/suspendFunWithDefaultOldMangling.kt diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/state/KotlinTypeMapper.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/state/KotlinTypeMapper.kt index 6fa8f12fb98..7c2ab8f0614 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/state/KotlinTypeMapper.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/state/KotlinTypeMapper.kt @@ -375,13 +375,27 @@ class KotlinTypeMapper @JvmOverloads constructor( kind: OwnerKind? = null, resolvedCall: ResolvedCall<*>? = null ): CallableMethod { + fun mapDefaultCallback(descriptor: FunctionDescriptor, kind: OwnerKind): () -> Method { + if (useOldManglingRulesForFunctionAcceptingInlineClass && !useOldInlineClassesManglingScheme) { + return { + val prevManglingState = useOldManglingRulesForFunctionAcceptingInlineClass + useOldManglingRulesForFunctionAcceptingInlineClass = true + mapDefaultMethod(descriptor, kind).also { + useOldManglingRulesForFunctionAcceptingInlineClass = prevManglingState + } + } + } else { + return { mapDefaultMethod(descriptor, kind) } + } + } + // we generate constructors of inline classes as usual functions if (descriptor is ConstructorDescriptor && kind != OwnerKind.ERASED_INLINE_CLASS) { val method = mapSignatureSkipGeneric(descriptor.original) val owner = mapOwner(descriptor) val originalDescriptor = descriptor.original return CallableMethod( - owner, owner, { mapDefaultMethod(originalDescriptor, OwnerKind.IMPLEMENTATION) }, method, INVOKESPECIAL, + owner, owner, mapDefaultCallback(originalDescriptor, OwnerKind.IMPLEMENTATION), method, INVOKESPECIAL, null, null, null, null, null, originalDescriptor.returnType, isInterfaceMethod = false, isDefaultMethodInInterface = false, boxInlineClassBeforeInvoke = false ) @@ -557,7 +571,7 @@ class KotlinTypeMapper @JvmOverloads constructor( return CallableMethod( owner, ownerForDefaultImpl, - { mapDefaultMethod(baseMethodDescriptor, getKindForDefaultImplCall(baseMethodDescriptor)) }, + mapDefaultCallback(baseMethodDescriptor, getKindForDefaultImplCall(baseMethodDescriptor)), signature, invokeOpcode, thisClass, dispatchReceiverKotlinType, receiverParameterType, extensionReceiverKotlinType, calleeType, returnKotlinType, if (jvmTarget >= JvmTarget.JVM_1_8) isInterfaceMember else invokeOpcode == INVOKEINTERFACE, diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/FirCompileKotlinAgainstKotlinTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/FirCompileKotlinAgainstKotlinTestGenerated.java index 96f03a929c6..988a42c505a 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/FirCompileKotlinAgainstKotlinTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/FirCompileKotlinAgainstKotlinTestGenerated.java @@ -50,6 +50,11 @@ public class FirCompileKotlinAgainstKotlinTestGenerated extends AbstractFirCompi runTest("compiler/testData/compileKotlinAgainstKotlin/callDeserializedPropertyOnInlineClassType.kt"); } + @TestMetadata("callDeserializedPropertyOnInlineClassTypeOldMangling.kt") + public void testCallDeserializedPropertyOnInlineClassTypeOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/callDeserializedPropertyOnInlineClassTypeOldMangling.kt"); + } + @TestMetadata("callsToMultifileClassFromOtherPackage.kt") public void testCallsToMultifileClassFromOtherPackage() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/callsToMultifileClassFromOtherPackage.kt"); @@ -90,6 +95,11 @@ public class FirCompileKotlinAgainstKotlinTestGenerated extends AbstractFirCompi runTest("compiler/testData/compileKotlinAgainstKotlin/constructorWithInlineClassParametersInBinaryDependencies.kt"); } + @TestMetadata("constructorWithInlineClassParametersInBinaryDependenciesOldMangling.kt") + public void testConstructorWithInlineClassParametersInBinaryDependenciesOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/constructorWithInlineClassParametersInBinaryDependenciesOldMangling.kt"); + } + @TestMetadata("copySamOnInline.kt") public void testCopySamOnInline() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/copySamOnInline.kt"); @@ -125,6 +135,11 @@ public class FirCompileKotlinAgainstKotlinTestGenerated extends AbstractFirCompi runTest("compiler/testData/compileKotlinAgainstKotlin/defaultWithInlineClassAndReceivers.kt"); } + @TestMetadata("defaultWithInlineClassAndReceiversOldMangling.kt") + public void testDefaultWithInlineClassAndReceiversOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/defaultWithInlineClassAndReceiversOldMangling.kt"); + } + @TestMetadata("delegatedDefault.kt") public void testDelegatedDefault() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/delegatedDefault.kt"); @@ -165,21 +180,41 @@ public class FirCompileKotlinAgainstKotlinTestGenerated extends AbstractFirCompi runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassFakeOverrideMangling.kt"); } + @TestMetadata("inlineClassFakeOverrideManglingOldMangling.kt") + public void testInlineClassFakeOverrideManglingOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassFakeOverrideManglingOldMangling.kt"); + } + @TestMetadata("inlineClassFromBinaryDependencies.kt") public void testInlineClassFromBinaryDependencies() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassFromBinaryDependencies.kt"); } + @TestMetadata("inlineClassFromBinaryDependenciesOldMangling.kt") + public void testInlineClassFromBinaryDependenciesOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassFromBinaryDependenciesOldMangling.kt"); + } + @TestMetadata("inlineClassInlineFunctionCall.kt") public void testInlineClassInlineFunctionCall() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassInlineFunctionCall.kt"); } + @TestMetadata("inlineClassInlineFunctionCallOldMangling.kt") + public void testInlineClassInlineFunctionCallOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassInlineFunctionCallOldMangling.kt"); + } + @TestMetadata("inlineClassInlineProperty.kt") public void testInlineClassInlineProperty() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassInlineProperty.kt"); } + @TestMetadata("inlineClassInlinePropertyOldMangling.kt") + public void testInlineClassInlinePropertyOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassInlinePropertyOldMangling.kt"); + } + @TestMetadata("inlineClassesOldMangling.kt") public void testInlineClassesOldMangling() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassesOldMangling.kt"); @@ -355,11 +390,21 @@ public class FirCompileKotlinAgainstKotlinTestGenerated extends AbstractFirCompi runTest("compiler/testData/compileKotlinAgainstKotlin/privateCompanionObjectValInDifferentModule.kt"); } + @TestMetadata("privateCompanionObjectValInDifferentModuleOldMangling.kt") + public void testPrivateCompanionObjectValInDifferentModuleOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/privateCompanionObjectValInDifferentModuleOldMangling.kt"); + } + @TestMetadata("privateTopLevelValInDifferentModule.kt") public void testPrivateTopLevelValInDifferentModule() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/privateTopLevelValInDifferentModule.kt"); } + @TestMetadata("privateTopLevelValInDifferentModuleOldMangling.kt") + public void testPrivateTopLevelValInDifferentModuleOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/privateTopLevelValInDifferentModuleOldMangling.kt"); + } + @TestMetadata("propertyReference.kt") public void testPropertyReference() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/propertyReference.kt"); @@ -410,6 +455,11 @@ public class FirCompileKotlinAgainstKotlinTestGenerated extends AbstractFirCompi runTest("compiler/testData/compileKotlinAgainstKotlin/suspendFunWithDefaultMangling.kt"); } + @TestMetadata("suspendFunWithDefaultOldMangling.kt") + public void testSuspendFunWithDefaultOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/suspendFunWithDefaultOldMangling.kt"); + } + @TestMetadata("targetedJvmName.kt") public void testTargetedJvmName() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/targetedJvmName.kt"); diff --git a/compiler/testData/compileKotlinAgainstKotlin/callDeserializedPropertyOnInlineClassType.kt b/compiler/testData/compileKotlinAgainstKotlin/callDeserializedPropertyOnInlineClassType.kt index b3978712ea0..5006d26bcf9 100644 --- a/compiler/testData/compileKotlinAgainstKotlin/callDeserializedPropertyOnInlineClassType.kt +++ b/compiler/testData/compileKotlinAgainstKotlin/callDeserializedPropertyOnInlineClassType.kt @@ -1,3 +1,4 @@ +// !LANGUAGE: +InlineClasses // FILE: A.kt package a diff --git a/compiler/testData/compileKotlinAgainstKotlin/callDeserializedPropertyOnInlineClassTypeOldMangling.kt b/compiler/testData/compileKotlinAgainstKotlin/callDeserializedPropertyOnInlineClassTypeOldMangling.kt new file mode 100644 index 00000000000..6dd95b4460f --- /dev/null +++ b/compiler/testData/compileKotlinAgainstKotlin/callDeserializedPropertyOnInlineClassTypeOldMangling.kt @@ -0,0 +1,21 @@ +// TARGET_BACKEND: JVM +// !LANGUAGE: +InlineClasses +// FILE: A.kt +// KOTLIN_CONFIGURATION_FLAGS: +JVM.USE_OLD_INLINE_CLASSES_MANGLING_SCHEME + +package a + +@Suppress("UNSUPPORTED_FEATURE") +inline class Foo(val x: IntArray) { + val size: Int get() = x.size +} + +// FILE: B.kt + +import a.* + +fun box(): String { + val a = Foo(intArrayOf(3, 4)) + if (a.size != 2) return "Fail" + return "OK" +} diff --git a/compiler/testData/compileKotlinAgainstKotlin/constructorWithInlineClassParametersInBinaryDependenciesOldMangling.kt b/compiler/testData/compileKotlinAgainstKotlin/constructorWithInlineClassParametersInBinaryDependenciesOldMangling.kt new file mode 100644 index 00000000000..8febf6b7379 --- /dev/null +++ b/compiler/testData/compileKotlinAgainstKotlin/constructorWithInlineClassParametersInBinaryDependenciesOldMangling.kt @@ -0,0 +1,14 @@ +// TARGET_BACKEND: JVM +// !LANGUAGE: +InlineClasses +// FILE: A.kt +// KOTLIN_CONFIGURATION_FLAGS: +JVM.USE_OLD_INLINE_CLASSES_MANGLING_SCHEME +package lib + +inline class S(val string: String) + +class Test(val s: S) + +// FILE: B.kt +import lib.* + +fun box() = Test(S("OK")).s.string \ No newline at end of file diff --git a/compiler/testData/compileKotlinAgainstKotlin/defaultWithInlineClassAndReceiversOldMangling.kt b/compiler/testData/compileKotlinAgainstKotlin/defaultWithInlineClassAndReceiversOldMangling.kt new file mode 100644 index 00000000000..268760734a8 --- /dev/null +++ b/compiler/testData/compileKotlinAgainstKotlin/defaultWithInlineClassAndReceiversOldMangling.kt @@ -0,0 +1,16 @@ +// TARGET_BACKEND: JVM +// !LANGUAGE: +InlineClasses +// FILE: A.kt +// KOTLIN_CONFIGURATION_FLAGS: +JVM.USE_OLD_INLINE_CLASSES_MANGLING_SCHEME +package z + +inline class Z(val s: String) + +class X { + fun Int.foo(z: Z, value: String = "OK") = value +} + +// FILE: B.kt +import z.* + +fun box(): String = with(X()) { 1.foo(Z("")) } diff --git a/compiler/testData/compileKotlinAgainstKotlin/inlineClassFakeOverrideManglingOldMangling.kt b/compiler/testData/compileKotlinAgainstKotlin/inlineClassFakeOverrideManglingOldMangling.kt new file mode 100644 index 00000000000..62905de982b --- /dev/null +++ b/compiler/testData/compileKotlinAgainstKotlin/inlineClassFakeOverrideManglingOldMangling.kt @@ -0,0 +1,23 @@ +// TARGET_BACKEND: JVM +// !LANGUAGE: +InlineClasses +// FILE: 1.kt +// KOTLIN_CONFIGURATION_FLAGS: +JVM.USE_OLD_INLINE_CLASSES_MANGLING_SCHEME + +inline class IC(val s: String) + +abstract class A { + fun foo(s: String) = IC(s) +} + +open class C : A() + +class D: C() + +// FILE: 2.kt + +fun box(): String { + var res = C().foo("OK").s + if (res != "OK") return "FAIL 1 $res" + res = D().foo("OK").s + return res +} diff --git a/compiler/testData/compileKotlinAgainstKotlin/inlineClassFromBinaryDependenciesOldMangling.kt b/compiler/testData/compileKotlinAgainstKotlin/inlineClassFromBinaryDependenciesOldMangling.kt new file mode 100644 index 00000000000..3219146bd33 --- /dev/null +++ b/compiler/testData/compileKotlinAgainstKotlin/inlineClassFromBinaryDependenciesOldMangling.kt @@ -0,0 +1,40 @@ +// TARGET_BACKEND: JVM +// !LANGUAGE: +InlineClasses +// FILE: A.kt +// KOTLIN_CONFIGURATION_FLAGS: +JVM.USE_OLD_INLINE_CLASSES_MANGLING_SCHEME +package z + +interface IFoo { + fun foo(): String +} + +inline class Z(val s: String) : IFoo { + constructor(i: Int) : this(i.toString()) + + override fun foo(): String = s + + fun bar() = s + + inline fun run(lambda: (String) -> T) = lambda(s) + + companion object { + fun z(i: Int) = Z(i) + } +} + +// FILE: B.kt +import z.* + +fun test(z: Z) { + if (z.foo() != "1234") throw AssertionError() + if (z.bar() != "1234") throw AssertionError() + if (z.run { it } != "1234") throw AssertionError() + if (listOf(z)[0].s != "1234") throw AssertionError() +} + +fun box(): String { + test(Z("1234")) + test(Z(1234)) + test(Z.z(1234)) + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/compileKotlinAgainstKotlin/inlineClassInlineFunctionCall.kt b/compiler/testData/compileKotlinAgainstKotlin/inlineClassInlineFunctionCall.kt index d3e0401dfb0..574a2e10e8e 100644 --- a/compiler/testData/compileKotlinAgainstKotlin/inlineClassInlineFunctionCall.kt +++ b/compiler/testData/compileKotlinAgainstKotlin/inlineClassInlineFunctionCall.kt @@ -1,3 +1,4 @@ +// !LANGUAGE: +InlineClasses // FILE: A.kt inline class A(val x: String) { diff --git a/compiler/testData/compileKotlinAgainstKotlin/inlineClassInlineFunctionCallOldMangling.kt b/compiler/testData/compileKotlinAgainstKotlin/inlineClassInlineFunctionCallOldMangling.kt new file mode 100644 index 00000000000..7c91cf4f455 --- /dev/null +++ b/compiler/testData/compileKotlinAgainstKotlin/inlineClassInlineFunctionCallOldMangling.kt @@ -0,0 +1,14 @@ +// TARGET_BACKEND: JVM +// !LANGUAGE: +InlineClasses +// FILE: A.kt +// KOTLIN_CONFIGURATION_FLAGS: +JVM.USE_OLD_INLINE_CLASSES_MANGLING_SCHEME + +inline class A(val x: String) { + inline fun f(other: A): A = other +} + +// FILE: B.kt + +fun box(): String { + return A("Fail").f(A("OK")).x +} diff --git a/compiler/testData/compileKotlinAgainstKotlin/inlineClassInlinePropertyOldMangling.kt b/compiler/testData/compileKotlinAgainstKotlin/inlineClassInlinePropertyOldMangling.kt new file mode 100644 index 00000000000..83e528e9ae1 --- /dev/null +++ b/compiler/testData/compileKotlinAgainstKotlin/inlineClassInlinePropertyOldMangling.kt @@ -0,0 +1,17 @@ +// TARGET_BACKEND: JVM +// !LANGUAGE: +InlineClasses +// FILE: A.kt +// KOTLIN_CONFIGURATION_FLAGS: +JVM.USE_OLD_INLINE_CLASSES_MANGLING_SCHEME + +package a + +inline class S(val value: String) { + inline val k: String + get() = value + "K" +} + +// FILE: B.kt + +fun box(): String { + return a.S("O").k +} diff --git a/compiler/testData/compileKotlinAgainstKotlin/privateCompanionObjectValInDifferentModule.kt b/compiler/testData/compileKotlinAgainstKotlin/privateCompanionObjectValInDifferentModule.kt index 2af4f51aa26..605479aee50 100644 --- a/compiler/testData/compileKotlinAgainstKotlin/privateCompanionObjectValInDifferentModule.kt +++ b/compiler/testData/compileKotlinAgainstKotlin/privateCompanionObjectValInDifferentModule.kt @@ -1,3 +1,4 @@ +// !LANGUAGE: +InlineClasses // IGNORE_BACKEND: JS_IR, JS, NATIVE // WITH_REFLECT diff --git a/compiler/testData/compileKotlinAgainstKotlin/privateCompanionObjectValInDifferentModuleOldMangling.kt b/compiler/testData/compileKotlinAgainstKotlin/privateCompanionObjectValInDifferentModuleOldMangling.kt new file mode 100644 index 00000000000..221f80cde62 --- /dev/null +++ b/compiler/testData/compileKotlinAgainstKotlin/privateCompanionObjectValInDifferentModuleOldMangling.kt @@ -0,0 +1,24 @@ +// TARGET_BACKEND: JVM +// !LANGUAGE: +InlineClasses +// IGNORE_BACKEND: JS_IR, JS, NATIVE +// WITH_REFLECT + +// FILE: A.kt +// KOTLIN_CONFIGURATION_FLAGS: +JVM.USE_OLD_INLINE_CLASSES_MANGLING_SCHEME +package a + +import kotlin.reflect.jvm.isAccessible + +inline class S(val s: String) + +class Host { + companion object { + private val ok = S("OK") + val ref = ::ok.apply { isAccessible = true } + } +} + +// FILE: B.kt +import a.* + +fun box() = Host.ref.call().s diff --git a/compiler/testData/compileKotlinAgainstKotlin/privateTopLevelValInDifferentModule.kt b/compiler/testData/compileKotlinAgainstKotlin/privateTopLevelValInDifferentModule.kt index 5a94a29901e..3b2fdc6c24d 100644 --- a/compiler/testData/compileKotlinAgainstKotlin/privateTopLevelValInDifferentModule.kt +++ b/compiler/testData/compileKotlinAgainstKotlin/privateTopLevelValInDifferentModule.kt @@ -1,3 +1,4 @@ +// !LANGUAGE: +InlineClasses // IGNORE_BACKEND: JS_IR, JS, NATIVE // WITH_REFLECT diff --git a/compiler/testData/compileKotlinAgainstKotlin/privateTopLevelValInDifferentModuleOldMangling.kt b/compiler/testData/compileKotlinAgainstKotlin/privateTopLevelValInDifferentModuleOldMangling.kt new file mode 100644 index 00000000000..0479520d631 --- /dev/null +++ b/compiler/testData/compileKotlinAgainstKotlin/privateTopLevelValInDifferentModuleOldMangling.kt @@ -0,0 +1,21 @@ +// TARGET_BACKEND: JVM +// !LANGUAGE: +InlineClasses +// IGNORE_BACKEND: JS_IR, JS, NATIVE +// WITH_REFLECT + +// FILE: A.kt +// KOTLIN_CONFIGURATION_FLAGS: +JVM.USE_OLD_INLINE_CLASSES_MANGLING_SCHEME +package a + +import kotlin.reflect.jvm.isAccessible + +inline class S(val s: String) + +private val ok = S("OK") + +val ref = ::ok.apply { isAccessible = true } + +// FILE: B.kt +import a.* + +fun box() = ref.call().s \ No newline at end of file diff --git a/compiler/testData/compileKotlinAgainstKotlin/suspendFunWithDefaultMangling.kt b/compiler/testData/compileKotlinAgainstKotlin/suspendFunWithDefaultMangling.kt index 234a30603b5..7906f56bf27 100644 --- a/compiler/testData/compileKotlinAgainstKotlin/suspendFunWithDefaultMangling.kt +++ b/compiler/testData/compileKotlinAgainstKotlin/suspendFunWithDefaultMangling.kt @@ -1,3 +1,4 @@ +// !LANGUAGE: +InlineClasses // WITH_COROUTINES // FILE: a.kt diff --git a/compiler/testData/compileKotlinAgainstKotlin/suspendFunWithDefaultOldMangling.kt b/compiler/testData/compileKotlinAgainstKotlin/suspendFunWithDefaultOldMangling.kt new file mode 100644 index 00000000000..03d1e7e49b9 --- /dev/null +++ b/compiler/testData/compileKotlinAgainstKotlin/suspendFunWithDefaultOldMangling.kt @@ -0,0 +1,32 @@ +// TARGET_BACKEND: JVM +// !LANGUAGE: +InlineClasses +// WITH_COROUTINES +// FILE: a.kt +// KOTLIN_CONFIGURATION_FLAGS: +JVM.USE_OLD_INLINE_CLASSES_MANGLING_SCHEME + +package a + +var result = "" + +inline class P(val value: String) + +suspend fun foo(p: P = P("OK")) { + result = p.value +} + +// FILE: b.kt + +import kotlin.coroutines.* +import helpers.* +import a.* + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(EmptyContinuation) +} + +fun box(): String { + builder { + foo() + } + return result +} diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/CompileKotlinAgainstKotlinTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/CompileKotlinAgainstKotlinTestGenerated.java index e940b1e4e08..3bec557cb3f 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/CompileKotlinAgainstKotlinTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/CompileKotlinAgainstKotlinTestGenerated.java @@ -49,6 +49,11 @@ public class CompileKotlinAgainstKotlinTestGenerated extends AbstractCompileKotl runTest("compiler/testData/compileKotlinAgainstKotlin/callDeserializedPropertyOnInlineClassType.kt"); } + @TestMetadata("callDeserializedPropertyOnInlineClassTypeOldMangling.kt") + public void testCallDeserializedPropertyOnInlineClassTypeOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/callDeserializedPropertyOnInlineClassTypeOldMangling.kt"); + } + @TestMetadata("callsToMultifileClassFromOtherPackage.kt") public void testCallsToMultifileClassFromOtherPackage() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/callsToMultifileClassFromOtherPackage.kt"); @@ -89,6 +94,11 @@ public class CompileKotlinAgainstKotlinTestGenerated extends AbstractCompileKotl runTest("compiler/testData/compileKotlinAgainstKotlin/constructorWithInlineClassParametersInBinaryDependencies.kt"); } + @TestMetadata("constructorWithInlineClassParametersInBinaryDependenciesOldMangling.kt") + public void testConstructorWithInlineClassParametersInBinaryDependenciesOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/constructorWithInlineClassParametersInBinaryDependenciesOldMangling.kt"); + } + @TestMetadata("copySamOnInline.kt") public void testCopySamOnInline() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/copySamOnInline.kt"); @@ -124,6 +134,11 @@ public class CompileKotlinAgainstKotlinTestGenerated extends AbstractCompileKotl runTest("compiler/testData/compileKotlinAgainstKotlin/defaultWithInlineClassAndReceivers.kt"); } + @TestMetadata("defaultWithInlineClassAndReceiversOldMangling.kt") + public void testDefaultWithInlineClassAndReceiversOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/defaultWithInlineClassAndReceiversOldMangling.kt"); + } + @TestMetadata("delegatedDefault.kt") public void testDelegatedDefault() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/delegatedDefault.kt"); @@ -164,21 +179,41 @@ public class CompileKotlinAgainstKotlinTestGenerated extends AbstractCompileKotl runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassFakeOverrideMangling.kt"); } + @TestMetadata("inlineClassFakeOverrideManglingOldMangling.kt") + public void testInlineClassFakeOverrideManglingOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassFakeOverrideManglingOldMangling.kt"); + } + @TestMetadata("inlineClassFromBinaryDependencies.kt") public void testInlineClassFromBinaryDependencies() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassFromBinaryDependencies.kt"); } + @TestMetadata("inlineClassFromBinaryDependenciesOldMangling.kt") + public void testInlineClassFromBinaryDependenciesOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassFromBinaryDependenciesOldMangling.kt"); + } + @TestMetadata("inlineClassInlineFunctionCall.kt") public void testInlineClassInlineFunctionCall() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassInlineFunctionCall.kt"); } + @TestMetadata("inlineClassInlineFunctionCallOldMangling.kt") + public void testInlineClassInlineFunctionCallOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassInlineFunctionCallOldMangling.kt"); + } + @TestMetadata("inlineClassInlineProperty.kt") public void testInlineClassInlineProperty() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassInlineProperty.kt"); } + @TestMetadata("inlineClassInlinePropertyOldMangling.kt") + public void testInlineClassInlinePropertyOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassInlinePropertyOldMangling.kt"); + } + @TestMetadata("inlineClassesOldMangling.kt") public void testInlineClassesOldMangling() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassesOldMangling.kt"); @@ -354,11 +389,21 @@ public class CompileKotlinAgainstKotlinTestGenerated extends AbstractCompileKotl runTest("compiler/testData/compileKotlinAgainstKotlin/privateCompanionObjectValInDifferentModule.kt"); } + @TestMetadata("privateCompanionObjectValInDifferentModuleOldMangling.kt") + public void testPrivateCompanionObjectValInDifferentModuleOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/privateCompanionObjectValInDifferentModuleOldMangling.kt"); + } + @TestMetadata("privateTopLevelValInDifferentModule.kt") public void testPrivateTopLevelValInDifferentModule() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/privateTopLevelValInDifferentModule.kt"); } + @TestMetadata("privateTopLevelValInDifferentModuleOldMangling.kt") + public void testPrivateTopLevelValInDifferentModuleOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/privateTopLevelValInDifferentModuleOldMangling.kt"); + } + @TestMetadata("propertyReference.kt") public void testPropertyReference() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/propertyReference.kt"); @@ -409,6 +454,11 @@ public class CompileKotlinAgainstKotlinTestGenerated extends AbstractCompileKotl runTest("compiler/testData/compileKotlinAgainstKotlin/suspendFunWithDefaultMangling.kt"); } + @TestMetadata("suspendFunWithDefaultOldMangling.kt") + public void testSuspendFunWithDefaultOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/suspendFunWithDefaultOldMangling.kt"); + } + @TestMetadata("targetedJvmName.kt") public void testTargetedJvmName() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/targetedJvmName.kt"); diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstKotlinTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstKotlinTestGenerated.java index b5eb98e6ded..17a233ad471 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstKotlinTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstKotlinTestGenerated.java @@ -50,6 +50,11 @@ public class IrCompileKotlinAgainstKotlinTestGenerated extends AbstractIrCompile runTest("compiler/testData/compileKotlinAgainstKotlin/callDeserializedPropertyOnInlineClassType.kt"); } + @TestMetadata("callDeserializedPropertyOnInlineClassTypeOldMangling.kt") + public void testCallDeserializedPropertyOnInlineClassTypeOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/callDeserializedPropertyOnInlineClassTypeOldMangling.kt"); + } + @TestMetadata("callsToMultifileClassFromOtherPackage.kt") public void testCallsToMultifileClassFromOtherPackage() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/callsToMultifileClassFromOtherPackage.kt"); @@ -90,6 +95,11 @@ public class IrCompileKotlinAgainstKotlinTestGenerated extends AbstractIrCompile runTest("compiler/testData/compileKotlinAgainstKotlin/constructorWithInlineClassParametersInBinaryDependencies.kt"); } + @TestMetadata("constructorWithInlineClassParametersInBinaryDependenciesOldMangling.kt") + public void testConstructorWithInlineClassParametersInBinaryDependenciesOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/constructorWithInlineClassParametersInBinaryDependenciesOldMangling.kt"); + } + @TestMetadata("copySamOnInline.kt") public void testCopySamOnInline() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/copySamOnInline.kt"); @@ -125,6 +135,11 @@ public class IrCompileKotlinAgainstKotlinTestGenerated extends AbstractIrCompile runTest("compiler/testData/compileKotlinAgainstKotlin/defaultWithInlineClassAndReceivers.kt"); } + @TestMetadata("defaultWithInlineClassAndReceiversOldMangling.kt") + public void testDefaultWithInlineClassAndReceiversOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/defaultWithInlineClassAndReceiversOldMangling.kt"); + } + @TestMetadata("delegatedDefault.kt") public void testDelegatedDefault() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/delegatedDefault.kt"); @@ -165,21 +180,41 @@ public class IrCompileKotlinAgainstKotlinTestGenerated extends AbstractIrCompile runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassFakeOverrideMangling.kt"); } + @TestMetadata("inlineClassFakeOverrideManglingOldMangling.kt") + public void testInlineClassFakeOverrideManglingOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassFakeOverrideManglingOldMangling.kt"); + } + @TestMetadata("inlineClassFromBinaryDependencies.kt") public void testInlineClassFromBinaryDependencies() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassFromBinaryDependencies.kt"); } + @TestMetadata("inlineClassFromBinaryDependenciesOldMangling.kt") + public void testInlineClassFromBinaryDependenciesOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassFromBinaryDependenciesOldMangling.kt"); + } + @TestMetadata("inlineClassInlineFunctionCall.kt") public void testInlineClassInlineFunctionCall() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassInlineFunctionCall.kt"); } + @TestMetadata("inlineClassInlineFunctionCallOldMangling.kt") + public void testInlineClassInlineFunctionCallOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassInlineFunctionCallOldMangling.kt"); + } + @TestMetadata("inlineClassInlineProperty.kt") public void testInlineClassInlineProperty() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassInlineProperty.kt"); } + @TestMetadata("inlineClassInlinePropertyOldMangling.kt") + public void testInlineClassInlinePropertyOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassInlinePropertyOldMangling.kt"); + } + @TestMetadata("inlineClassesOldMangling.kt") public void testInlineClassesOldMangling() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassesOldMangling.kt"); @@ -355,11 +390,21 @@ public class IrCompileKotlinAgainstKotlinTestGenerated extends AbstractIrCompile runTest("compiler/testData/compileKotlinAgainstKotlin/privateCompanionObjectValInDifferentModule.kt"); } + @TestMetadata("privateCompanionObjectValInDifferentModuleOldMangling.kt") + public void testPrivateCompanionObjectValInDifferentModuleOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/privateCompanionObjectValInDifferentModuleOldMangling.kt"); + } + @TestMetadata("privateTopLevelValInDifferentModule.kt") public void testPrivateTopLevelValInDifferentModule() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/privateTopLevelValInDifferentModule.kt"); } + @TestMetadata("privateTopLevelValInDifferentModuleOldMangling.kt") + public void testPrivateTopLevelValInDifferentModuleOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/privateTopLevelValInDifferentModuleOldMangling.kt"); + } + @TestMetadata("propertyReference.kt") public void testPropertyReference() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/propertyReference.kt"); @@ -410,6 +455,11 @@ public class IrCompileKotlinAgainstKotlinTestGenerated extends AbstractIrCompile runTest("compiler/testData/compileKotlinAgainstKotlin/suspendFunWithDefaultMangling.kt"); } + @TestMetadata("suspendFunWithDefaultOldMangling.kt") + public void testSuspendFunWithDefaultOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/suspendFunWithDefaultOldMangling.kt"); + } + @TestMetadata("targetedJvmName.kt") public void testTargetedJvmName() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/targetedJvmName.kt"); diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmIrAgainstOldBoxTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmIrAgainstOldBoxTestGenerated.java index 8c271d82a35..6ca89dbf251 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmIrAgainstOldBoxTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmIrAgainstOldBoxTestGenerated.java @@ -50,6 +50,11 @@ public class JvmIrAgainstOldBoxTestGenerated extends AbstractJvmIrAgainstOldBoxT runTest("compiler/testData/compileKotlinAgainstKotlin/callDeserializedPropertyOnInlineClassType.kt"); } + @TestMetadata("callDeserializedPropertyOnInlineClassTypeOldMangling.kt") + public void testCallDeserializedPropertyOnInlineClassTypeOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/callDeserializedPropertyOnInlineClassTypeOldMangling.kt"); + } + @TestMetadata("callsToMultifileClassFromOtherPackage.kt") public void testCallsToMultifileClassFromOtherPackage() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/callsToMultifileClassFromOtherPackage.kt"); @@ -90,6 +95,11 @@ public class JvmIrAgainstOldBoxTestGenerated extends AbstractJvmIrAgainstOldBoxT runTest("compiler/testData/compileKotlinAgainstKotlin/constructorWithInlineClassParametersInBinaryDependencies.kt"); } + @TestMetadata("constructorWithInlineClassParametersInBinaryDependenciesOldMangling.kt") + public void testConstructorWithInlineClassParametersInBinaryDependenciesOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/constructorWithInlineClassParametersInBinaryDependenciesOldMangling.kt"); + } + @TestMetadata("copySamOnInline.kt") public void testCopySamOnInline() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/copySamOnInline.kt"); @@ -125,6 +135,11 @@ public class JvmIrAgainstOldBoxTestGenerated extends AbstractJvmIrAgainstOldBoxT runTest("compiler/testData/compileKotlinAgainstKotlin/defaultWithInlineClassAndReceivers.kt"); } + @TestMetadata("defaultWithInlineClassAndReceiversOldMangling.kt") + public void testDefaultWithInlineClassAndReceiversOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/defaultWithInlineClassAndReceiversOldMangling.kt"); + } + @TestMetadata("delegatedDefault.kt") public void testDelegatedDefault() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/delegatedDefault.kt"); @@ -165,21 +180,41 @@ public class JvmIrAgainstOldBoxTestGenerated extends AbstractJvmIrAgainstOldBoxT runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassFakeOverrideMangling.kt"); } + @TestMetadata("inlineClassFakeOverrideManglingOldMangling.kt") + public void testInlineClassFakeOverrideManglingOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassFakeOverrideManglingOldMangling.kt"); + } + @TestMetadata("inlineClassFromBinaryDependencies.kt") public void testInlineClassFromBinaryDependencies() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassFromBinaryDependencies.kt"); } + @TestMetadata("inlineClassFromBinaryDependenciesOldMangling.kt") + public void testInlineClassFromBinaryDependenciesOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassFromBinaryDependenciesOldMangling.kt"); + } + @TestMetadata("inlineClassInlineFunctionCall.kt") public void testInlineClassInlineFunctionCall() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassInlineFunctionCall.kt"); } + @TestMetadata("inlineClassInlineFunctionCallOldMangling.kt") + public void testInlineClassInlineFunctionCallOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassInlineFunctionCallOldMangling.kt"); + } + @TestMetadata("inlineClassInlineProperty.kt") public void testInlineClassInlineProperty() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassInlineProperty.kt"); } + @TestMetadata("inlineClassInlinePropertyOldMangling.kt") + public void testInlineClassInlinePropertyOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassInlinePropertyOldMangling.kt"); + } + @TestMetadata("inlineClassesOldMangling.kt") public void testInlineClassesOldMangling() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassesOldMangling.kt"); @@ -355,11 +390,21 @@ public class JvmIrAgainstOldBoxTestGenerated extends AbstractJvmIrAgainstOldBoxT runTest("compiler/testData/compileKotlinAgainstKotlin/privateCompanionObjectValInDifferentModule.kt"); } + @TestMetadata("privateCompanionObjectValInDifferentModuleOldMangling.kt") + public void testPrivateCompanionObjectValInDifferentModuleOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/privateCompanionObjectValInDifferentModuleOldMangling.kt"); + } + @TestMetadata("privateTopLevelValInDifferentModule.kt") public void testPrivateTopLevelValInDifferentModule() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/privateTopLevelValInDifferentModule.kt"); } + @TestMetadata("privateTopLevelValInDifferentModuleOldMangling.kt") + public void testPrivateTopLevelValInDifferentModuleOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/privateTopLevelValInDifferentModuleOldMangling.kt"); + } + @TestMetadata("propertyReference.kt") public void testPropertyReference() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/propertyReference.kt"); @@ -410,6 +455,11 @@ public class JvmIrAgainstOldBoxTestGenerated extends AbstractJvmIrAgainstOldBoxT runTest("compiler/testData/compileKotlinAgainstKotlin/suspendFunWithDefaultMangling.kt"); } + @TestMetadata("suspendFunWithDefaultOldMangling.kt") + public void testSuspendFunWithDefaultOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/suspendFunWithDefaultOldMangling.kt"); + } + @TestMetadata("targetedJvmName.kt") public void testTargetedJvmName() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/targetedJvmName.kt"); diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmOldAgainstIrBoxTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmOldAgainstIrBoxTestGenerated.java index 372a0b84881..301c57aee00 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmOldAgainstIrBoxTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmOldAgainstIrBoxTestGenerated.java @@ -50,6 +50,11 @@ public class JvmOldAgainstIrBoxTestGenerated extends AbstractJvmOldAgainstIrBoxT runTest("compiler/testData/compileKotlinAgainstKotlin/callDeserializedPropertyOnInlineClassType.kt"); } + @TestMetadata("callDeserializedPropertyOnInlineClassTypeOldMangling.kt") + public void testCallDeserializedPropertyOnInlineClassTypeOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/callDeserializedPropertyOnInlineClassTypeOldMangling.kt"); + } + @TestMetadata("callsToMultifileClassFromOtherPackage.kt") public void testCallsToMultifileClassFromOtherPackage() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/callsToMultifileClassFromOtherPackage.kt"); @@ -90,6 +95,11 @@ public class JvmOldAgainstIrBoxTestGenerated extends AbstractJvmOldAgainstIrBoxT runTest("compiler/testData/compileKotlinAgainstKotlin/constructorWithInlineClassParametersInBinaryDependencies.kt"); } + @TestMetadata("constructorWithInlineClassParametersInBinaryDependenciesOldMangling.kt") + public void testConstructorWithInlineClassParametersInBinaryDependenciesOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/constructorWithInlineClassParametersInBinaryDependenciesOldMangling.kt"); + } + @TestMetadata("copySamOnInline.kt") public void testCopySamOnInline() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/copySamOnInline.kt"); @@ -125,6 +135,11 @@ public class JvmOldAgainstIrBoxTestGenerated extends AbstractJvmOldAgainstIrBoxT runTest("compiler/testData/compileKotlinAgainstKotlin/defaultWithInlineClassAndReceivers.kt"); } + @TestMetadata("defaultWithInlineClassAndReceiversOldMangling.kt") + public void testDefaultWithInlineClassAndReceiversOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/defaultWithInlineClassAndReceiversOldMangling.kt"); + } + @TestMetadata("delegatedDefault.kt") public void testDelegatedDefault() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/delegatedDefault.kt"); @@ -165,21 +180,41 @@ public class JvmOldAgainstIrBoxTestGenerated extends AbstractJvmOldAgainstIrBoxT runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassFakeOverrideMangling.kt"); } + @TestMetadata("inlineClassFakeOverrideManglingOldMangling.kt") + public void testInlineClassFakeOverrideManglingOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassFakeOverrideManglingOldMangling.kt"); + } + @TestMetadata("inlineClassFromBinaryDependencies.kt") public void testInlineClassFromBinaryDependencies() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassFromBinaryDependencies.kt"); } + @TestMetadata("inlineClassFromBinaryDependenciesOldMangling.kt") + public void testInlineClassFromBinaryDependenciesOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassFromBinaryDependenciesOldMangling.kt"); + } + @TestMetadata("inlineClassInlineFunctionCall.kt") public void testInlineClassInlineFunctionCall() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassInlineFunctionCall.kt"); } + @TestMetadata("inlineClassInlineFunctionCallOldMangling.kt") + public void testInlineClassInlineFunctionCallOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassInlineFunctionCallOldMangling.kt"); + } + @TestMetadata("inlineClassInlineProperty.kt") public void testInlineClassInlineProperty() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassInlineProperty.kt"); } + @TestMetadata("inlineClassInlinePropertyOldMangling.kt") + public void testInlineClassInlinePropertyOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassInlinePropertyOldMangling.kt"); + } + @TestMetadata("inlineClassesOldMangling.kt") public void testInlineClassesOldMangling() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/inlineClassesOldMangling.kt"); @@ -355,11 +390,21 @@ public class JvmOldAgainstIrBoxTestGenerated extends AbstractJvmOldAgainstIrBoxT runTest("compiler/testData/compileKotlinAgainstKotlin/privateCompanionObjectValInDifferentModule.kt"); } + @TestMetadata("privateCompanionObjectValInDifferentModuleOldMangling.kt") + public void testPrivateCompanionObjectValInDifferentModuleOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/privateCompanionObjectValInDifferentModuleOldMangling.kt"); + } + @TestMetadata("privateTopLevelValInDifferentModule.kt") public void testPrivateTopLevelValInDifferentModule() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/privateTopLevelValInDifferentModule.kt"); } + @TestMetadata("privateTopLevelValInDifferentModuleOldMangling.kt") + public void testPrivateTopLevelValInDifferentModuleOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/privateTopLevelValInDifferentModuleOldMangling.kt"); + } + @TestMetadata("propertyReference.kt") public void testPropertyReference() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/propertyReference.kt"); @@ -410,6 +455,11 @@ public class JvmOldAgainstIrBoxTestGenerated extends AbstractJvmOldAgainstIrBoxT runTest("compiler/testData/compileKotlinAgainstKotlin/suspendFunWithDefaultMangling.kt"); } + @TestMetadata("suspendFunWithDefaultOldMangling.kt") + public void testSuspendFunWithDefaultOldMangling() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/suspendFunWithDefaultOldMangling.kt"); + } + @TestMetadata("targetedJvmName.kt") public void testTargetedJvmName() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/targetedJvmName.kt"); From 3b0f4f31641273fd04d7cafef16ad9dc3bb5d162 Mon Sep 17 00:00:00 2001 From: Sergey Igushkin Date: Mon, 25 Jan 2021 22:51:42 +0300 Subject: [PATCH 029/212] Set canBeConsumed = false on the deprecated configurations like compile This leads to clearer error messages in Gradle variant-aware dependency resolution failures. Gradle has deprecated those configurations since long ago, and we didn't see much use of them as variant-aware dependency resolution entities either. So this commits sets `canBeConsumed` to false on these configuratons: * compile (+ testCompile, fooCompile in MPP) * runtime (+ testRuntime, fooRuntime, ...) * compileOnly (+ testCompileOnly, fooCompileOnly, ...) This change replaces the PR #3995 --- .../jetbrains/kotlin/gradle/plugin/KotlinTargetConfigurator.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/KotlinTargetConfigurator.kt b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/KotlinTargetConfigurator.kt index 619e39f4274..4373f0ac20d 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/KotlinTargetConfigurator.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/KotlinTargetConfigurator.kt @@ -272,6 +272,7 @@ abstract class AbstractKotlinTargetConfigurator val configurations = target.project.configurations val compileConfiguration = configurations.maybeCreate(compilation.deprecatedCompileConfigurationName).apply { + isCanBeConsumed = false setupAsLocalTargetSpecificConfigurationIfSupported(target) isVisible = false isCanBeResolved = true // Needed for IDE import @@ -295,6 +296,7 @@ abstract class AbstractKotlinTargetConfigurator } val compileOnlyConfiguration = configurations.maybeCreate(compilation.compileOnlyConfigurationName).apply { + isCanBeConsumed = false setupAsLocalTargetSpecificConfigurationIfSupported(target) isVisible = false isCanBeResolved = true // Needed for IDE import @@ -312,6 +314,7 @@ abstract class AbstractKotlinTargetConfigurator if (compilation is KotlinCompilationToRunnableFiles) { val runtimeConfiguration = configurations.maybeCreate(compilation.deprecatedRuntimeConfigurationName).apply { + isCanBeConsumed = false setupAsLocalTargetSpecificConfigurationIfSupported(target) extendsFrom(compileConfiguration) isVisible = false From d4965b1e6e2f76a09e2a3104a0f40341d5ec0484 Mon Sep 17 00:00:00 2001 From: Bingran Date: Mon, 25 Jan 2021 20:00:12 +0000 Subject: [PATCH 030/212] Avoid resolving deprecated configurations in tests (#3970) * Avoid resolving deprecated configurations in tests This PR enables more integration tests run with warning-mode=fail by updating "resolveAllConfigurations" task in a way where we don't resolve deprecated configurations and instead check dependencies on alternative configurations. * Add custom resolvable configuration for testing --- .../kotlin/gradle/KotlinGradlePluginIT.kt | 2 +- .../kotlin/gradle/NewMultiplatformIT.kt | 16 +++-- .../gradle/VariantAwareDependenciesIT.kt | 63 ++++++++++--------- .../util/testResolveAllConfigurations.kt | 43 ++++++++++--- 4 files changed, 76 insertions(+), 48 deletions(-) diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/KotlinGradlePluginIT.kt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/KotlinGradlePluginIT.kt index b33ef668bd3..52152745c0e 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/KotlinGradlePluginIT.kt +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/KotlinGradlePluginIT.kt @@ -776,7 +776,7 @@ class KotlinGradleIT : BaseGradleIT() { setupWorkingDir() // Add a dependency with an explicit lower Kotlin version that has a kotlin-stdlib transitive dependency: gradleBuildScript().appendText("\ndependencies { implementation 'org.jetbrains.kotlin:kotlin-reflect:1.2.71' }") - testResolveAllConfigurations(options = defaultBuildOptions().copy(warningMode = WarningMode.Summary)) { + testResolveAllConfigurations { assertSuccessful() assertContains(">> :compileClasspath --> kotlin-reflect-1.2.71.jar") // Check that the default newer Kotlin version still wins for 'kotlin-stdlib': diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/NewMultiplatformIT.kt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/NewMultiplatformIT.kt index 83dec6bfea6..169c996a960 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/NewMultiplatformIT.kt +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/NewMultiplatformIT.kt @@ -1368,14 +1368,12 @@ class NewMultiplatformIT : BaseGradleIT() { fun testDependenciesDsl() = with(transformProjectWithPluginsDsl("newMppDependenciesDsl")) { val originalBuildscriptContent = gradleBuildScript("app").readText() - fun testDependencies() = - testResolveAllConfigurations("app", options = defaultBuildOptions().copy(warningMode = WarningMode.Summary)) { - assertContains(">> :app:testNonTransitiveStringNotationApiDependenciesMetadata --> junit-4.12.jar") - assertEquals( - 1, - (Regex.escape(">> :app:testNonTransitiveStringNotationApiDependenciesMetadata") + " .*").toRegex().findAll(output) - .count() - ) + fun testDependencies() = testResolveAllConfigurations("app") { + assertContains(">> :app:testNonTransitiveStringNotationApiDependenciesMetadata --> junit-4.12.jar") + assertEquals( + 1, + (Regex.escape(">> :app:testNonTransitiveStringNotationApiDependenciesMetadata") + " .*").toRegex().findAll(output).count() + ) assertContains(">> :app:testNonTransitiveDependencyNotationApiDependenciesMetadata --> kotlin-reflect-${defaultBuildOptions().kotlinVersion}.jar") assertEquals( @@ -1405,7 +1403,7 @@ class NewMultiplatformIT : BaseGradleIT() { @Test fun testMultipleTargetsSamePlatform() = with(Project("newMppMultipleTargetsSamePlatform", gradleVersion)) { - testResolveAllConfigurations("app", options = defaultBuildOptions().copy(warningMode = WarningMode.Summary)) { + testResolveAllConfigurations("app") { assertContains(">> :app:junitCompileClasspath --> lib-junit.jar") assertContains(">> :app:junitCompileClasspath --> junit-4.12.jar") diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/VariantAwareDependenciesIT.kt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/VariantAwareDependenciesIT.kt index 159771ba539..41087ec50a3 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/VariantAwareDependenciesIT.kt +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/VariantAwareDependenciesIT.kt @@ -14,10 +14,6 @@ import kotlin.test.assertTrue class VariantAwareDependenciesIT : BaseGradleIT() { private val gradleVersion = GradleVersionRequired.FOR_MPP_SUPPORT - override fun defaultBuildOptions(): BuildOptions { - return super.defaultBuildOptions().copy(warningMode = WarningMode.Summary) - } - @Test fun testJvmKtAppResolvesMppLib() { val outerProject = Project("sample-lib", gradleVersion, "new-mpp-lib-and-app") @@ -25,10 +21,9 @@ class VariantAwareDependenciesIT : BaseGradleIT() { with(outerProject) { embedProject(innerProject) - gradleBuildScript(innerProject.projectName).appendText("\ndependencies { compile rootProject }") - + gradleBuildScript(innerProject.projectName).appendText("\ndependencies { implementation rootProject }") testResolveAllConfigurations(innerProject.projectName) { - assertContains(">> :${innerProject.projectName}:runtime --> sample-lib-jvm6-1.0.jar") + assertContains(">> :${innerProject.projectName}:runtimeClasspath --> sample-lib-jvm6-1.0.jar") } } } @@ -40,21 +35,23 @@ class VariantAwareDependenciesIT : BaseGradleIT() { with(outerProject) { embedProject(innerProject) - gradleBuildScript(innerProject.projectName).appendText("\nrepositories { jcenter() }; dependencies { compile rootProject }") + gradleBuildScript(innerProject.projectName).appendText("\nrepositories { jcenter() }; dependencies { implementation rootProject }") testResolveAllConfigurations( - subproject = innerProject.projectName + subproject = innerProject.projectName, + options = defaultBuildOptions().copy(warningMode = WarningMode.Summary) ) { - assertContains(">> :${innerProject.projectName}:runtime --> sample-lib-nodejs-1.0.jar") + assertContains(">> :${innerProject.projectName}:runtimeClasspath --> sample-lib-nodejs-1.0.jar") } gradleProperties().appendText(jsCompilerType(KotlinJsCompilerType.IR)) testResolveAllConfigurations( subproject = innerProject.projectName, - skipSetup = true + skipSetup = true, + options = defaultBuildOptions().copy(warningMode = WarningMode.Summary) ) { - assertContains(">> :${innerProject.projectName}:runtime --> sample-lib-nodejs-1.0.klib") + assertContains(">> :${innerProject.projectName}:runtimeClasspath --> sample-lib-nodejs-1.0.klib") } } } @@ -81,7 +78,7 @@ class VariantAwareDependenciesIT : BaseGradleIT() { embedProject(innerProject) gradleBuildScript().appendText("\ndependencies { nodeJsMainImplementation project(':${innerProject.projectName}') }") - testResolveAllConfigurations(innerProject.projectName) + testResolveAllConfigurations(innerProject.projectName, options = defaultBuildOptions().copy(warningMode = WarningMode.Summary)) } } @@ -110,7 +107,7 @@ class VariantAwareDependenciesIT : BaseGradleIT() { with(outerProject) { embedProject(innerProject) - gradleBuildScript(innerProject.projectName).appendText("\ndependencies { compile rootProject }") + gradleBuildScript(innerProject.projectName).appendText("\ndependencies { implementation rootProject }") testResolveAllConfigurations(innerProject.projectName) } @@ -123,7 +120,7 @@ class VariantAwareDependenciesIT : BaseGradleIT() { with(outerProject) { embedProject(innerProject) - gradleBuildScript(innerProject.projectName).appendText("\ndependencies { compile rootProject }") + gradleBuildScript(innerProject.projectName).appendText("\ndependencies { implementation rootProject }") testResolveAllConfigurations(innerProject.projectName) } @@ -136,7 +133,7 @@ class VariantAwareDependenciesIT : BaseGradleIT() { with(outerProject) { embedProject(innerProject) - gradleBuildScript(innerProject.projectName).appendText("\ndependencies { compile rootProject }") + gradleBuildScript(innerProject.projectName).appendText("\ndependencies { implementation rootProject }") gradleBuildScript(innerProject.projectName).appendText( // Newer Gradle versions fail to resolve the deprecated configurations because of variant-aware resolution ambiguity between @@ -150,7 +147,7 @@ class VariantAwareDependenciesIT : BaseGradleIT() { """.trimIndent() ) - testResolveAllConfigurations(innerProject.projectName) + testResolveAllConfigurations(innerProject.projectName, options = defaultBuildOptions().copy(warningMode = WarningMode.Summary)) } } @@ -175,7 +172,7 @@ class VariantAwareDependenciesIT : BaseGradleIT() { """.trimIndent() ) - testResolveAllConfigurations(innerJvmProject.projectName) + testResolveAllConfigurations(innerJvmProject.projectName, options = defaultBuildOptions().copy(warningMode = WarningMode.Summary)) } } @@ -188,12 +185,12 @@ class VariantAwareDependenciesIT : BaseGradleIT() { embedProject(innerProject) gradleBuildScript(innerProject.projectName).appendText( - "\ndependencies { testCompile project(path: ':', configuration: 'jvm6TestRuntime') }" + "\ndependencies { testImplementation project(path: ':', configuration: 'jvm6TestRuntime') }" ) testResolveAllConfigurations(innerProject.projectName) { - assertContains(">> :${innerProject.projectName}:testCompile --> sample-lib-jvm6-1.0.jar") - assertContains(">> :${innerProject.projectName}:testRuntime --> sample-lib-jvm6-1.0.jar") + assertContains(">> :${innerProject.projectName}:testCompileClasspath --> sample-lib-jvm6-1.0.jar") + assertContains(">> :${innerProject.projectName}:testRuntimeClasspath --> sample-lib-jvm6-1.0.jar") } } } @@ -220,7 +217,7 @@ class VariantAwareDependenciesIT : BaseGradleIT() { testResolveAllConfigurations( project.projectName, - excludePredicate = "it.name in ['compile', 'runtime', 'testCompile', 'testRuntime', 'default']" + options = defaultBuildOptions().copy(warningMode = WarningMode.Summary) ) } } @@ -229,7 +226,6 @@ class VariantAwareDependenciesIT : BaseGradleIT() { @Test fun testResolvesOldKotlinArtifactsPublishedWithMetadata() = with(Project("multiplatformProject", gradleVersion)) { setupWorkingDir() - projectDir.resolve("settings.gradle").appendText("\nenableFeaturePreview 'GRADLE_METADATA'") gradleBuildScript().appendText( "\n" + """ configure([project(':lib'), project(':libJvm'), project(':libJs')]) { @@ -252,13 +248,13 @@ class VariantAwareDependenciesIT : BaseGradleIT() { "\nsubprojects { repositories { maven { url \"file://${'$'}{rootDir.absolutePath.replace('\\\\', '/')}/repo\" } } }" } - gradleBuildScript("lib").appendText("\ndependencies { compile 'com.example.oldmpp:lib:1.0' }") + gradleBuildScript("lib").appendText("\ndependencies { implementation 'com.example.oldmpp:lib:1.0' }") testResolveAllConfigurations("lib") - gradleBuildScript("libJvm").appendText("\ndependencies { compile 'com.example.oldmpp:libJvm:1.0' }") + gradleBuildScript("libJvm").appendText("\ndependencies { implementation 'com.example.oldmpp:libJvm:1.0' }") testResolveAllConfigurations("libJvm") - gradleBuildScript("libJs").appendText("\ndependencies { compile 'com.example.oldmpp:libJs:1.0' }") + gradleBuildScript("libJs").appendText("\ndependencies { implementation 'com.example.oldmpp:libJs:1.0' }") testResolveAllConfigurations("libJs") embedProject(Project("sample-lib", directoryPrefix = "new-mpp-lib-and-app")) @@ -287,13 +283,22 @@ class VariantAwareDependenciesIT : BaseGradleIT() { // variants chosen over the runtime ones when resolving a configuration with no required Usage: with(Project("simpleProject")) { setupWorkingDir() - gradleBuildScript().appendText("\ndependencies { compile 'org.jetbrains.kotlin:kotlin-compiler-embeddable' }") + gradleBuildScript().appendText( + "\n" + """ + dependencies { implementation 'org.jetbrains.kotlin:kotlin-compiler-embeddable' } + + configurations { + customConfiguration.extendsFrom implementation + customConfiguration.canBeResolved(true) + } + """.trimIndent() + ) testResolveAllConfigurations { - assertContains(">> :compile --> kotlin-compiler-embeddable-${defaultBuildOptions().kotlinVersion}.jar") + assertContains(">> :customConfiguration --> kotlin-compiler-embeddable-${defaultBuildOptions().kotlinVersion}.jar") // Check that the transitive dependencies with 'runtime' scope are also available: - assertContains(">> :compile --> kotlin-script-runtime-${defaultBuildOptions().kotlinVersion}.jar") + assertContains(">> :customConfiguration --> kotlin-script-runtime-${defaultBuildOptions().kotlinVersion}.jar") } } diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/util/testResolveAllConfigurations.kt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/util/testResolveAllConfigurations.kt index 42d9a25933d..1f26ef43648 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/util/testResolveAllConfigurations.kt +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/util/testResolveAllConfigurations.kt @@ -5,7 +5,6 @@ package org.jetbrains.kotlin.gradle.util -import org.gradle.api.logging.configuration.WarningMode import org.jetbrains.kotlin.gradle.BaseGradleIT import kotlin.test.assertTrue @@ -16,7 +15,7 @@ private val unresolvedConfigurationRegex = "${Regex.escape(UNRESOLVED_MARKER)}(. fun BaseGradleIT.Project.testResolveAllConfigurations( subproject: String? = null, skipSetup: Boolean = false, - excludePredicate: String = "false", + excludeConfigurations: List = listOf(), options: BaseGradleIT.BuildOptions = testCase.defaultBuildOptions(), withUnresolvedConfigurationNames: BaseGradleIT.CompiledProject.(List) -> Unit = { assertTrue("Unresolved configurations: $it") { it.isEmpty() } } ) = with(testCase) { @@ -25,8 +24,8 @@ fun BaseGradleIT.Project.testResolveAllConfigurations( setupWorkingDir() gradleBuildScript(subproject).run { val taskCode = when (extension) { - "gradle" -> generateResolveAllConfigurationsTask(excludePredicate) - "kts" -> generateResolveAllConfigurationsTaskKts(excludePredicate) + "gradle" -> generateResolveAllConfigurationsTask(excludeConfigurations) + "kts" -> generateResolveAllConfigurationsTaskKts(excludeConfigurations) else -> error("Unexpected build script extension $extension") } appendText("\n" + taskCode) @@ -41,13 +40,16 @@ fun BaseGradleIT.Project.testResolveAllConfigurations( } } -private fun generateResolveAllConfigurationsTask(exclude: String) = +private fun generateResolveAllConfigurationsTask(excludes: List) = """ task $RESOLVE_ALL_CONFIGURATIONS_TASK_NAME { doFirst { + def excludeConfigs = ["default", "archives"] + ${computeExcludeConfigurations(excludes)} + project.configurations .matching { it.canBeResolved } - .matching { !{ $exclude }.call(it) } + .matching { !excludeConfigs.contains(it.name) } .each { configuration -> try { println "Resolving " + configuration.path @@ -66,13 +68,16 @@ private fun generateResolveAllConfigurationsTask(exclude: String) = } """.trimIndent() -private fun generateResolveAllConfigurationsTaskKts(exclude: String) = +private fun generateResolveAllConfigurationsTaskKts(excludes: List) = """ tasks.create("$RESOLVE_ALL_CONFIGURATIONS_TASK_NAME") { doFirst { + val excludeConfigs = mutableListOf("default", "archives") + ${computeExcludeConfigurations(excludes)} + project.configurations .filter { it.isCanBeResolved } - .filterNot { $exclude } + .filterNot { excludeConfigs.contains(it.name) } .forEach { configuration -> val path = (configuration as org.gradle.api.internal.artifacts.configurations.ConfigurationInternal).path try { @@ -90,4 +95,24 @@ private fun generateResolveAllConfigurationsTaskKts(exclude: String) = } } } - """.trimIndent() \ No newline at end of file + """.trimIndent() + +private fun computeExcludeConfigurations(excludes: List): String { + val deprecatedConfigurations = listOf("compile", "runtime", "compileOnly", "runtimeOnly") + return """ + sourceSets.forEach { sourceSet -> + "${deprecatedConfigurations.joinToString()}".split(", ").toList().forEach { + excludeConfigs.add(sourceSet.name + it.capitalize()) + } + } + + "${deprecatedConfigurations.joinToString()}".split(", ").toList().forEach { + excludeConfigs.add(it) + excludeConfigs.add("test" + it.capitalize()) + } + + "${excludes.joinToString()}".split(", ").toList().forEach { + excludeConfigs.add(it) + } + """.trimIndent() +} \ No newline at end of file From 3704b2a5af2a54bf24f749b133c4183f945d9b3a Mon Sep 17 00:00:00 2001 From: Sergey Igushkin Date: Mon, 25 Jan 2021 23:59:28 +0300 Subject: [PATCH 031/212] Fix testJvmKtAppDependsOnMppTestRuntime after 3b0f4f31 --- .idea/vcs.xml | 7 ------- .../jetbrains/kotlin/gradle/VariantAwareDependenciesIT.kt | 4 ++++ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 2a7b87e56c9..0dabf9b5533 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -8,13 +8,6 @@ - - - comboBox( + model: SortedComboBoxModel, + graphProperty: GraphProperty, +) {} + +class GraphProperty + +fun test() { + val presentationName: (DataView) -> String = { it.presentationName } + val parentComboBoxModel/*: SortedComboBoxModel*/ = SortedComboBoxModel(Comparator.comparing(presentationName)) + comboBox(parentComboBoxModel, GraphProperty()) +} + +// FILE: SortedComboBoxModel.java + +import java.util.Comparator; + +public class SortedComboBoxModel { + public SortedComboBoxModel(Comparator comparator) { + } +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/propagateFlexibilityFromOtherConstraints.kt b/compiler/testData/diagnostics/tests/platformTypes/propagateFlexibilityFromOtherConstraints.kt new file mode 100644 index 00000000000..de37642cfb4 --- /dev/null +++ b/compiler/testData/diagnostics/tests/platformTypes/propagateFlexibilityFromOtherConstraints.kt @@ -0,0 +1,32 @@ +// FULL_JDK +// FILE: test.kt + +@file:Suppress("UNUSED_PARAMETER") + +import java.util.Comparator + +abstract class DataView { + abstract val presentationName: String +} + +fun comboBox( + model: SortedComboBoxModel, + graphProperty: GraphProperty, +) {} + +class GraphProperty + +fun test() { + val presentationName: (DataView) -> String = { it.presentationName } + val parentComboBoxModel/*: SortedComboBoxModel*/ = SortedComboBoxModel(Comparator.comparing(presentationName)) + comboBox(parentComboBoxModel, GraphProperty()) +} + +// FILE: SortedComboBoxModel.java + +import java.util.Comparator; + +public class SortedComboBoxModel { + public SortedComboBoxModel(Comparator comparator) { + } +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/propagateFlexibilityFromOtherConstraints.txt b/compiler/testData/diagnostics/tests/platformTypes/propagateFlexibilityFromOtherConstraints.txt new file mode 100644 index 00000000000..38e13f7ba03 --- /dev/null +++ b/compiler/testData/diagnostics/tests/platformTypes/propagateFlexibilityFromOtherConstraints.txt @@ -0,0 +1,26 @@ +package + +public fun comboBox(/*0*/ model: SortedComboBoxModel, /*1*/ graphProperty: GraphProperty): kotlin.Unit +public fun test(): kotlin.Unit + +public abstract class DataView { + public constructor DataView() + public abstract val presentationName: kotlin.String + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public final class GraphProperty { + public constructor GraphProperty() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public open class SortedComboBoxModel { + public constructor SortedComboBoxModel(/*0*/ comparator: java.util.Comparator!) + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java index 24216caa2a4..009583ce0f4 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java @@ -20219,6 +20219,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/platformTypes/override.kt"); } + @Test + @TestMetadata("propagateFlexibilityFromOtherConstraints.kt") + public void testPropagateFlexibilityFromOtherConstraints() throws Exception { + runTest("compiler/testData/diagnostics/tests/platformTypes/propagateFlexibilityFromOtherConstraints.kt"); + } + @Test @TestMetadata("rawOverrides.kt") public void testRawOverrides() throws Exception { From 33b7c68a21f7c7e043d8324db949802e592654a7 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Wed, 27 Jan 2021 18:34:42 +0300 Subject: [PATCH 075/212] Add FIR_IDENTICAL to kt44440.kt test --- .../inference/regressions/kt44440.fir.kt | 21 ------------------- .../tests/inference/regressions/kt44440.kt | 1 + 2 files changed, 1 insertion(+), 21 deletions(-) delete mode 100644 compiler/testData/diagnostics/tests/inference/regressions/kt44440.fir.kt diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt44440.fir.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt44440.fir.kt deleted file mode 100644 index 5bfbe210324..00000000000 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt44440.fir.kt +++ /dev/null @@ -1,21 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -UNUSED_EXPRESSION - -interface I - -fun consume(x: WrapperFactory>) {} - -fun test(x: I) { - val y = foo(x) - >")!>y - consume(y) -} - -fun foo( - x: CX, - fn1: (CX) -> Unit = {}, - fn2: (CX?) -> Unit = {} -) = WrapperFactory { Wrapper(fn1, fn2) } - -class WrapperFactory(val creator: () -> W) - -class Wrapper(val fn1: (CX2) -> Unit, val fn2: (CX2?) -> Unit) diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt44440.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt44440.kt index 5bfbe210324..de3c8bf2fe6 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt44440.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt44440.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER -UNUSED_EXPRESSION interface I From 8b4f2b269c100a82830886c5766892d943a85e67 Mon Sep 17 00:00:00 2001 From: Jinseong Jeon Date: Thu, 21 Jan 2021 11:56:41 -0800 Subject: [PATCH 076/212] FIR checker: introduce PARAMETER_* positioning strategies and use them to add support diagnostics: ANONYMOUS_FUNCTION_PARAMETER_WITH_DEFAULT_VALUE USELESS_VARARG_ON_PARAMETER --- ...TouchedTilContractsPhaseTestGenerated.java | 18 ++++++++ .../functionAsExpression/Parameters.fir.txt | 45 +++++++++++++++++++ .../functionAsExpression/Parameters.kt | 16 +++++++ .../runners/FirDiagnosticTestGenerated.java | 16 +++++++ ...DiagnosticsWithLightTreeTestGenerated.java | 17 +++++++ .../expression/FirAnonymousFunctionChecker.kt | 30 +++++++++++++ .../ExpressionCheckersDiagnosticComponent.kt | 5 +++ .../diagnostics/FirDefaultErrorMessages.kt | 8 ++++ .../fir/analysis/diagnostics/FirErrors.kt | 4 ++ .../LightTreePositioningStrategies.kt | 38 ++++++++++++++++ .../SourceElementPositioningStrategies.kt | 10 +++++ .../fir/checkers/CommonExpressionCheckers.kt | 4 ++ .../functionAsExpression/Parameters.fir.kt | 18 -------- .../tests/functionAsExpression/Parameters.kt | 1 + ...arargsOnParametersOfInlineClassType.fir.kt | 2 +- ...varargsOnParametersOfValueClassType.fir.kt | 2 +- 16 files changed, 214 insertions(+), 20 deletions(-) create mode 100644 compiler/fir/analysis-tests/testData/resolve/diagnostics/functionAsExpression/Parameters.fir.txt create mode 100644 compiler/fir/analysis-tests/testData/resolve/diagnostics/functionAsExpression/Parameters.kt create mode 100644 compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirAnonymousFunctionChecker.kt delete mode 100644 compiler/testData/diagnostics/tests/functionAsExpression/Parameters.fir.kt diff --git a/compiler/fir/analysis-tests/legacy-fir-tests/tests-gen/org/jetbrains/kotlin/fir/LazyBodyIsNotTouchedTilContractsPhaseTestGenerated.java b/compiler/fir/analysis-tests/legacy-fir-tests/tests-gen/org/jetbrains/kotlin/fir/LazyBodyIsNotTouchedTilContractsPhaseTestGenerated.java index 633632c5704..18e275d1142 100644 --- a/compiler/fir/analysis-tests/legacy-fir-tests/tests-gen/org/jetbrains/kotlin/fir/LazyBodyIsNotTouchedTilContractsPhaseTestGenerated.java +++ b/compiler/fir/analysis-tests/legacy-fir-tests/tests-gen/org/jetbrains/kotlin/fir/LazyBodyIsNotTouchedTilContractsPhaseTestGenerated.java @@ -1231,6 +1231,24 @@ public class LazyBodyIsNotTouchedTilContractsPhaseTestGenerated extends Abstract public void testValOnAnnotationParameter() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/valOnAnnotationParameter.kt"); } + + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/diagnostics/functionAsExpression") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class FunctionAsExpression extends AbstractLazyBodyIsNotTouchedTilContractsPhaseTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + } + + public void testAllFilesPresentInFunctionAsExpression() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/diagnostics/functionAsExpression"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @TestMetadata("Parameters.kt") + public void testParameters() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/functionAsExpression/Parameters.kt"); + } + } } @TestMetadata("compiler/fir/analysis-tests/testData/resolve/expresssions") diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/functionAsExpression/Parameters.fir.txt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/functionAsExpression/Parameters.fir.txt new file mode 100644 index 00000000000..ca542e88a54 --- /dev/null +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/functionAsExpression/Parameters.fir.txt @@ -0,0 +1,45 @@ +FILE: Parameters.kt + public final val bar: R|(kotlin/Int) -> kotlin/Unit| = fun (p: R|kotlin/Int| = Int(3)): R|kotlin/Unit| { + } + + public get(): R|(kotlin/Int) -> kotlin/Unit| + public final val bas: R|(kotlin/Int) -> kotlin/Unit| = fun (vararg p: R|kotlin/Int|): R|kotlin/Unit| { + } + + public get(): R|(kotlin/Int) -> kotlin/Unit| + public final fun gar(): R|(kotlin/Int) -> kotlin/Unit| { + ^gar fun (p: R|kotlin/Int| = Int(3)): R|kotlin/Unit| { + } + + } + public final fun gas(): R|(kotlin/Int) -> kotlin/Unit| { + ^gas fun (vararg p: R|kotlin/Int|): R|kotlin/Unit| { + } + + } + public final fun outer(b: R|kotlin/Any?|): R|kotlin/Unit| { + lval bar: R|(kotlin/Int) -> kotlin/Unit| = fun (p: R|kotlin/Int| = Int(3)): R|kotlin/Unit| { + } + + lval bas: R|(kotlin/Int) -> kotlin/Unit| = fun (vararg p: R|kotlin/Int|): R|kotlin/Unit| { + } + + local final fun gar(): R|(kotlin/Int) -> kotlin/Unit| { + ^gar fun (p: R|kotlin/Int| = Int(3)): R|kotlin/Unit| { + } + + } + + local final fun gas(): R|(kotlin/Int) -> kotlin/Unit| { + ^gas fun (vararg p: R|kotlin/Int|): R|kotlin/Unit| { + } + + } + + R|/outer|(fun (p: R|kotlin/Int| = Int(3)): R|kotlin/Unit| { + } + ) + R|/outer|(fun (vararg p: R|kotlin/Int|): R|kotlin/Unit| { + } + ) + } diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/functionAsExpression/Parameters.kt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/functionAsExpression/Parameters.kt new file mode 100644 index 00000000000..710f7c2dd2f --- /dev/null +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/functionAsExpression/Parameters.kt @@ -0,0 +1,16 @@ +val bar = fun(p: Int = 3) {} +val bas = fun(vararg p: Int) {} + +fun gar() = fun(p: Int = 3) {} +fun gas() = fun(vararg p: Int) {} + +fun outer(b: Any?) { + val bar = fun(p: Int = 3) {} + val bas = fun(vararg p: Int) {} + + fun gar() = fun(p: Int = 3) {} + fun gas() = fun(vararg p: Int) {} + + outer(fun(p: Int = 3) {}) + outer(fun(vararg p: Int) {}) +} diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticTestGenerated.java index be352eaf06c..0a8480423e5 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticTestGenerated.java @@ -1424,6 +1424,22 @@ public class FirDiagnosticTestGenerated extends AbstractFirDiagnosticTest { public void testValOnAnnotationParameter() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/valOnAnnotationParameter.kt"); } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/diagnostics/functionAsExpression") + @TestDataPath("$PROJECT_ROOT") + public class FunctionAsExpression extends AbstractFirDiagnosticTest { + @Test + public void testAllFilesPresentInFunctionAsExpression() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/diagnostics/functionAsExpression"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("Parameters.kt") + public void testParameters() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/functionAsExpression/Parameters.kt"); + } + } } @Nested diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticsWithLightTreeTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticsWithLightTreeTestGenerated.java index d89ea750310..2f11cbd2a33 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticsWithLightTreeTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticsWithLightTreeTestGenerated.java @@ -1433,6 +1433,23 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos public void testValOnAnnotationParameter() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/valOnAnnotationParameter.kt"); } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/diagnostics/functionAsExpression") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class FunctionAsExpression extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInFunctionAsExpression() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/diagnostics/functionAsExpression"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("Parameters.kt") + public void testParameters() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/functionAsExpression/Parameters.kt"); + } + } } @Nested diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirAnonymousFunctionChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirAnonymousFunctionChecker.kt new file mode 100644 index 00000000000..6b78f913121 --- /dev/null +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirAnonymousFunctionChecker.kt @@ -0,0 +1,30 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.analysis.checkers.expression + +import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext +import org.jetbrains.kotlin.fir.analysis.checkers.extended.report +import org.jetbrains.kotlin.fir.analysis.diagnostics.DiagnosticReporter +import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors +import org.jetbrains.kotlin.fir.declarations.FirAnonymousFunction +import org.jetbrains.kotlin.fir.expressions.FirStatement + +object FirAnonymousFunctionChecker : FirExpressionChecker() { + override fun check(expression: FirStatement, context: CheckerContext, reporter: DiagnosticReporter) { + if (expression !is FirAnonymousFunction) { + return + } + for (valueParameter in expression.valueParameters) { + val source = valueParameter.source ?: continue + if (valueParameter.defaultValue != null) { + reporter.report(source, FirErrors.ANONYMOUS_FUNCTION_PARAMETER_WITH_DEFAULT_VALUE) + } + if (valueParameter.isVararg) { + reporter.report(source, FirErrors.USELESS_VARARG_ON_PARAMETER) + } + } + } +} diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/collectors/components/ExpressionCheckersDiagnosticComponent.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/collectors/components/ExpressionCheckersDiagnosticComponent.kt index 4931bac1e11..8f737d23862 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/collectors/components/ExpressionCheckersDiagnosticComponent.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/collectors/components/ExpressionCheckersDiagnosticComponent.kt @@ -10,11 +10,16 @@ import org.jetbrains.kotlin.fir.analysis.checkers.expression.FirExpressionChecke import org.jetbrains.kotlin.fir.analysis.checkersComponent import org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollector import org.jetbrains.kotlin.fir.analysis.diagnostics.DiagnosticReporter +import org.jetbrains.kotlin.fir.declarations.FirAnonymousFunction import org.jetbrains.kotlin.fir.expressions.* class ExpressionCheckersDiagnosticComponent(collector: AbstractDiagnosticCollector) : AbstractDiagnosticCollectorComponent(collector) { private val checkers = session.checkersComponent.expressionCheckers + override fun visitAnonymousFunction(anonymousFunction: FirAnonymousFunction, data: CheckerContext) { + checkers.basicExpressionCheckers.check(anonymousFunction, data, reporter) + } + override fun visitTypeOperatorCall(typeOperatorCall: FirTypeOperatorCall, data: CheckerContext) { checkers.basicExpressionCheckers.check(typeOperatorCall, data, reporter) } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt index 3b40846d9ae..04f2c986336 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt @@ -26,6 +26,7 @@ import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ABSTRACT_SUPER_CA import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.AMBIGUITY import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ANNOTATION_CLASS_MEMBER import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ANNOTATION_PARAMETER_DEFAULT_VALUE_MUST_BE_CONSTANT +import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ANONYMOUS_FUNCTION_PARAMETER_WITH_DEFAULT_VALUE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ANY_METHOD_IMPLEMENTED_IN_INTERFACE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ARRAY_EQUALITY_OPERATOR_CAN_BE_REPLACED_WITH_EQUALS import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ASSIGNED_VALUE_IS_NEVER_READ @@ -133,6 +134,7 @@ import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.UNRESOLVED_LABEL import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.UNRESOLVED_REFERENCE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.UNUSED_VARIABLE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.UPPER_BOUND_VIOLATED +import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.USELESS_VARARG_ON_PARAMETER import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.VARIABLE_EXPECTED import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.VARIABLE_INITIALIZER_IS_REDUNDANT import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.VARIABLE_NEVER_READ @@ -360,6 +362,12 @@ class FirDefaultErrorMessages : DefaultErrorMessages.Extension { map.put(FUNCTION_DECLARATION_WITH_NO_NAME, "Function declaration must have a name") + map.put( + ANONYMOUS_FUNCTION_PARAMETER_WITH_DEFAULT_VALUE, + "An anonymous function is not allowed to specify default values for its parameters" + ) + map.put(USELESS_VARARG_ON_PARAMETER, "Vararg on this parameter is useless") + // Properties & accessors map.put( ABSTRACT_PROPERTY_IN_NON_ABSTRACT_CLASS, diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt index 6f9c6108c03..ad2406f1548 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt @@ -158,6 +158,10 @@ object FirErrors { val FUNCTION_DECLARATION_WITH_NO_NAME by error0(SourceElementPositioningStrategies.DECLARATION_SIGNATURE) + // TODO: val ANONYMOUS_FUNCTION_WITH_NAME by error1(SourceElementPositioningStrategies.DECLARATION_NAME) + val ANONYMOUS_FUNCTION_PARAMETER_WITH_DEFAULT_VALUE by error0(SourceElementPositioningStrategies.PARAMETER_DEFAULT_VALUE) + val USELESS_VARARG_ON_PARAMETER by warning0() + // Properties & accessors val ABSTRACT_PROPERTY_IN_NON_ABSTRACT_CLASS by error2(SourceElementPositioningStrategies.MODALITY_MODIFIER) val PRIVATE_PROPERTY_IN_INTERFACE by error0(SourceElementPositioningStrategies.VISIBILITY_MODIFIER) diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/LightTreePositioningStrategies.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/LightTreePositioningStrategies.kt index f288784a41e..daf1f7e374e 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/LightTreePositioningStrategies.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/LightTreePositioningStrategies.kt @@ -247,6 +247,30 @@ object LightTreePositioningStrategies { return markElement(tree.operationReference(node) ?: node, startOffset, endOffset, tree, node) } } + + val PARAMETER_DEFAULT_VALUE: LightTreePositioningStrategy = object : LightTreePositioningStrategy() { + override fun mark( + node: LighterASTNode, + startOffset: Int, + endOffset: Int, + tree: FlyweightCapableTreeStructure + ): List { + val defaultValueElement = tree.defaultValue(node) ?: node + return markElement(defaultValueElement, startOffset, endOffset, tree, node) + } + } + + val PARAMETER_VARARG_MODIFIER: LightTreePositioningStrategy = object : LightTreePositioningStrategy() { + override fun mark( + node: LighterASTNode, + startOffset: Int, + endOffset: Int, + tree: FlyweightCapableTreeStructure + ): List { + val modifier = tree.modifierList(node)?.let { modifierList -> tree.findChildByType(modifierList, KtTokens.VARARG_KEYWORD) } + return markElement(modifier ?: node, startOffset, endOffset, tree, node) + } + } } fun FirSourceElement.hasValOrVar(): Boolean = @@ -317,6 +341,20 @@ private fun FlyweightCapableTreeStructure.receiverTypeReference( } } +private fun FlyweightCapableTreeStructure.defaultValue(node: LighterASTNode): LighterASTNode? { + val childrenRef = Ref>() + getChildren(node, childrenRef) + // p : T = v + return childrenRef.get()?.reversed()?.firstOrNull { + it != null && + it.tokenType != KtTokens.WHITE_SPACE && + it.tokenType != KtTokens.EQ && + it.tokenType != KtNodeTypes.TYPE_REFERENCE && + it.tokenType != KtTokens.COLON && + it.tokenType != KtTokens.IDENTIFIER + } +} + fun FlyweightCapableTreeStructure.findChildByType(node: LighterASTNode, type: IElementType): LighterASTNode? { val childrenRef = Ref>() getChildren(node, childrenRef) diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/SourceElementPositioningStrategies.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/SourceElementPositioningStrategies.kt index 97d1c6e463e..deb902c6457 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/SourceElementPositioningStrategies.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/SourceElementPositioningStrategies.kt @@ -52,4 +52,14 @@ object SourceElementPositioningStrategies { LightTreePositioningStrategies.OPERATOR, PositioningStrategies.OPERATOR ) + + val PARAMETER_DEFAULT_VALUE = SourceElementPositioningStrategy( + LightTreePositioningStrategies.PARAMETER_DEFAULT_VALUE, + PositioningStrategies.PARAMETER_DEFAULT_VALUE + ) + + val PARAMETER_VARARG_MODIFIER = SourceElementPositioningStrategy( + LightTreePositioningStrategies.PARAMETER_VARARG_MODIFIER, + PositioningStrategies.PARAMETER_VARARG_MODIFIER + ) } \ No newline at end of file diff --git a/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/checkers/CommonExpressionCheckers.kt b/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/checkers/CommonExpressionCheckers.kt index bde2a98848a..f93b89239f3 100644 --- a/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/checkers/CommonExpressionCheckers.kt +++ b/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/checkers/CommonExpressionCheckers.kt @@ -8,6 +8,10 @@ package org.jetbrains.kotlin.fir.checkers import org.jetbrains.kotlin.fir.analysis.checkers.expression.* object CommonExpressionCheckers : ExpressionCheckers() { + override val basicExpressionCheckers: Set = setOf( + FirAnonymousFunctionChecker, + ) + override val qualifiedAccessCheckers: Set = setOf( FirSuperNotAvailableChecker, FirNotASupertypeChecker, diff --git a/compiler/testData/diagnostics/tests/functionAsExpression/Parameters.fir.kt b/compiler/testData/diagnostics/tests/functionAsExpression/Parameters.fir.kt deleted file mode 100644 index 1b8ccc2cd78..00000000000 --- a/compiler/testData/diagnostics/tests/functionAsExpression/Parameters.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_ANONYMOUS_PARAMETER -UNUSED_VARIABLE - -val bar = fun(p: Int = 3) {} -val bas = fun(vararg p: Int) {} - -fun gar() = fun(p: Int = 3) {} -fun gas() = fun(vararg p: Int) {} - -fun outer(b: Any?) { - val bar = fun(p: Int = 3) {} - val bas = fun(vararg p: Int) {} - - fun gar() = fun(p: Int = 3) {} - fun gas() = fun(vararg p: Int) {} - - outer(fun(p: Int = 3) {}) - outer(fun(vararg p: Int) {}) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/functionAsExpression/Parameters.kt b/compiler/testData/diagnostics/tests/functionAsExpression/Parameters.kt index c5e7c90ab39..b748c811c6c 100644 --- a/compiler/testData/diagnostics/tests/functionAsExpression/Parameters.kt +++ b/compiler/testData/diagnostics/tests/functionAsExpression/Parameters.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_ANONYMOUS_PARAMETER -UNUSED_VARIABLE val bar = fun(p: Int = 3) {} diff --git a/compiler/testData/diagnostics/tests/inlineClasses/varargsOnParametersOfInlineClassType.fir.kt b/compiler/testData/diagnostics/tests/inlineClasses/varargsOnParametersOfInlineClassType.fir.kt index a6faedc90ed..b7978e5bf60 100644 --- a/compiler/testData/diagnostics/tests/inlineClasses/varargsOnParametersOfInlineClassType.fir.kt +++ b/compiler/testData/diagnostics/tests/inlineClasses/varargsOnParametersOfInlineClassType.fir.kt @@ -10,7 +10,7 @@ class A { fun f3(a0: Int, vararg a1: Foo) { fun f4(vararg a: Foo) {} - val g = fun (vararg v: Foo) {} + val g = fun (vararg v: Foo) {} } } diff --git a/compiler/testData/diagnostics/tests/valueClasses/varargsOnParametersOfValueClassType.fir.kt b/compiler/testData/diagnostics/tests/valueClasses/varargsOnParametersOfValueClassType.fir.kt index 91fa32f9b9b..062857e9b71 100644 --- a/compiler/testData/diagnostics/tests/valueClasses/varargsOnParametersOfValueClassType.fir.kt +++ b/compiler/testData/diagnostics/tests/valueClasses/varargsOnParametersOfValueClassType.fir.kt @@ -16,7 +16,7 @@ class A { fun f3(a0: Int, vararg a1: Foo) { fun f4(vararg a: Foo) {} - val g = fun (vararg v: Foo) {} + val g = fun (vararg v: Foo) {} } } From df68f319bc0e7ffa917d9696f57dbacc7ac020f3 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Wed, 27 Jan 2021 18:43:33 +0300 Subject: [PATCH 077/212] FIR LT: simplify defaultValue() search --- .../diagnostics/LightTreePositioningStrategies.kt | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/LightTreePositioningStrategies.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/LightTreePositioningStrategies.kt index daf1f7e374e..75912ff75ae 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/LightTreePositioningStrategies.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/LightTreePositioningStrategies.kt @@ -345,14 +345,13 @@ private fun FlyweightCapableTreeStructure.defaultValue(node: Lig val childrenRef = Ref>() getChildren(node, childrenRef) // p : T = v - return childrenRef.get()?.reversed()?.firstOrNull { - it != null && - it.tokenType != KtTokens.WHITE_SPACE && - it.tokenType != KtTokens.EQ && - it.tokenType != KtNodeTypes.TYPE_REFERENCE && - it.tokenType != KtTokens.COLON && - it.tokenType != KtTokens.IDENTIFIER + val children = childrenRef.get()?.reversed() ?: return null + for (child in children) { + if (child == null || child.tokenType == KtTokens.WHITE_SPACE) continue + if (child.tokenType == KtNodeTypes.TYPE_REFERENCE || child.tokenType == KtTokens.COLON) return null + return child } + return null } fun FlyweightCapableTreeStructure.findChildByType(node: LighterASTNode, type: IElementType): LighterASTNode? { From 9341ca3004f9a5cdee96eb17639b42be974b6d26 Mon Sep 17 00:00:00 2001 From: Jinseong Jeon Date: Tue, 19 Jan 2021 15:09:00 -0800 Subject: [PATCH 078/212] FIR checker: introduce top-level function checker --- .../arguments/operatorsOverLiterals.fir.txt | 3 +- .../arguments/operatorsOverLiterals.kt | 2 +- .../diagnostics/conflictingOverloads.fir.txt | 3 +- .../diagnostics/conflictingOverloads.kt | 2 +- .../testData/resolve/intersectionTypes.kt | 2 +- .../resolve/multifile/simpleStarImport.kt | 2 +- .../declaration/FirTopLevelFunctionChecker.kt | 39 +++++++++++++++++++ .../diagnostics/FirDefaultErrorMessages.kt | 2 + .../fir/analysis/diagnostics/FirErrors.kt | 1 + .../fir/checkers/CommonDeclarationCheckers.kt | 4 ++ .../diagnostics/tests/Abstract.fir.kt | 2 +- .../DefaultValuesCheckWithoutBody.fir.kt | 2 +- .../diagnosticWithSyntaxError/namedFun.fir.kt | 1 - .../diagnosticWithSyntaxError/namedFun.kt | 1 + .../implDeclarationWithoutBody.fir.kt | 4 +- 15 files changed, 59 insertions(+), 11 deletions(-) create mode 100644 compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirTopLevelFunctionChecker.kt delete mode 100644 compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/namedFun.fir.kt diff --git a/compiler/fir/analysis-tests/testData/resolve/arguments/operatorsOverLiterals.fir.txt b/compiler/fir/analysis-tests/testData/resolve/arguments/operatorsOverLiterals.fir.txt index 6879a2928fe..3636c3d0df2 100644 --- a/compiler/fir/analysis-tests/testData/resolve/arguments/operatorsOverLiterals.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/arguments/operatorsOverLiterals.fir.txt @@ -19,7 +19,8 @@ FILE: operatorsOverLiterals.kt } public final fun R|kotlin/Int|.bar(): R|kotlin/Int| { } - public final fun R|kotlin/Int|.baz(): R|kotlin/Int| + public final fun R|kotlin/Int|.baz(): R|kotlin/Int| { + } public final fun R|kotlin/Byte|.baz(): R|kotlin/Byte| { } public final fun test_3(): R|kotlin/Unit| { diff --git a/compiler/fir/analysis-tests/testData/resolve/arguments/operatorsOverLiterals.kt b/compiler/fir/analysis-tests/testData/resolve/arguments/operatorsOverLiterals.kt index 4e6622f6fcc..445ecf3ff4d 100644 --- a/compiler/fir/analysis-tests/testData/resolve/arguments/operatorsOverLiterals.kt +++ b/compiler/fir/analysis-tests/testData/resolve/arguments/operatorsOverLiterals.kt @@ -20,7 +20,7 @@ fun test_2(n: Int) { fun Int.bar(): Int {} -fun Int.baz(): Int +fun Int.baz(): Int {} fun Byte.baz(): Byte {} fun test_3() { diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/conflictingOverloads.fir.txt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/conflictingOverloads.fir.txt index 3e429144200..b732440a451 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/conflictingOverloads.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/conflictingOverloads.fir.txt @@ -111,7 +111,8 @@ FILE: conflictingOverloads.kt } } - public final fun mest(): R|kotlin/Unit| + public final fun mest(): R|kotlin/Unit| { + } public final class mest : R|kotlin/Any| { public constructor(): R|mest| { super() diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/conflictingOverloads.kt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/conflictingOverloads.kt index d123aa55763..737159ad2f5 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/conflictingOverloads.kt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/conflictingOverloads.kt @@ -59,7 +59,7 @@ class L { fun B.foo() {} } -fun mest() +fun mest() {} class mest diff --git a/compiler/fir/analysis-tests/testData/resolve/intersectionTypes.kt b/compiler/fir/analysis-tests/testData/resolve/intersectionTypes.kt index 961cd6bacff..40e71a1d06a 100644 --- a/compiler/fir/analysis-tests/testData/resolve/intersectionTypes.kt +++ b/compiler/fir/analysis-tests/testData/resolve/intersectionTypes.kt @@ -5,7 +5,7 @@ interface B class Clazz1 : A, B class Clazz2 : A, B -fun select(x: K, y: K): K +fun select(x: K, y: K): K fun test() = select(Clazz1(), Clazz2()) diff --git a/compiler/fir/analysis-tests/testData/resolve/multifile/simpleStarImport.kt b/compiler/fir/analysis-tests/testData/resolve/multifile/simpleStarImport.kt index b442bd93bac..9531ede6c8d 100644 --- a/compiler/fir/analysis-tests/testData/resolve/multifile/simpleStarImport.kt +++ b/compiler/fir/analysis-tests/testData/resolve/multifile/simpleStarImport.kt @@ -14,7 +14,7 @@ package a.d import b.d.* -fun foo(arg: Other): Another +fun foo(arg: Other): Another fun bar() { baz() diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirTopLevelFunctionChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirTopLevelFunctionChecker.kt new file mode 100644 index 00000000000..ec8b47ec082 --- /dev/null +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirTopLevelFunctionChecker.kt @@ -0,0 +1,39 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.analysis.checkers.declaration + +import org.jetbrains.kotlin.fir.FirFakeSourceElementKind +import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext +import org.jetbrains.kotlin.fir.analysis.checkers.extended.report +import org.jetbrains.kotlin.fir.analysis.diagnostics.DiagnosticReporter +import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors +import org.jetbrains.kotlin.fir.declarations.* +import org.jetbrains.kotlin.lexer.KtTokens + +// See old FE's [DeclarationsChecker] +object FirTopLevelFunctionChecker : FirFileChecker() { + override fun check(declaration: FirFile, context: CheckerContext, reporter: DiagnosticReporter) { + for (topLevelDeclaration in declaration.declarations) { + if (topLevelDeclaration is FirSimpleFunction) { + checkFunction(topLevelDeclaration, reporter) + } + } + } + + private fun checkFunction(function: FirSimpleFunction, reporter: DiagnosticReporter) { + val source = function.source ?: return + if (source.kind is FirFakeSourceElementKind) return + // If multiple (potentially conflicting) modality modifiers are specified, not all modifiers are recorded at `status`. + // So, our source of truth should be the full modifier list retrieved from the source. + val modifierList = with(FirModifierList) { source.getModifierList() } + val hasAbstractModifier = modifierList?.modifiers?.any { it.token == KtTokens.ABSTRACT_KEYWORD } == true + val isExternal = function.isExternal || modifierList?.modifiers?.any { it.token == KtTokens.EXTERNAL_KEYWORD } == true + val isExpect = function.isExpect || modifierList?.modifiers?.any { it.token == KtTokens.EXPECT_KEYWORD } == true + if (!function.hasBody && !hasAbstractModifier && !isExternal && !isExpect) { + reporter.report(FirErrors.NON_MEMBER_FUNCTION_NO_BODY.on(source, function)) + } + } +} diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt index 04f2c986336..3d795c8ecac 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt @@ -80,6 +80,7 @@ import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.MANY_COMPANION_OB import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.MISSING_VAL_ON_ANNOTATION_PARAMETER import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.NONE_APPLICABLE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.NON_ABSTRACT_FUNCTION_WITH_NO_BODY +import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.NON_MEMBER_FUNCTION_NO_BODY import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.NON_PRIVATE_CONSTRUCTOR_IN_ENUM import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.NON_PRIVATE_CONSTRUCTOR_IN_SEALED import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.NOT_AN_ANNOTATION_CLASS @@ -359,6 +360,7 @@ class FirDefaultErrorMessages : DefaultErrorMessages.Extension { map.put(ABSTRACT_FUNCTION_WITH_BODY, "A function ''{0}'' with body cannot be abstract", DECLARATION_NAME) map.put(NON_ABSTRACT_FUNCTION_WITH_NO_BODY, "Function ''{0}'' without a body must be abstract", DECLARATION_NAME) map.put(PRIVATE_FUNCTION_WITH_NO_BODY, "Function ''{0}'' without body cannot be private", DECLARATION_NAME) + map.put(NON_MEMBER_FUNCTION_NO_BODY, "Function ''{0}'' must have a body", DECLARATION_NAME) map.put(FUNCTION_DECLARATION_WITH_NO_NAME, "Function declaration must have a name") diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt index ad2406f1548..7450b82105e 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt @@ -155,6 +155,7 @@ object FirErrors { val ABSTRACT_FUNCTION_WITH_BODY by error1(SourceElementPositioningStrategies.MODALITY_MODIFIER) val NON_ABSTRACT_FUNCTION_WITH_NO_BODY by error1(SourceElementPositioningStrategies.DECLARATION_SIGNATURE) val PRIVATE_FUNCTION_WITH_NO_BODY by error1(SourceElementPositioningStrategies.VISIBILITY_MODIFIER) + val NON_MEMBER_FUNCTION_NO_BODY by error1(SourceElementPositioningStrategies.DECLARATION_SIGNATURE) val FUNCTION_DECLARATION_WITH_NO_NAME by error0(SourceElementPositioningStrategies.DECLARATION_SIGNATURE) diff --git a/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/checkers/CommonDeclarationCheckers.kt b/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/checkers/CommonDeclarationCheckers.kt index 099f3ffbf0c..0c3fe1f985a 100644 --- a/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/checkers/CommonDeclarationCheckers.kt +++ b/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/checkers/CommonDeclarationCheckers.kt @@ -59,6 +59,10 @@ object CommonDeclarationCheckers : DeclarationCheckers() { FirConstructorAllowedChecker, ) + override val fileCheckers: Set = setOf( + FirTopLevelFunctionChecker, + ) + override val controlFlowAnalyserCheckers: Set = setOf( FirCallsEffectAnalyzer, FirReturnsImpliesAnalyzer, diff --git a/compiler/testData/diagnostics/tests/Abstract.fir.kt b/compiler/testData/diagnostics/tests/Abstract.fir.kt index fa1c36427a2..7fcfaf02691 100644 --- a/compiler/testData/diagnostics/tests/Abstract.fir.kt +++ b/compiler/testData/diagnostics/tests/Abstract.fir.kt @@ -22,7 +22,7 @@ package MyPackage abstract val e3: Int = 0; get() = a //methods - fun f() + fun f() fun g() {} abstract fun h() abstract fun j() {} diff --git a/compiler/testData/diagnostics/tests/DefaultValuesCheckWithoutBody.fir.kt b/compiler/testData/diagnostics/tests/DefaultValuesCheckWithoutBody.fir.kt index 635ae083091..b508a1436dd 100644 --- a/compiler/testData/diagnostics/tests/DefaultValuesCheckWithoutBody.fir.kt +++ b/compiler/testData/diagnostics/tests/DefaultValuesCheckWithoutBody.fir.kt @@ -6,4 +6,4 @@ abstract class Abst { abstract fun foo(x: Int = y, y: Int = x) } -fun extraDiagnostics(x: Int = y, y: Int) +fun extraDiagnostics(x: Int = y, y: Int) diff --git a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/namedFun.fir.kt b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/namedFun.fir.kt deleted file mode 100644 index b0c6be61c67..00000000000 --- a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/namedFun.fir.kt +++ /dev/null @@ -1 +0,0 @@ -fun bar() diff --git a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/namedFun.kt b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/namedFun.kt index 2a484039cfe..ce85fb96e16 100644 --- a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/namedFun.kt +++ b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/namedFun.kt @@ -1 +1,2 @@ +// FIR_IDENTICAL fun bar() diff --git a/compiler/testData/diagnostics/tests/multiplatform/topLevelFun/implDeclarationWithoutBody.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/topLevelFun/implDeclarationWithoutBody.fir.kt index e0a91283d62..dcf84740c0d 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/topLevelFun/implDeclarationWithoutBody.fir.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/topLevelFun/implDeclarationWithoutBody.fir.kt @@ -7,6 +7,6 @@ expect fun foo() // MODULE: m2-jvm(m1-common) // FILE: jvm.kt -actual fun foo() +actual fun foo() -actual fun bar() +actual fun bar() From f9378a3ab72745d2f7f717eb681e0dbbc13b2e9a Mon Sep 17 00:00:00 2001 From: Jinseong Jeon Date: Tue, 19 Jan 2021 15:41:33 -0800 Subject: [PATCH 079/212] FIR checker: add diagnostic EXPECTED_DECLARATION_WITH_BODY --- .../declaration/FirDeclarationCheckerUtils.kt | 14 ++++++++++++++ .../declaration/FirMemberFunctionChecker.kt | 5 +++++ .../declaration/FirTopLevelFunctionChecker.kt | 5 ++++- .../diagnostics/FirDefaultErrorMessages.kt | 4 ++++ .../kotlin/fir/analysis/diagnostics/FirErrors.kt | 3 +++ .../tests/modifiers/openInExpectInterface.fir.kt | 2 +- .../headerClass/headerClassWithFunctionBody.fir.kt | 2 +- .../topLevelFun/headerDeclarationWithBody.fir.kt | 9 --------- .../topLevelFun/headerDeclarationWithBody.kt | 1 + 9 files changed, 33 insertions(+), 12 deletions(-) delete mode 100644 compiler/testData/diagnostics/tests/multiplatform/topLevelFun/headerDeclarationWithBody.fir.kt diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirDeclarationCheckerUtils.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirDeclarationCheckerUtils.kt index 13a4196d6e3..7c7aef1b0b5 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirDeclarationCheckerUtils.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirDeclarationCheckerUtils.kt @@ -5,10 +5,24 @@ package org.jetbrains.kotlin.fir.analysis.checkers.declaration +import org.jetbrains.kotlin.fir.FirFakeSourceElementKind import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext +import org.jetbrains.kotlin.fir.analysis.checkers.extended.report +import org.jetbrains.kotlin.fir.analysis.diagnostics.DiagnosticReporter +import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors import org.jetbrains.kotlin.fir.declarations.FirRegularClass +import org.jetbrains.kotlin.fir.declarations.FirSimpleFunction +import org.jetbrains.kotlin.fir.declarations.hasBody import org.jetbrains.kotlin.fir.declarations.isExpect // Note that the class that contains the currently visiting declaration will *not* be in the context's containing declarations *yet*. internal fun isInsideExpectClass(containingDeclaration: FirRegularClass, context: CheckerContext): Boolean = containingDeclaration.isExpect || context.containingDeclarations.asReversed().any { it is FirRegularClass && it.isExpect } + +internal fun checkExpectFunction(function: FirSimpleFunction, reporter: DiagnosticReporter) { + val source = function.source ?: return + if (source.kind is FirFakeSourceElementKind) return + if (function.hasBody) { + reporter.report(source, FirErrors.EXPECTED_DECLARATION_WITH_BODY) + } +} diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirMemberFunctionChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirMemberFunctionChecker.kt index 7046416221f..8c23982db76 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirMemberFunctionChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirMemberFunctionChecker.kt @@ -60,6 +60,11 @@ object FirMemberFunctionChecker : FirRegularClassChecker() { reporter.report(FirErrors.NON_ABSTRACT_FUNCTION_WITH_NO_BODY.on(source, function)) } } + + val isExpect = function.isExpect || modifierList?.modifiers?.any { it.token == KtTokens.EXPECT_KEYWORD } == true + if (isExpect) { + checkExpectFunction(function, reporter) + } } } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirTopLevelFunctionChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirTopLevelFunctionChecker.kt index ec8b47ec082..6f237bc0914 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirTopLevelFunctionChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirTopLevelFunctionChecker.kt @@ -7,7 +7,6 @@ package org.jetbrains.kotlin.fir.analysis.checkers.declaration import org.jetbrains.kotlin.fir.FirFakeSourceElementKind import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext -import org.jetbrains.kotlin.fir.analysis.checkers.extended.report import org.jetbrains.kotlin.fir.analysis.diagnostics.DiagnosticReporter import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors import org.jetbrains.kotlin.fir.declarations.* @@ -35,5 +34,9 @@ object FirTopLevelFunctionChecker : FirFileChecker() { if (!function.hasBody && !hasAbstractModifier && !isExternal && !isExpect) { reporter.report(FirErrors.NON_MEMBER_FUNCTION_NO_BODY.on(source, function)) } + + if (isExpect) { + checkExpectFunction(function, reporter) + } } } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt index 3d795c8ecac..2cff65fc736 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt @@ -50,6 +50,7 @@ import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.DESERIALIZATION_E import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.EMPTY_RANGE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ENUM_AS_SUPERTYPE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ERROR_FROM_JAVA_RESOLUTION +import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.EXPECTED_DECLARATION_WITH_BODY import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.EXPLICIT_DELEGATION_CALL_REQUIRED import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.EXPOSED_FUNCTION_RETURN_TYPE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.EXPOSED_PARAMETER_TYPE @@ -394,6 +395,9 @@ class FirDefaultErrorMessages : DefaultErrorMessages.Extension { map.put(PRIVATE_SETTER_FOR_ABSTRACT_PROPERTY, "Private setters are not allowed for abstract properties") map.put(PRIVATE_SETTER_FOR_OPEN_PROPERTY, "Private setters are not allowed for open properties") + // Multi-platform projects + map.put(EXPECTED_DECLARATION_WITH_BODY, "Expected declaration must not have a body") + // Destructuring declaration map.put(INITIALIZER_REQUIRED_FOR_DESTRUCTURING_DECLARATION, "Initializer required for destructuring declaration") map.put( diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt index 7450b82105e..e987ed91adf 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt @@ -180,6 +180,9 @@ object FirErrors { val PRIVATE_SETTER_FOR_ABSTRACT_PROPERTY by error0() val PRIVATE_SETTER_FOR_OPEN_PROPERTY by error0() + // Multi-platform projects + val EXPECTED_DECLARATION_WITH_BODY by error0(SourceElementPositioningStrategies.DECLARATION_SIGNATURE) + // Destructuring declaration val INITIALIZER_REQUIRED_FOR_DESTRUCTURING_DECLARATION by error0() val COMPONENT_FUNCTION_MISSING by error2() diff --git a/compiler/testData/diagnostics/tests/modifiers/openInExpectInterface.fir.kt b/compiler/testData/diagnostics/tests/modifiers/openInExpectInterface.fir.kt index 9e7525245ad..1957883d6de 100644 --- a/compiler/testData/diagnostics/tests/modifiers/openInExpectInterface.fir.kt +++ b/compiler/testData/diagnostics/tests/modifiers/openInExpectInterface.fir.kt @@ -5,7 +5,7 @@ expect interface My { open fun bar() - open fun bas() {} + open fun bas() {} open abstract fun bat(): Int fun foo() diff --git a/compiler/testData/diagnostics/tests/multiplatform/headerClass/headerClassWithFunctionBody.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/headerClass/headerClassWithFunctionBody.fir.kt index 359647a50ee..7f3380f618c 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/headerClass/headerClassWithFunctionBody.fir.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/headerClass/headerClassWithFunctionBody.fir.kt @@ -21,7 +21,7 @@ expect class Foo( get() = "no" set(value) {} - fun functionWithBody(x: Int): Int { + fun functionWithBody(x: Int): Int { return x + 1 } } diff --git a/compiler/testData/diagnostics/tests/multiplatform/topLevelFun/headerDeclarationWithBody.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/topLevelFun/headerDeclarationWithBody.fir.kt deleted file mode 100644 index b7917046dff..00000000000 --- a/compiler/testData/diagnostics/tests/multiplatform/topLevelFun/headerDeclarationWithBody.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// !LANGUAGE: +MultiPlatformProjects -// MODULE: m1-common -// FILE: common.kt - -expect fun foo() - -expect fun foo() {} - -expect fun bar() {} diff --git a/compiler/testData/diagnostics/tests/multiplatform/topLevelFun/headerDeclarationWithBody.kt b/compiler/testData/diagnostics/tests/multiplatform/topLevelFun/headerDeclarationWithBody.kt index 6751e0bd017..80e55c41d2a 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/topLevelFun/headerDeclarationWithBody.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/topLevelFun/headerDeclarationWithBody.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +MultiPlatformProjects // MODULE: m1-common // FILE: common.kt From 57c8dd86a099f9ef6c6e3c51a067dd078e690e22 Mon Sep 17 00:00:00 2001 From: Jinseong Jeon Date: Wed, 20 Jan 2021 00:10:23 -0800 Subject: [PATCH 080/212] FIR checker: introduce top-level property checkers Also, refactor property initializer checking so that those newly added property checkers as well as member property checker can share the same logic --- .../declaration/FirDeclarationCheckerUtils.kt | 94 ++++++++++++++++++- .../declaration/FirMemberPropertyChecker.kt | 42 ++------- .../declaration/FirTopLevelPropertyChecker.kt | 26 +++++ .../diagnostics/FirDefaultErrorMessages.kt | 4 + .../fir/analysis/diagnostics/FirErrors.kt | 13 ++- .../fir/checkers/CommonDeclarationCheckers.kt | 1 + .../tests/delegatedProperty/inTrait.fir.kt | 2 +- .../headerClassWithFunctionBody.fir.kt | 2 +- .../headerClass/memberPropertyKinds.fir.kt | 6 +- .../differentKindsOfProperties.fir.kt | 6 +- .../noMultiplatformProjects.fir.kt | 2 +- 11 files changed, 151 insertions(+), 47 deletions(-) create mode 100644 compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirTopLevelPropertyChecker.kt diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirDeclarationCheckerUtils.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirDeclarationCheckerUtils.kt index 7c7aef1b0b5..36faf79c062 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirDeclarationCheckerUtils.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirDeclarationCheckerUtils.kt @@ -10,10 +10,10 @@ import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext import org.jetbrains.kotlin.fir.analysis.checkers.extended.report import org.jetbrains.kotlin.fir.analysis.diagnostics.DiagnosticReporter import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors -import org.jetbrains.kotlin.fir.declarations.FirRegularClass -import org.jetbrains.kotlin.fir.declarations.FirSimpleFunction -import org.jetbrains.kotlin.fir.declarations.hasBody -import org.jetbrains.kotlin.fir.declarations.isExpect +import org.jetbrains.kotlin.fir.declarations.* +import org.jetbrains.kotlin.fir.declarations.impl.FirDefaultPropertyAccessor +import org.jetbrains.kotlin.fir.types.FirImplicitTypeRef +import org.jetbrains.kotlin.lexer.KtTokens // Note that the class that contains the currently visiting declaration will *not* be in the context's containing declarations *yet*. internal fun isInsideExpectClass(containingDeclaration: FirRegularClass, context: CheckerContext): Boolean = @@ -26,3 +26,89 @@ internal fun checkExpectFunction(function: FirSimpleFunction, reporter: Diagnost reporter.report(source, FirErrors.EXPECTED_DECLARATION_WITH_BODY) } } + +fun checkPropertyInitializer( + containingClass: FirRegularClass?, + property: FirProperty, + reporter: DiagnosticReporter +) { + val inInterface = containingClass?.isInterface == true + // If multiple (potentially conflicting) modality modifiers are specified, not all modifiers are recorded at `status`. + // So, our source of truth should be the full modifier list retrieved from the source. + val modifierList = with(FirModifierList) { property.source.getModifierList() } + val hasAbstractModifier = modifierList?.modifiers?.any { it.token == KtTokens.ABSTRACT_KEYWORD } == true + val isAbstract = property.isAbstract || hasAbstractModifier + if (isAbstract) { + if (property.initializer == null && property.delegate == null && property.returnTypeRef is FirImplicitTypeRef) { + property.source?.let { + reporter.report(it, FirErrors.PROPERTY_WITH_NO_TYPE_NO_INITIALIZER) + } + } + return + } + + // TODO: not exactly... + val backingFieldRequired = property.hasBackingField + if (inInterface && backingFieldRequired && property.hasAccessorImplementation) { + property.source?.let { + // reporter.report(it, FirErrors.BACKING_FIELD_IN_INTERFACE) + } + } + + val isExpect = property.isExpect || modifierList?.modifiers?.any { it.token == KtTokens.EXPECT_KEYWORD } == true + + when { + property.initializer != null -> { + property.initializer?.source?.let { + when { + inInterface -> { + reporter.report(it, FirErrors.PROPERTY_INITIALIZER_IN_INTERFACE) + } + isExpect -> { + reporter.report(it, FirErrors.EXPECTED_PROPERTY_INITIALIZER) + } + !backingFieldRequired -> { + // reporter.report(it, FirErrors.PROPERTY_INITIALIZER_NO_BACKING_FIELD) + } + property.receiverTypeRef != null -> { + // reporter.report(it, FirErrors.EXTENSION_PROPERTY_WITH_BACKING_FIELD) + } + } + } + } + property.delegate != null -> { + property.delegate?.source?.let { + when { + inInterface -> { + reporter.report(it, FirErrors.DELEGATED_PROPERTY_IN_INTERFACE) + } + isExpect -> { + reporter.report(it, FirErrors.EXPECTED_DELEGATED_PROPERTY) + } + } + } + } + else -> { + val isExternal = property.isExternal || modifierList?.modifiers?.any { it.token == KtTokens.EXTERNAL_KEYWORD } == true + // TODO: need to analyze class anonymous initializer to see if the property is initialized there. + val isUninitialized = false + if (backingFieldRequired && !inInterface && !property.isLateInit && !isExpect && isUninitialized && !isExternal) { + property.source?.let { + if (property.receiverTypeRef != null && !property.hasAccessorImplementation) { + // reporter.report(it, FirErrors.EXTENSION_PROPERTY_MUST_HAVE_ACCESSORS_OR_BE_ABSTRACT) + } else { + if (containingClass != null || property.hasAccessorImplementation) { + // reporter.report(it, FirErrors.MUST_BE_INITIALIZED) + } else { + // reporter.report(it, FirErrors.MUST_BE_INITIALIZED_OR_BE_ABSTRACT) + } + } + } + } + } + } +} + +private val FirProperty.hasAccessorImplementation: Boolean + get() = (getter !is FirDefaultPropertyAccessor && getter?.hasBody == true) || + (setter !is FirDefaultPropertyAccessor && setter?.hasBody == true) diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirMemberPropertyChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirMemberPropertyChecker.kt index db2bc0b6df7..cd3036ece87 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirMemberPropertyChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirMemberPropertyChecker.kt @@ -6,6 +6,7 @@ package org.jetbrains.kotlin.fir.analysis.checkers.declaration import org.jetbrains.kotlin.descriptors.Visibilities +import org.jetbrains.kotlin.fir.FirFakeSourceElementKind import org.jetbrains.kotlin.fir.FirSourceElement import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext import org.jetbrains.kotlin.fir.analysis.checkers.extended.report @@ -15,7 +16,6 @@ import org.jetbrains.kotlin.fir.declarations.* import org.jetbrains.kotlin.fir.declarations.impl.FirDefaultPropertyAccessor import org.jetbrains.kotlin.fir.expressions.FirExpression import org.jetbrains.kotlin.fir.symbols.impl.FirPropertyAccessorSymbol -import org.jetbrains.kotlin.fir.types.FirImplicitTypeRef import org.jetbrains.kotlin.lexer.KtTokens // See old FE's [DeclarationsChecker] @@ -34,6 +34,8 @@ object FirMemberPropertyChecker : FirRegularClassChecker() { context: CheckerContext, reporter: DiagnosticReporter ) { + val source = property.source ?: return + if (source.kind is FirFakeSourceElementKind) return // If multiple (potentially conflicting) modality modifiers are specified, not all modifiers are recorded at `status`. // So, our source of truth should be the full modifier list retrieved from the source. val modifierList = with(FirModifierList) { property.source.getModifierList() } @@ -56,15 +58,11 @@ object FirMemberPropertyChecker : FirRegularClassChecker() { return } } - - if (property.delegate != null) { - property.delegate!!.source?.let { - if (containingDeclaration.isInterface) { - reporter.report(it, FirErrors.DELEGATED_PROPERTY_IN_INTERFACE) - } else { - reporter.report(it, FirErrors.ABSTRACT_DELEGATED_PROPERTY) - } - } + property.initializer?.source?.let { + reporter.report(it, FirErrors.ABSTRACT_PROPERTY_WITH_INITIALIZER) + } + property.delegate?.source?.let { + reporter.report(it, FirErrors.ABSTRACT_DELEGATED_PROPERTY) } checkAccessor(property.getter, property.delegate) { src, symbol -> @@ -79,7 +77,7 @@ object FirMemberPropertyChecker : FirRegularClassChecker() { } } - checkPropertyInitializer(containingDeclaration, property, isAbstract, reporter) + checkPropertyInitializer(containingDeclaration, property, reporter) val hasOpenModifier = modifierList?.modifiers?.any { it.token == KtTokens.OPEN_KEYWORD } == true if (hasOpenModifier && @@ -102,28 +100,6 @@ object FirMemberPropertyChecker : FirRegularClassChecker() { } } - private fun checkPropertyInitializer( - containingDeclaration: FirRegularClass, - property: FirProperty, - propertyIsAbstract: Boolean, - reporter: DiagnosticReporter - ) { - property.initializer?.source?.let { - if (propertyIsAbstract) { - reporter.report(it, FirErrors.ABSTRACT_PROPERTY_WITH_INITIALIZER) - } else if (containingDeclaration.isInterface) { - reporter.report(it, FirErrors.PROPERTY_INITIALIZER_IN_INTERFACE) - } - } - if (propertyIsAbstract) { - if (property.initializer == null && property.delegate == null && property.returnTypeRef is FirImplicitTypeRef) { - property.source?.let { - reporter.report(it, FirErrors.PROPERTY_WITH_NO_TYPE_NO_INITIALIZER) - } - } - } - } - private fun checkAccessor( accessor: FirPropertyAccessor?, delegate: FirExpression?, diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirTopLevelPropertyChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirTopLevelPropertyChecker.kt new file mode 100644 index 00000000000..c1c5c4246e1 --- /dev/null +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirTopLevelPropertyChecker.kt @@ -0,0 +1,26 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.analysis.checkers.declaration + +import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext +import org.jetbrains.kotlin.fir.analysis.diagnostics.DiagnosticReporter +import org.jetbrains.kotlin.fir.declarations.FirFile +import org.jetbrains.kotlin.fir.declarations.FirProperty + +// See old FE's [DeclarationsChecker] +object FirTopLevelPropertyChecker : FirFileChecker() { + override fun check(declaration: FirFile, context: CheckerContext, reporter: DiagnosticReporter) { + for (topLevelDeclaration in declaration.declarations) { + if (topLevelDeclaration is FirProperty) { + checkProperty(topLevelDeclaration, reporter) + } + } + } + + private fun checkProperty(property: FirProperty, reporter: DiagnosticReporter) { + checkPropertyInitializer(null, property, reporter) + } +} diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt index 2cff65fc736..682cf11b5cd 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt @@ -51,6 +51,8 @@ import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.EMPTY_RANGE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ENUM_AS_SUPERTYPE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ERROR_FROM_JAVA_RESOLUTION import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.EXPECTED_DECLARATION_WITH_BODY +import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.EXPECTED_DELEGATED_PROPERTY +import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.EXPECTED_PROPERTY_INITIALIZER import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.EXPLICIT_DELEGATION_CALL_REQUIRED import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.EXPOSED_FUNCTION_RETURN_TYPE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.EXPOSED_PARAMETER_TYPE @@ -397,6 +399,8 @@ class FirDefaultErrorMessages : DefaultErrorMessages.Extension { // Multi-platform projects map.put(EXPECTED_DECLARATION_WITH_BODY, "Expected declaration must not have a body") + map.put(EXPECTED_PROPERTY_INITIALIZER, "Expected property cannot have an initializer") + map.put(EXPECTED_DELEGATED_PROPERTY, "Expected property cannot be delegated") // Destructuring declaration map.put(INITIALIZER_REQUIRED_FOR_DESTRUCTURING_DECLARATION, "Initializer required for destructuring declaration") diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt index e987ed91adf..3d934e6174d 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt @@ -168,12 +168,20 @@ object FirErrors { val PRIVATE_PROPERTY_IN_INTERFACE by error0(SourceElementPositioningStrategies.VISIBILITY_MODIFIER) val ABSTRACT_PROPERTY_WITH_INITIALIZER by error0() + // TODO: val MUST_BE_INITIALIZED by error0(SourceElementPositioningStrategies.DECLARATION_SIGNATURE) + // TODO: val MUST_BE_INITIALIZED_OR_BE_ABSTRACT by error0(SourceElementPositioningStrategies.DECLARATION_SIGNATURE) + // TODO: val EXTENSION_PROPERTY_MUST_HAVE_ACCESSORS_OR_BE_ABSTRACT by error0(SourceElementPositioningStrategies.DECLARATION_SIGNATURE) + + // TODO: val EXTENSION_PROPERTY_WITH_BACKING_FIELD by error0() + // TODO: val PROPERTY_INITIALIZER_NO_BACKING_FIELD by error0() + val PROPERTY_INITIALIZER_IN_INTERFACE by error0() val PROPERTY_WITH_NO_TYPE_NO_INITIALIZER by error0(SourceElementPositioningStrategies.DECLARATION_SIGNATURE) + // TODO: val BACKING_FIELD_IN_INTERFACE by error0(SourceElementPositioningStrategies.DECLARATION_SIGNATURE) val ABSTRACT_DELEGATED_PROPERTY by error0() val DELEGATED_PROPERTY_IN_INTERFACE by error0() - // TODO: val ACCESSOR_FOR_DELEGATED_PROPERTY by error1() + // TODO: val ACCESSOR_FOR_DELEGATED_PROPERTY by error1() val ABSTRACT_PROPERTY_WITH_GETTER by error0() val ABSTRACT_PROPERTY_WITH_SETTER by error0() @@ -182,6 +190,9 @@ object FirErrors { // Multi-platform projects val EXPECTED_DECLARATION_WITH_BODY by error0(SourceElementPositioningStrategies.DECLARATION_SIGNATURE) + val EXPECTED_PROPERTY_INITIALIZER by error0() + // TODO: need to cover `by` as well as delegate expression + val EXPECTED_DELEGATED_PROPERTY by error0() // Destructuring declaration val INITIALIZER_REQUIRED_FOR_DESTRUCTURING_DECLARATION by error0() diff --git a/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/checkers/CommonDeclarationCheckers.kt b/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/checkers/CommonDeclarationCheckers.kt index 0c3fe1f985a..e02afe01990 100644 --- a/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/checkers/CommonDeclarationCheckers.kt +++ b/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/checkers/CommonDeclarationCheckers.kt @@ -61,6 +61,7 @@ object CommonDeclarationCheckers : DeclarationCheckers() { override val fileCheckers: Set = setOf( FirTopLevelFunctionChecker, + FirTopLevelPropertyChecker, ) override val controlFlowAnalyserCheckers: Set = setOf( diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inTrait.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inTrait.fir.kt index cbffec8a11e..78224599fb2 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inTrait.fir.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inTrait.fir.kt @@ -3,7 +3,7 @@ import kotlin.reflect.KProperty interface T { - val a: Int by Delegate() + val a: Int by Delegate() } class Delegate { diff --git a/compiler/testData/diagnostics/tests/multiplatform/headerClass/headerClassWithFunctionBody.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/headerClass/headerClassWithFunctionBody.fir.kt index 7f3380f618c..c05fa0c4ff5 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/headerClass/headerClassWithFunctionBody.fir.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/headerClass/headerClassWithFunctionBody.fir.kt @@ -15,7 +15,7 @@ expect class Foo( constructor() : this("no") - val prop: String = "no" + val prop: String = "no" var getSet: String get() = "no" diff --git a/compiler/testData/diagnostics/tests/multiplatform/headerClass/memberPropertyKinds.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/headerClass/memberPropertyKinds.fir.kt index cc6004b6ea3..84232b8f2c1 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/headerClass/memberPropertyKinds.fir.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/headerClass/memberPropertyKinds.fir.kt @@ -14,8 +14,8 @@ expect class Foo { var varWithGetSet: String get set - val backingFieldVal: String = "no" - var backingFieldVar: String = "no" + val backingFieldVal: String = "no" + var backingFieldVar: String = "no" val customAccessorVal: String get() = "no" @@ -25,7 +25,7 @@ expect class Foo { lateinit var lateinitVar: String - val delegated: String by Delegate + val delegated: String by Delegate } object Delegate { operator fun getValue(x: Any?, y: Any?): String = "" } diff --git a/compiler/testData/diagnostics/tests/multiplatform/topLevelProperty/differentKindsOfProperties.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/topLevelProperty/differentKindsOfProperties.fir.kt index d4ec1318474..aa42447a43f 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/topLevelProperty/differentKindsOfProperties.fir.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/topLevelProperty/differentKindsOfProperties.fir.kt @@ -17,8 +17,8 @@ expect var varWithPlatformGetSet: String expect get expect set -expect val backingFieldVal: String = "no" -expect var backingFieldVar: String = "no" +expect val backingFieldVal: String = "no" +expect var backingFieldVar: String = "no" expect val customAccessorVal: String get() = "no" @@ -30,7 +30,7 @@ expect const val constVal: Int expect lateinit var lateinitVar: String -expect val delegated: String by Delegate +expect val delegated: String by Delegate object Delegate { operator fun getValue(x: Any?, y: Any?): String = "" } fun test(): String { diff --git a/compiler/testData/diagnostics/tests/sourceCompatibility/noMultiplatformProjects.fir.kt b/compiler/testData/diagnostics/tests/sourceCompatibility/noMultiplatformProjects.fir.kt index 3032aaa5e43..54fa5bc124b 100644 --- a/compiler/testData/diagnostics/tests/sourceCompatibility/noMultiplatformProjects.fir.kt +++ b/compiler/testData/diagnostics/tests/sourceCompatibility/noMultiplatformProjects.fir.kt @@ -1,5 +1,5 @@ expect fun foo1() -expect val bar1 = 42 +expect val bar1 = 42 expect class Baz1 actual fun foo2() = 42 From 97241599bf5e267608db78ebbc8fbc6e0f37fc25 Mon Sep 17 00:00:00 2001 From: Jinseong Jeon Date: Mon, 25 Jan 2021 12:36:25 -0800 Subject: [PATCH 081/212] FIR checker: add support diagnostic: EXPECTED_PRIVATE_DECLARATION --- .../declaration/FirDeclarationCheckerUtils.kt | 18 ++++++++++++++++-- .../declaration/FirMemberFunctionChecker.kt | 6 ++---- .../declaration/FirMemberPropertyChecker.kt | 2 ++ .../declaration/FirTopLevelFunctionChecker.kt | 5 ++--- .../declaration/FirTopLevelPropertyChecker.kt | 1 + .../diagnostics/FirDefaultErrorMessages.kt | 2 ++ .../fir/analysis/diagnostics/FirErrors.kt | 1 + .../headerClass/privateMembers.fir.kt | 6 +++--- .../privateTopLevelDeclarations.fir.kt | 6 +++--- 9 files changed, 32 insertions(+), 15 deletions(-) diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirDeclarationCheckerUtils.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirDeclarationCheckerUtils.kt index 36faf79c062..b4bdcd6c01d 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirDeclarationCheckerUtils.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirDeclarationCheckerUtils.kt @@ -5,6 +5,7 @@ package org.jetbrains.kotlin.fir.analysis.checkers.declaration +import org.jetbrains.kotlin.descriptors.Visibilities import org.jetbrains.kotlin.fir.FirFakeSourceElementKind import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext import org.jetbrains.kotlin.fir.analysis.checkers.extended.report @@ -19,10 +20,23 @@ import org.jetbrains.kotlin.lexer.KtTokens internal fun isInsideExpectClass(containingDeclaration: FirRegularClass, context: CheckerContext): Boolean = containingDeclaration.isExpect || context.containingDeclarations.asReversed().any { it is FirRegularClass && it.isExpect } -internal fun checkExpectFunction(function: FirSimpleFunction, reporter: DiagnosticReporter) { +// TODO: check class too +internal fun checkPrivateExpectedDeclaration(declaration: FirMemberDeclaration, reporter: DiagnosticReporter) { + val source = declaration.source ?: return + if (source.kind is FirFakeSourceElementKind) return + val modifierList = with(FirModifierList) { source.getModifierList() } + val isExpect = declaration.isExpect || modifierList?.modifiers?.any { it.token == KtTokens.EXPECT_KEYWORD } == true + if (isExpect && Visibilities.isPrivate(declaration.visibility)) { + reporter.report(source, FirErrors.EXPECTED_PRIVATE_DECLARATION) + } +} + +internal fun checkExpectFunctionHasBody(function: FirSimpleFunction, reporter: DiagnosticReporter) { val source = function.source ?: return if (source.kind is FirFakeSourceElementKind) return - if (function.hasBody) { + val modifierList = with(FirModifierList) { source.getModifierList() } + val isExpect = function.isExpect || modifierList?.modifiers?.any { it.token == KtTokens.EXPECT_KEYWORD } == true + if (isExpect && function.hasBody) { reporter.report(source, FirErrors.EXPECTED_DECLARATION_WITH_BODY) } } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirMemberFunctionChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirMemberFunctionChecker.kt index 8c23982db76..7d34523465e 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirMemberFunctionChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirMemberFunctionChecker.kt @@ -61,10 +61,8 @@ object FirMemberFunctionChecker : FirRegularClassChecker() { } } - val isExpect = function.isExpect || modifierList?.modifiers?.any { it.token == KtTokens.EXPECT_KEYWORD } == true - if (isExpect) { - checkExpectFunction(function, reporter) - } + checkExpectFunctionHasBody(function, reporter) + checkPrivateExpectedDeclaration(function, reporter) } } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirMemberPropertyChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirMemberPropertyChecker.kt index cd3036ece87..04ed7eba00f 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirMemberPropertyChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirMemberPropertyChecker.kt @@ -98,6 +98,8 @@ object FirMemberPropertyChecker : FirRegularClassChecker() { } } } + + checkPrivateExpectedDeclaration(property, reporter) } private fun checkAccessor( diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirTopLevelFunctionChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirTopLevelFunctionChecker.kt index 6f237bc0914..4630b3d471e 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirTopLevelFunctionChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirTopLevelFunctionChecker.kt @@ -35,8 +35,7 @@ object FirTopLevelFunctionChecker : FirFileChecker() { reporter.report(FirErrors.NON_MEMBER_FUNCTION_NO_BODY.on(source, function)) } - if (isExpect) { - checkExpectFunction(function, reporter) - } + checkExpectFunctionHasBody(function, reporter) + checkPrivateExpectedDeclaration(function, reporter) } } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirTopLevelPropertyChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirTopLevelPropertyChecker.kt index c1c5c4246e1..cf0c09e9d44 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirTopLevelPropertyChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirTopLevelPropertyChecker.kt @@ -22,5 +22,6 @@ object FirTopLevelPropertyChecker : FirFileChecker() { private fun checkProperty(property: FirProperty, reporter: DiagnosticReporter) { checkPropertyInitializer(null, property, reporter) + checkPrivateExpectedDeclaration(property, reporter) } } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt index 682cf11b5cd..80afdfd30a4 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt @@ -52,6 +52,7 @@ import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ENUM_AS_SUPERTYPE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ERROR_FROM_JAVA_RESOLUTION import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.EXPECTED_DECLARATION_WITH_BODY import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.EXPECTED_DELEGATED_PROPERTY +import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.EXPECTED_PRIVATE_DECLARATION import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.EXPECTED_PROPERTY_INITIALIZER import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.EXPLICIT_DELEGATION_CALL_REQUIRED import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.EXPOSED_FUNCTION_RETURN_TYPE @@ -401,6 +402,7 @@ class FirDefaultErrorMessages : DefaultErrorMessages.Extension { map.put(EXPECTED_DECLARATION_WITH_BODY, "Expected declaration must not have a body") map.put(EXPECTED_PROPERTY_INITIALIZER, "Expected property cannot have an initializer") map.put(EXPECTED_DELEGATED_PROPERTY, "Expected property cannot be delegated") + map.put(EXPECTED_PRIVATE_DECLARATION, "Expected declaration cannot be private") // Destructuring declaration map.put(INITIALIZER_REQUIRED_FOR_DESTRUCTURING_DECLARATION, "Initializer required for destructuring declaration") diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt index 3d934e6174d..47bfb8a2fe3 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt @@ -193,6 +193,7 @@ object FirErrors { val EXPECTED_PROPERTY_INITIALIZER by error0() // TODO: need to cover `by` as well as delegate expression val EXPECTED_DELEGATED_PROPERTY by error0() + val EXPECTED_PRIVATE_DECLARATION by error0(SourceElementPositioningStrategies.VISIBILITY_MODIFIER) // Destructuring declaration val INITIALIZER_REQUIRED_FOR_DESTRUCTURING_DECLARATION by error0() diff --git a/compiler/testData/diagnostics/tests/multiplatform/headerClass/privateMembers.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/headerClass/privateMembers.fir.kt index fe2e20bb2ed..2637cdcae26 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/headerClass/privateMembers.fir.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/headerClass/privateMembers.fir.kt @@ -3,9 +3,9 @@ // FILE: common.kt expect class A { - private fun foo() - private val bar: String - private fun Int.memExt(): Any + private fun foo() + private val bar: String + private fun Int.memExt(): Any private class Nested } diff --git a/compiler/testData/diagnostics/tests/multiplatform/privateTopLevelDeclarations.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/privateTopLevelDeclarations.fir.kt index 1b28447d41b..6b91b6b4321 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/privateTopLevelDeclarations.fir.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/privateTopLevelDeclarations.fir.kt @@ -2,9 +2,9 @@ // MODULE: m1-common // FILE: common.kt -private expect fun foo() -private expect val bar: String -private expect fun Int.memExt(): Any +private expect fun foo() +private expect val bar: String +private expect fun Int.memExt(): Any private expect class Foo From 93436c1341f25ebbb2f836c23d45feb82243bbd3 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Wed, 27 Jan 2021 19:44:48 +0300 Subject: [PATCH 082/212] FIR: optimize / simplify member checkers --- .../declaration/FirDeclarationCheckerUtils.kt | 34 ++++++++----------- .../declaration/FirMemberFunctionChecker.kt | 3 +- .../declaration/FirMemberPropertyChecker.kt | 5 ++- .../declaration/FirTopLevelFunctionChecker.kt | 9 +++-- .../declaration/FirTopLevelPropertyChecker.kt | 7 +++- 5 files changed, 28 insertions(+), 30 deletions(-) diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirDeclarationCheckerUtils.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirDeclarationCheckerUtils.kt index b4bdcd6c01d..79ca69ecef9 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirDeclarationCheckerUtils.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirDeclarationCheckerUtils.kt @@ -6,7 +6,7 @@ package org.jetbrains.kotlin.fir.analysis.checkers.declaration import org.jetbrains.kotlin.descriptors.Visibilities -import org.jetbrains.kotlin.fir.FirFakeSourceElementKind +import org.jetbrains.kotlin.fir.FirSourceElement import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext import org.jetbrains.kotlin.fir.analysis.checkers.extended.report import org.jetbrains.kotlin.fir.analysis.diagnostics.DiagnosticReporter @@ -21,27 +21,23 @@ internal fun isInsideExpectClass(containingDeclaration: FirRegularClass, context containingDeclaration.isExpect || context.containingDeclarations.asReversed().any { it is FirRegularClass && it.isExpect } // TODO: check class too -internal fun checkPrivateExpectedDeclaration(declaration: FirMemberDeclaration, reporter: DiagnosticReporter) { - val source = declaration.source ?: return - if (source.kind is FirFakeSourceElementKind) return - val modifierList = with(FirModifierList) { source.getModifierList() } - val isExpect = declaration.isExpect || modifierList?.modifiers?.any { it.token == KtTokens.EXPECT_KEYWORD } == true - if (isExpect && Visibilities.isPrivate(declaration.visibility)) { - reporter.report(source, FirErrors.EXPECTED_PRIVATE_DECLARATION) +internal fun checkExpectDeclarationVisibilityAndBody( + declaration: FirMemberDeclaration, + source: FirSourceElement, + modifierList: FirModifierList?, + reporter: DiagnosticReporter +) { + if (declaration.isExpect || modifierList?.modifiers?.any { it.token == KtTokens.EXPECT_KEYWORD } == true) { + if (Visibilities.isPrivate(declaration.visibility)) { + reporter.report(source, FirErrors.EXPECTED_PRIVATE_DECLARATION) + } + if (declaration is FirSimpleFunction && declaration.hasBody) { + reporter.report(source, FirErrors.EXPECTED_DECLARATION_WITH_BODY) + } } } -internal fun checkExpectFunctionHasBody(function: FirSimpleFunction, reporter: DiagnosticReporter) { - val source = function.source ?: return - if (source.kind is FirFakeSourceElementKind) return - val modifierList = with(FirModifierList) { source.getModifierList() } - val isExpect = function.isExpect || modifierList?.modifiers?.any { it.token == KtTokens.EXPECT_KEYWORD } == true - if (isExpect && function.hasBody) { - reporter.report(source, FirErrors.EXPECTED_DECLARATION_WITH_BODY) - } -} - -fun checkPropertyInitializer( +internal fun checkPropertyInitializer( containingClass: FirRegularClass?, property: FirProperty, reporter: DiagnosticReporter diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirMemberFunctionChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirMemberFunctionChecker.kt index 7d34523465e..abf01537ef5 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirMemberFunctionChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirMemberFunctionChecker.kt @@ -61,8 +61,7 @@ object FirMemberFunctionChecker : FirRegularClassChecker() { } } - checkExpectFunctionHasBody(function, reporter) - checkPrivateExpectedDeclaration(function, reporter) + checkExpectDeclarationVisibilityAndBody(function, source, modifierList, reporter) } } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirMemberPropertyChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirMemberPropertyChecker.kt index 04ed7eba00f..bf3db33af6c 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirMemberPropertyChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirMemberPropertyChecker.kt @@ -65,7 +65,7 @@ object FirMemberPropertyChecker : FirRegularClassChecker() { reporter.report(it, FirErrors.ABSTRACT_DELEGATED_PROPERTY) } - checkAccessor(property.getter, property.delegate) { src, symbol -> + checkAccessor(property.getter, property.delegate) { src, _ -> reporter.report(src, FirErrors.ABSTRACT_PROPERTY_WITH_GETTER) } checkAccessor(property.setter, property.delegate) { src, symbol -> @@ -99,7 +99,7 @@ object FirMemberPropertyChecker : FirRegularClassChecker() { } } - checkPrivateExpectedDeclaration(property, reporter) + checkExpectDeclarationVisibilityAndBody(property, source, modifierList, reporter) } private fun checkAccessor( @@ -113,5 +113,4 @@ object FirMemberPropertyChecker : FirRegularClassChecker() { } } } - } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirTopLevelFunctionChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirTopLevelFunctionChecker.kt index 4630b3d471e..67be9cc6bed 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirTopLevelFunctionChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirTopLevelFunctionChecker.kt @@ -28,14 +28,13 @@ object FirTopLevelFunctionChecker : FirFileChecker() { // If multiple (potentially conflicting) modality modifiers are specified, not all modifiers are recorded at `status`. // So, our source of truth should be the full modifier list retrieved from the source. val modifierList = with(FirModifierList) { source.getModifierList() } - val hasAbstractModifier = modifierList?.modifiers?.any { it.token == KtTokens.ABSTRACT_KEYWORD } == true - val isExternal = function.isExternal || modifierList?.modifiers?.any { it.token == KtTokens.EXTERNAL_KEYWORD } == true + if (modifierList?.modifiers?.any { it.token == KtTokens.ABSTRACT_KEYWORD } == true) return + if (function.isExternal || modifierList?.modifiers?.any { it.token == KtTokens.EXTERNAL_KEYWORD } == true) return val isExpect = function.isExpect || modifierList?.modifiers?.any { it.token == KtTokens.EXPECT_KEYWORD } == true - if (!function.hasBody && !hasAbstractModifier && !isExternal && !isExpect) { + if (!function.hasBody && !isExpect) { reporter.report(FirErrors.NON_MEMBER_FUNCTION_NO_BODY.on(source, function)) } - checkExpectFunctionHasBody(function, reporter) - checkPrivateExpectedDeclaration(function, reporter) + checkExpectDeclarationVisibilityAndBody(function, source, modifierList, reporter) } } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirTopLevelPropertyChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirTopLevelPropertyChecker.kt index cf0c09e9d44..1e3d5d99ee1 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirTopLevelPropertyChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirTopLevelPropertyChecker.kt @@ -5,6 +5,7 @@ package org.jetbrains.kotlin.fir.analysis.checkers.declaration +import org.jetbrains.kotlin.fir.FirFakeSourceElementKind import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext import org.jetbrains.kotlin.fir.analysis.diagnostics.DiagnosticReporter import org.jetbrains.kotlin.fir.declarations.FirFile @@ -21,7 +22,11 @@ object FirTopLevelPropertyChecker : FirFileChecker() { } private fun checkProperty(property: FirProperty, reporter: DiagnosticReporter) { + val source = property.source ?: return + if (source.kind is FirFakeSourceElementKind) return + val modifierList = with(FirModifierList) { source.getModifierList() } + checkPropertyInitializer(null, property, reporter) - checkPrivateExpectedDeclaration(property, reporter) + checkExpectDeclarationVisibilityAndBody(property, source, modifierList, reporter) } } From 2f12b8f87fed1336a25fa12e85c3d4e5d1e654c7 Mon Sep 17 00:00:00 2001 From: Ilya Kirillov Date: Sat, 16 Jan 2021 19:58:50 +0100 Subject: [PATCH 083/212] FIR: refactoring, move class Java class building to separate fun --- .../kotlin/fir/java/JavaSymbolProvider.kt | 216 ++++++++++-------- 1 file changed, 115 insertions(+), 101 deletions(-) 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 62b4626d765..1f01261282b 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 @@ -186,111 +186,125 @@ class JavaSymbolProvider( javaTypeParameterStack.addStack(parentStack) } } - val firJavaClass = buildJavaClass { - source = (javaClass as? JavaElementImpl<*>)?.psi?.toFirPsiSourceElement() - session = this@JavaSymbolProvider.session - symbol = classSymbol - name = javaClass.name - visibility = javaClass.visibility - modality = javaClass.modality - classKind = javaClass.classKind - this.isTopLevel = outerClassId == null - isStatic = javaClass.isStatic - this.javaTypeParameterStack = javaTypeParameterStack - parentClassTypeParameterStackCache[classSymbol] = javaTypeParameterStack - existingNestedClassifierNames += javaClass.innerClassNames - scopeProvider = this@JavaSymbolProvider.scopeProvider - val classTypeParameters = javaClass.typeParameters.convertTypeParameters(javaTypeParameterStack) - typeParameters += classTypeParameters - if (!isStatic && parentClassSymbol != null) { - typeParameters += parentClassSymbol.fir.typeParameters.map { - buildOuterClassTypeParameterRef { symbol = it.symbol } - } - } - - val dispatchReceiver = classId.defaultType(typeParameters.map { it.symbol }) - - status = FirResolvedDeclarationStatusImpl( - javaClass.visibility, - javaClass.modality - ).apply { - this.isInner = !isTopLevel && !this@buildJavaClass.isStatic - isCompanion = false - isData = false - isInline = false - isFun = classKind == ClassKind.INTERFACE - } - // TODO: may be we can process fields & methods later. - // However, they should be built up to override resolve stage - for (javaField in javaClass.fields) { - declarations += convertJavaFieldToFir(javaField, classId, javaTypeParameterStack, dispatchReceiver) - } - val valueParametersForAnnotationConstructor = ValueParametersForAnnotationConstructor() - val classIsAnnotation = classKind == ClassKind.ANNOTATION_CLASS - - for (javaMethod in javaClass.methods) { - if (javaMethod.isObjectMethodInInterface()) continue - declarations += convertJavaMethodToFir( - javaMethod, - classId, - javaTypeParameterStack, - classIsAnnotation, - valueParametersForAnnotationConstructor, - dispatchReceiver - ) - } - val javaClassDeclaredConstructors = javaClass.constructors - val constructorId = CallableId(classId.packageFqName, classId.relativeClassName, classId.shortClassName) - - if (javaClassDeclaredConstructors.isEmpty() - && javaClass.classKind == ClassKind.CLASS - && javaClass.hasDefaultConstructor() - ) { - declarations += convertJavaConstructorToFir( - javaConstructor = null, - constructorId, - javaClass, - ownerClassBuilder = this, - classTypeParameters, - javaTypeParameterStack - ) - } - for (javaConstructor in javaClassDeclaredConstructors) { - declarations += convertJavaConstructorToFir( - javaConstructor, - constructorId, - javaClass, - ownerClassBuilder = this, - classTypeParameters, - javaTypeParameterStack, - ) - } - - if (classKind == ClassKind.ENUM_CLASS) { - generateValuesFunction( - session, - classId.packageFqName, - classId.relativeClassName - ) - generateValueOfFunction(session, classId.packageFqName, classId.relativeClassName) - } - if (classIsAnnotation) { - declarations += - buildConstructorForAnnotationClass(constructorId, this, valueParametersForAnnotationConstructor) - } - parentClassTypeParameterStackCache.remove(classSymbol) - } - firJavaClass.replaceSuperTypeRefs( - javaClass.supertypes.map { supertype -> - supertype.toFirResolvedTypeRef( - this@JavaSymbolProvider.session, javaTypeParameterStack, isForSupertypes = true, forTypeParameterBounds = false - ) - } - ) + parentClassTypeParameterStackCache[classSymbol] = javaTypeParameterStack + val firJavaClass = createFirJavaClass(javaClass, classSymbol, outerClassId, parentClassSymbol, classId, javaTypeParameterStack) + parentClassTypeParameterStackCache.remove(classSymbol) + firJavaClass.convertSuperTypes(javaClass, javaTypeParameterStack) firJavaClass.addAnnotationsFrom(this@JavaSymbolProvider.session, javaClass, javaTypeParameterStack) return firJavaClass } + private fun FirJavaClass.convertSuperTypes( + javaClass: JavaClass, + javaTypeParameterStack: JavaTypeParameterStack + ) { + replaceSuperTypeRefs( + javaClass.supertypes.map { supertype -> + supertype.toFirResolvedTypeRef(session, javaTypeParameterStack, isForSupertypes = true, forTypeParameterBounds = false) + } + ) + } + + private fun createFirJavaClass( + javaClass: JavaClass, + classSymbol: FirRegularClassSymbol, + outerClassId: ClassId?, + parentClassSymbol: FirRegularClassSymbol?, + classId: ClassId, + javaTypeParameterStack: JavaTypeParameterStack, + ): FirJavaClass = buildJavaClass { + source = (javaClass as? JavaElementImpl<*>)?.psi?.toFirPsiSourceElement() + session = this@JavaSymbolProvider.session + symbol = classSymbol + name = javaClass.name + visibility = javaClass.visibility + modality = javaClass.modality + classKind = javaClass.classKind + this.isTopLevel = outerClassId == null + isStatic = javaClass.isStatic + this.javaTypeParameterStack = javaTypeParameterStack + existingNestedClassifierNames += javaClass.innerClassNames + scopeProvider = this@JavaSymbolProvider.scopeProvider + val classTypeParameters = javaClass.typeParameters.convertTypeParameters(javaTypeParameterStack) + typeParameters += classTypeParameters + if (!isStatic && parentClassSymbol != null) { + typeParameters += parentClassSymbol.fir.typeParameters.map { + buildOuterClassTypeParameterRef { symbol = it.symbol } + } + } + + val dispatchReceiver = classId.defaultType(typeParameters.map { it.symbol }) + + status = FirResolvedDeclarationStatusImpl( + javaClass.visibility, + javaClass.modality + ).apply { + this.isInner = !isTopLevel && !this@buildJavaClass.isStatic + isCompanion = false + isData = false + isInline = false + isFun = classKind == ClassKind.INTERFACE + } + // TODO: may be we can process fields & methods later. + // However, they should be built up to override resolve stage + for (javaField in javaClass.fields) { + declarations += convertJavaFieldToFir(javaField, classId, javaTypeParameterStack, dispatchReceiver) + } + val valueParametersForAnnotationConstructor = ValueParametersForAnnotationConstructor() + val classIsAnnotation = classKind == ClassKind.ANNOTATION_CLASS + + for (javaMethod in javaClass.methods) { + if (javaMethod.isObjectMethodInInterface()) continue + declarations += convertJavaMethodToFir( + javaMethod, + classId, + javaTypeParameterStack, + classIsAnnotation, + valueParametersForAnnotationConstructor, + dispatchReceiver + ) + } + val javaClassDeclaredConstructors = javaClass.constructors + val constructorId = CallableId(classId.packageFqName, classId.relativeClassName, classId.shortClassName) + + if (javaClassDeclaredConstructors.isEmpty() + && javaClass.classKind == ClassKind.CLASS + && javaClass.hasDefaultConstructor() + ) { + declarations += convertJavaConstructorToFir( + javaConstructor = null, + constructorId, + javaClass, + ownerClassBuilder = this, + classTypeParameters, + javaTypeParameterStack + ) + } + for (javaConstructor in javaClassDeclaredConstructors) { + declarations += convertJavaConstructorToFir( + javaConstructor, + constructorId, + javaClass, + ownerClassBuilder = this, + classTypeParameters, + javaTypeParameterStack, + ) + } + + if (classKind == ClassKind.ENUM_CLASS) { + generateValuesFunction( + session, + classId.packageFqName, + classId.relativeClassName + ) + generateValueOfFunction(session, classId.packageFqName, classId.relativeClassName) + } + if (classIsAnnotation) { + declarations += + buildConstructorForAnnotationClass(constructorId, this, valueParametersForAnnotationConstructor) + } + } + private fun convertJavaFieldToFir( javaField: JavaField, classId: ClassId, From 191a948ffe78b4c2df5c1025747aa4a40047f789 Mon Sep 17 00:00:00 2001 From: Ilya Kirillov Date: Wed, 13 Jan 2021 16:03:53 +0100 Subject: [PATCH 084/212] FIR: introduce caches factory --- .../fir/session/ComponentsContainers.kt | 8 ++ .../kotlin/fir/session/FirSessionFactory.kt | 4 + .../fir/caches/FirCacheWithPostCompute.kt | 15 ++++ .../kotlin/fir/caches/FirCachesFactory.kt | 74 +++++++++++++++++++ .../caches/FirThreadUnsafeCachesFactory.kt | 55 ++++++++++++++ .../kotlin/fir/caches/NullableMap.kt | 36 +++++++++ 6 files changed, 192 insertions(+) create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/caches/FirCacheWithPostCompute.kt create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/caches/FirCachesFactory.kt create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/caches/FirThreadUnsafeCachesFactory.kt create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/caches/NullableMap.kt diff --git a/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/session/ComponentsContainers.kt b/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/session/ComponentsContainers.kt index b4ab7cfed61..104321cbf0f 100644 --- a/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/session/ComponentsContainers.kt +++ b/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/session/ComponentsContainers.kt @@ -8,6 +8,8 @@ package org.jetbrains.kotlin.fir.session import org.jetbrains.kotlin.config.LanguageVersionSettings import org.jetbrains.kotlin.fir.* import org.jetbrains.kotlin.fir.analysis.CheckersComponent +import org.jetbrains.kotlin.fir.caches.FirCachesFactory +import org.jetbrains.kotlin.fir.caches.FirThreadUnsafeCachesFactory import org.jetbrains.kotlin.fir.extensions.FirExtensionService import org.jetbrains.kotlin.fir.extensions.FirPredicateBasedProvider import org.jetbrains.kotlin.fir.extensions.FirRegisteredPluginAnnotations @@ -40,6 +42,12 @@ fun FirSession.registerCommonComponents(languageVersionSettings: LanguageVersion register(InferenceComponents::class, InferenceComponents(this)) } +@OptIn(SessionConfiguration::class) +fun FirSession.registerThreadUnsafeCaches() { + register(FirCachesFactory::class, FirThreadUnsafeCachesFactory) +} + + // -------------------------- Resolve components -------------------------- /* diff --git a/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/session/FirSessionFactory.kt b/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/session/FirSessionFactory.kt index 14e399385b7..be690cedefd 100644 --- a/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/session/FirSessionFactory.kt +++ b/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/session/FirSessionFactory.kt @@ -19,6 +19,8 @@ import org.jetbrains.kotlin.fir.analysis.checkers.declaration.DeclarationChecker import org.jetbrains.kotlin.fir.analysis.checkers.expression.ExpressionCheckers import org.jetbrains.kotlin.fir.analysis.checkersComponent import org.jetbrains.kotlin.fir.analysis.extensions.additionalCheckers +import org.jetbrains.kotlin.fir.caches.FirCachesFactory +import org.jetbrains.kotlin.fir.caches.FirThreadUnsafeCachesFactory import org.jetbrains.kotlin.fir.checkers.registerCommonCheckers import org.jetbrains.kotlin.fir.extensions.BunchOfRegisteredExtensions import org.jetbrains.kotlin.fir.extensions.extensionService @@ -68,6 +70,7 @@ object FirSessionFactory { init: FirSessionConfigurator.() -> Unit = {} ): FirJavaModuleBasedSession { return FirJavaModuleBasedSession(moduleInfo, sessionProvider).apply { + registerThreadUnsafeCaches() registerCommonComponents(languageVersionSettings) registerResolveComponents() registerJavaSpecificResolveComponents() @@ -113,6 +116,7 @@ object FirSessionFactory { val kotlinClassFinder = VirtualFileFinderFactory.getInstance(project).create(scope) return FirLibrarySession(moduleInfo, sessionProvider).apply { + registerThreadUnsafeCaches() registerCommonComponents(languageVersionSettings) val javaSymbolProvider = JavaSymbolProvider(this, project, scope) diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/caches/FirCacheWithPostCompute.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/caches/FirCacheWithPostCompute.kt new file mode 100644 index 00000000000..2921e4f95bf --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/caches/FirCacheWithPostCompute.kt @@ -0,0 +1,15 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.caches + +abstract class FirCache { + abstract fun getValue(key: KEY, context: CONTEXT): VALUE + abstract fun getValueIfComputed(key: KEY): VALUE? +} + +@Suppress("NOTHING_TO_INLINE") +inline fun FirCache.getValue(key: KEY): VALUE = + getValue(key, null) diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/caches/FirCachesFactory.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/caches/FirCachesFactory.kt new file mode 100644 index 00000000000..4cc8d948c0f --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/caches/FirCachesFactory.kt @@ -0,0 +1,74 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.caches + +import org.jetbrains.kotlin.fir.FirSession +import org.jetbrains.kotlin.fir.FirSessionComponent + +abstract class FirCachesFactory : FirSessionComponent { + /** + * Creates a cache with returns a value by key on demand if it is computed + * Otherwise computes the value in [createValue] and caches it for future invocations + * + * [FirCache.getValue] should not be called inside [createValue] + * + * Where: + * [CONTEXT] -- type of value which be used to create value by [createValue] + */ + abstract fun createCache(createValue: (KEY, CONTEXT) -> VALUE): FirCache + + /** + * Creates a cache with returns a caches value on demand if it is computed + * Otherwise computes the value in two phases: + * - [createValue] -- creates values and stores [VALUE] to cache and passes [VALUE] & [DATA] to [postCompute] + * - [postCompute] -- performs some operations on computed value after it placed into map + * + * [FirCache.getValue] can be safely called in postCompute from the same thread and correct value computed by [createValue] will be returned + * [FirCache.getValue] should not be called inside [createValue] + * + * Where: + * [CONTEXT] -- type of value which be used to create value by [createValue] + * [DATA] -- type of additional data which will be passed from [createValue] to [postCompute] + */ + abstract fun createCacheWithPostCompute( + createValue: (KEY, CONTEXT) -> Pair, + postCompute: (KEY, VALUE, DATA) -> Unit + ): FirCache +} + +val FirSession.firCachesFactory: FirCachesFactory by FirSession.sessionComponentAccessor() + +inline fun FirCachesFactory.createCache( + crossinline createValue: (KEY) -> VALUE, +): FirCache = createCache( + createValue = { key, _ -> createValue(key) }, +) + +inline fun FirCachesFactory.createCacheWithPostCompute( + crossinline createValue: (KEY, CONTEXT) -> VALUE, + crossinline postCompute: (KEY, VALUE) -> Unit +): FirCache = createCacheWithPostCompute( + createValue = { key, context -> createValue(key, context) to null }, + postCompute = { key, value, _ -> postCompute(key, value) } +) + +inline fun FirCachesFactory.createCacheWithPostCompute( + crossinline createValue: (KEY) -> VALUE, + crossinline postCompute: (KEY, VALUE) -> Unit +): FirCache = createCacheWithPostCompute( + createValue = { key, _ -> createValue(key) to null }, + postCompute = { key, value, _ -> postCompute(key, value) } +) + +inline fun FirCachesFactory.createCacheWithPostCompute( + crossinline createValue: (KEY) -> Pair, + crossinline postCompute: (KEY, VALUE, DATA) -> Unit +): FirCache = createCacheWithPostCompute( + createValue = { key, _ -> createValue(key) }, + postCompute = { key, value, data -> postCompute(key, value, data) } +) + + diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/caches/FirThreadUnsafeCachesFactory.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/caches/FirThreadUnsafeCachesFactory.kt new file mode 100644 index 00000000000..5532f99dfbc --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/caches/FirThreadUnsafeCachesFactory.kt @@ -0,0 +1,55 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.caches + +object FirThreadUnsafeCachesFactory : FirCachesFactory() { + override fun createCache(createValue: (KEY, CONTEXT) -> VALUE): FirCache = + FirThreadUnsafeCache(createValue) + + override fun createCacheWithPostCompute( + createValue: (KEY, CONTEXT) -> Pair, + postCompute: (KEY, VALUE, DATA) -> Unit + ): FirCache = + FirThreadUnsafeCacheWithPostCompute(createValue, postCompute) +} + +@Suppress("UNCHECKED_CAST") +private class FirThreadUnsafeCache( + private val createValue: (KEY, CONTEXT) -> VALUE +) : FirCache() { + private val map = NullableMap() + + override fun getValue(key: KEY, context: CONTEXT): VALUE = + map.getOrElse(key) { + createValue(key, context).also { createdValue -> + map[key] = createdValue + } + } + + override fun getValueIfComputed(key: KEY): VALUE? = + map.getOrElse(key) { null as VALUE } +} + + +private class FirThreadUnsafeCacheWithPostCompute( + private val createValue: (KEY, CONTEXT) -> Pair, + private val postCompute: (KEY, VALUE, DATA) -> Unit +) : FirCache() { + private val map = NullableMap() + + override fun getValue(key: KEY, context: CONTEXT): VALUE = + map.getOrElse(key) { + val (createdValue, data) = createValue(key, context) + map[key] = createdValue + postCompute(key, createdValue, data) + createdValue + } + + + @Suppress("UNCHECKED_CAST") + override fun getValueIfComputed(key: KEY): VALUE? = + map.getOrElse(key) { null as VALUE } +} \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/caches/NullableMap.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/caches/NullableMap.kt new file mode 100644 index 00000000000..a94ccf03b4c --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/caches/NullableMap.kt @@ -0,0 +1,36 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.caches + +import org.jetbrains.kotlin.fir.PrivateForInline + +/** + * [Map] which allows store null values + */ +@OptIn(PrivateForInline::class) +internal inline class NullableMap(private val map: MutableMap = HashMap()) { + + /** + * Get value if it is present in map + * Execute [orElse] otherwise and return it result, + * [orElse] can modify the map inside + */ + @Suppress("UNCHECKED_CAST") + inline fun getOrElse(key: KEY, orElse: () -> VALUE): VALUE = + when (val value = map[key]) { + null -> orElse() + NullValue -> null + else -> value + } as VALUE + + @Suppress("NOTHING_TO_INLINE") + inline operator fun set(key: KEY, value: VALUE) { + map[key] = value ?: NullValue + } +} + +@PrivateForInline +internal object NullValue \ No newline at end of file From 1fef5859e319456a2522965890aff2d039fac37f Mon Sep 17 00:00:00 2001 From: Ilya Kirillov Date: Fri, 15 Jan 2021 18:03:05 +0100 Subject: [PATCH 085/212] FIR IDE: implement thread safe fir caches for IDE --- .../api/fir/caches/FirThreadSafeCache.kt | 21 +++++ .../FirThreadSafeCacheWithPostCompute.kt | 29 ++++++ .../fir/caches/FirThreadSafeCachesFactory.kt | 19 ++++ .../fir/low/level/api/fir/caches/NullValue.kt | 24 +++++ .../api/fir/caches/ValueWithPostCompute.kt | 92 +++++++++++++++++++ .../api/sessions/FirIdeSessionFactory.kt | 9 +- 6 files changed, 191 insertions(+), 3 deletions(-) create mode 100644 idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/fir/caches/FirThreadSafeCache.kt create mode 100644 idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/fir/caches/FirThreadSafeCacheWithPostCompute.kt create mode 100644 idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/fir/caches/FirThreadSafeCachesFactory.kt create mode 100644 idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/fir/caches/NullValue.kt create mode 100644 idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/fir/caches/ValueWithPostCompute.kt diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/fir/caches/FirThreadSafeCache.kt b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/fir/caches/FirThreadSafeCache.kt new file mode 100644 index 00000000000..36887e6d0e6 --- /dev/null +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/fir/caches/FirThreadSafeCache.kt @@ -0,0 +1,21 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.idea.fir.low.level.api.fir.caches + +import org.jetbrains.kotlin.fir.caches.FirCache +import java.util.concurrent.ConcurrentHashMap + +internal class FirThreadSafeCache( + private val createValue: (KEY, CONTEXT) -> VALUE +) : FirCache() { + private val map = ConcurrentHashMap() + + override fun getValue(key: KEY, context: CONTEXT): VALUE = + map.computeIfAbsentWithNullableValue(key) { createValue(it, context) } + + override fun getValueIfComputed(key: KEY): VALUE? = + map[key]?.nullValueToNull() +} \ No newline at end of file diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/fir/caches/FirThreadSafeCacheWithPostCompute.kt b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/fir/caches/FirThreadSafeCacheWithPostCompute.kt new file mode 100644 index 00000000000..57c6e458008 --- /dev/null +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/fir/caches/FirThreadSafeCacheWithPostCompute.kt @@ -0,0 +1,29 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.idea.fir.low.level.api.fir.caches + +import org.jetbrains.kotlin.fir.caches.FirCache +import java.util.concurrent.ConcurrentHashMap + +internal class FirThreadSafeCacheWithPostCompute( + private val createValue: (KEY, CONTEXT) -> Pair, + private val postCompute: (KEY, VALUE, DATA) -> Unit +) : FirCache() { + private val map = ConcurrentHashMap>() + + @Suppress("UNCHECKED_CAST") + override fun getValue(key: KEY, context: CONTEXT): VALUE = + map.computeIfAbsent(key) { + ValueWithPostCompute( + key, + calculate = { createValue(it, context) }, + postCompute = postCompute + ) + }.getValue() + + override fun getValueIfComputed(key: KEY): VALUE? = + map[key]?.getValueIfComputed() +} \ No newline at end of file diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/fir/caches/FirThreadSafeCachesFactory.kt b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/fir/caches/FirThreadSafeCachesFactory.kt new file mode 100644 index 00000000000..5d9d95fbfa0 --- /dev/null +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/fir/caches/FirThreadSafeCachesFactory.kt @@ -0,0 +1,19 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.idea.fir.low.level.api.fir.caches + +import org.jetbrains.kotlin.fir.caches.* + +object FirThreadSafeCachesFactory : FirCachesFactory() { + override fun createCache(createValue: (KEY, CONTEXT) -> VALUE): FirCache = + FirThreadSafeCache(createValue) + + override fun createCacheWithPostCompute( + createValue: (KEY, CONTEXT) -> Pair, + postCompute: (KEY, VALUE, DATA) -> Unit + ): FirCache = + FirThreadSafeCacheWithPostCompute(createValue, postCompute) +} \ No newline at end of file diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/fir/caches/NullValue.kt b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/fir/caches/NullValue.kt new file mode 100644 index 00000000000..67b4e2863c5 --- /dev/null +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/fir/caches/NullValue.kt @@ -0,0 +1,24 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.idea.fir.low.level.api.fir.caches + +import java.util.concurrent.ConcurrentMap + +internal object NullValue + +@Suppress("NOTHING_TO_INLINE", "UNCHECKED_CAST") +internal inline fun Any.nullValueToNull(): VALUE = when (this) { + NullValue -> null + else -> this +} as VALUE + +internal inline fun ConcurrentMap.computeIfAbsentWithNullableValue( + key: KEY, + crossinline compute: (KEY) -> Any? +): RESULT { + val value = computeIfAbsent(key) { k -> compute(k) ?: NullValue } + return value.nullValueToNull() +} \ No newline at end of file diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/fir/caches/ValueWithPostCompute.kt b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/fir/caches/ValueWithPostCompute.kt new file mode 100644 index 00000000000..2b988334853 --- /dev/null +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/fir/caches/ValueWithPostCompute.kt @@ -0,0 +1,92 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.idea.fir.low.level.api.fir.caches + +/** + * Lazily calculated value which runs postCompute in the same thread, + * assuming that postCompute may try to read that value inside current thread, + * So in the period then value is calculated but post compute was not finished, + * only thread that initiated the calculating may see the value, + * other threads will have to wait wait until that value is calculated + */ +internal class ValueWithPostCompute( + /** + * We need at least one final field to be written in constructor to guarantee safe initialization of our [ValueWithPostCompute] + */ + private val key: KEY, + calculate: (KEY) -> Pair, + postCompute: (KEY, VALUE, DATA) -> Unit, +) { + private var _calculate: ((KEY) -> Pair)? = calculate + private var _postCompute: ((KEY, VALUE, DATA) -> Unit)? = postCompute + + /** + * can be in one of the following three states: + * [ValueIsNotComputed] -- value is not initialized and thread are now executing [_postCompute] + * [ExceptionWasThrownDuringValueComputation] -- exception was thrown during value computation, it will be rethrown on every value access + * [ValueIsPostComputingNow] -- thread with threadId has computed the value and only it can access it during post compute + * some value of type [VALUE] -- value is computed and post compute was executed, values is visible for all threads + * + * Value may be set only under [LazyValueWithPostCompute] intrinsic lock hold + * And may be read from any thread + */ + @Volatile + private var value: Any? = ValueIsNotComputed + + @Suppress("UNCHECKED_CAST") + fun getValue(): VALUE { + when (val stateSnapshot = value) { + is ValueIsPostComputingNow -> { + if (stateSnapshot.threadId == Thread.currentThread().id) { + return stateSnapshot.value as VALUE + } else { + synchronized(this) { // wait until other thread which holds the lock now computes the value + return value as VALUE + } + } + } + ValueIsNotComputed -> synchronized(this) { + // if we entered synchronized section that's mean that the value is not yet calculated and was not started to be calculated + // or the some other thread calculated the value while we were waiting to acquire the lock + + if (value != ValueIsNotComputed) { // some other thread calculated our value + return value as VALUE + } + val calculatedValue = try { + val (calculated, data) = _calculate!!(key) + value = ValueIsPostComputingNow(calculated, Thread.currentThread().id) // only current thread may see the value + _postCompute!!(key, calculated, data) + calculated + } catch (e: Throwable) { + value = ExceptionWasThrownDuringValueComputation(e) + throw e + } + _calculate = null + _postCompute = null + value = calculatedValue + return calculatedValue + } + is ExceptionWasThrownDuringValueComputation -> { + throw stateSnapshot.error + } + else -> { + return value as VALUE + } + } + } + + @Suppress("UNCHECKED_CAST") + fun getValueIfComputed(): VALUE? = when (val snapshot = value) { + ValueIsNotComputed -> null + is ValueIsPostComputingNow -> null + is ExceptionWasThrownDuringValueComputation -> throw snapshot.error + else -> value as VALUE + } + + private class ValueIsPostComputingNow(val value: Any?, val threadId: Long) + private class ExceptionWasThrownDuringValueComputation(val error: Throwable) + private object ValueIsNotComputed +} \ No newline at end of file diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/sessions/FirIdeSessionFactory.kt b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/sessions/FirIdeSessionFactory.kt index 99ede8b4444..c7ee4898822 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/sessions/FirIdeSessionFactory.kt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/sessions/FirIdeSessionFactory.kt @@ -12,6 +12,7 @@ import org.jetbrains.kotlin.fir.BuiltinTypes import org.jetbrains.kotlin.fir.PrivateSessionConstructor import org.jetbrains.kotlin.fir.SessionConfiguration import org.jetbrains.kotlin.fir.backend.jvm.FirJvmTypeMapper +import org.jetbrains.kotlin.fir.caches.FirCachesFactory import org.jetbrains.kotlin.fir.checkers.registerCommonCheckers import org.jetbrains.kotlin.fir.dependenciesWithoutSelf import org.jetbrains.kotlin.fir.java.JavaSymbolProvider @@ -33,6 +34,7 @@ import org.jetbrains.kotlin.idea.fir.low.level.api.IdeFirPhaseManager import org.jetbrains.kotlin.idea.fir.low.level.api.IdeSessionComponents import org.jetbrains.kotlin.idea.fir.low.level.api.file.builder.FirFileBuilder import org.jetbrains.kotlin.idea.fir.low.level.api.file.builder.ModuleFileCacheImpl +import org.jetbrains.kotlin.idea.fir.low.level.api.fir.caches.FirThreadSafeCachesFactory import org.jetbrains.kotlin.idea.fir.low.level.api.lazy.resolve.FirLazyDeclarationResolver import org.jetbrains.kotlin.idea.fir.low.level.api.providers.FirModuleWithDependenciesSymbolProvider import org.jetbrains.kotlin.idea.fir.low.level.api.providers.FirIdeProvider @@ -71,9 +73,9 @@ internal object FirIdeSessionFactory { val cache = ModuleFileCacheImpl(this) val firPhaseManager = IdeFirPhaseManager(FirLazyDeclarationResolver(firFileBuilder), cache, sessionInvalidator) + registerIdeComponents() registerCommonComponents(languageVersionSettings) registerResolveComponents() - registerIdeComponents() val provider = FirIdeProvider( project, @@ -156,9 +158,9 @@ internal object FirIdeSessionFactory { val kotlinClassFinder = VirtualFileFinderFactory.getInstance(project).create(searchScope) FirIdeLibrariesSession(moduleInfo, project, searchScope, builtinTypes).apply { + registerIdeComponents() registerCommonComponents(languageVersionSettings) registerJavaSpecificResolveComponents() - registerIdeComponents() val javaSymbolProvider = JavaSymbolProvider(this, project, searchScope) @@ -198,8 +200,8 @@ internal object FirIdeSessionFactory { languageVersionSettings: LanguageVersionSettings = LanguageVersionSettingsImpl.DEFAULT ): FirIdeBuiltinsAndCloneableSession { return FirIdeBuiltinsAndCloneableSession(project, builtinTypes).apply { - registerCommonComponents(languageVersionSettings) registerIdeComponents() + registerCommonComponents(languageVersionSettings) val kotlinScopeProvider = KotlinScopeProvider(::wrapScopeWithJvmMapped) register( @@ -218,5 +220,6 @@ internal object FirIdeSessionFactory { private fun FirIdeSession.registerIdeComponents() { register(IdeSessionComponents::class, IdeSessionComponents.create(this)) + register(FirCachesFactory::class, FirThreadSafeCachesFactory) } } From 7284acc9f9a4f6d7a054c3766a9ae377b384235d Mon Sep 17 00:00:00 2001 From: Ilya Kirillov Date: Sun, 17 Jan 2021 04:32:22 +0100 Subject: [PATCH 086/212] FIR IDE: use FirCaches in JavaSymbolProvider --- .../kotlin/fir/java/JavaSymbolProvider.kt | 76 +++++++++++-------- .../resolve/providers/SymbolProviderCache.kt | 17 ----- idea/testData/checker/regression/Jet53.kt | 1 + 3 files changed, 44 insertions(+), 50 deletions(-) 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 1f01261282b..856d4f108f3 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 @@ -12,6 +12,7 @@ import org.jetbrains.kotlin.descriptors.ClassKind import org.jetbrains.kotlin.descriptors.Modality import org.jetbrains.kotlin.descriptors.Visibilities import org.jetbrains.kotlin.fir.* +import org.jetbrains.kotlin.fir.caches.* import org.jetbrains.kotlin.fir.declarations.* import org.jetbrains.kotlin.fir.declarations.builder.* import org.jetbrains.kotlin.fir.declarations.impl.FirResolvedDeclarationStatusImpl @@ -22,7 +23,6 @@ import org.jetbrains.kotlin.fir.resolve.constructType import org.jetbrains.kotlin.fir.resolve.defaultType import org.jetbrains.kotlin.fir.resolve.providers.FirSymbolProvider import org.jetbrains.kotlin.fir.resolve.providers.FirSymbolProviderInternals -import org.jetbrains.kotlin.fir.resolve.providers.SymbolProviderCache import org.jetbrains.kotlin.fir.resolve.scopes.wrapScopeWithJvmMapped import org.jetbrains.kotlin.fir.symbols.CallableId import org.jetbrains.kotlin.fir.symbols.impl.* @@ -53,8 +53,17 @@ class JavaSymbolProvider( internal val VALUE_METHOD_NAME = Name.identifier("value") } - private val classCache = SymbolProviderCache() - private val packageCache = SymbolProviderCache() + private val classCache = + session.firCachesFactory.createCacheWithPostCompute( + createValue = ::findAndConvertJavaClass, + postCompute = { _, classSymbol, javaClass, -> + if (classSymbol != null && javaClass != null) { + convertJavaClassToFir(classSymbol, javaClass) + } + } + ) + private val packageCache = session.firCachesFactory.createCache(::findPackage) + private val knownClassNamesInPackage = session.firCachesFactory.createCache?>(::getKnownClassNames) private val scopeProvider = JavaScopeProvider(::wrapScopeWithJvmMapped, this) @@ -138,24 +147,23 @@ class JavaSymbolProvider( fun getFirJavaClass(classId: ClassId, content: KotlinClassFinder.Result.ClassFileContent? = null): FirRegularClassSymbol? { if (!hasTopLevelClassOf(classId)) return null - return classCache.lookupCacheOrCalculateWithPostCompute( - classId, - { - val foundClass = findClass(classId, content) - if (foundClass == null || - foundClass.hasDifferentRelativeClassName(classId) || - foundClass.hasMetadataAnnotation() - ) { - null to null - } else { - FirRegularClassSymbol(classId) to foundClass - } - }, - ) { firSymbol, foundClass -> - convertJavaClassToFir(firSymbol, foundClass) + return classCache.getValue(classId, content) + } + + private fun findAndConvertJavaClass(classId: ClassId, content: KotlinClassFinder.Result.ClassFileContent?): Pair { + val foundClass = findClass(classId, content) + return if (foundClass == null || + foundClass.hasDifferentRelativeClassName(classId) || + foundClass.hasMetadataAnnotation() + ) { + null to null + } else { + val symbol = FirRegularClassSymbol(classId) + symbol to foundClass } } + /** * We do not check the package because we can look for the class in the same package by class name without package specified. * In this case, found [JavaClass] may have different `packageFqName`, but not `relativeClassName`. @@ -171,14 +179,15 @@ class JavaSymbolProvider( var valueParameterForValue: FirJavaValueParameter? = null } - private fun convertJavaClassToFir(classSymbol: FirRegularClassSymbol, javaClass: JavaClass?): FirJavaClass? { - if (javaClass == null) return null + private fun convertJavaClassToFir(classSymbol: FirRegularClassSymbol, javaClass: JavaClass): FirJavaClass { val classId = classSymbol.classId val javaTypeParameterStack = JavaTypeParameterStack() val outerClassId = classId.outerClassId val parentClassSymbol = if (outerClassId != null) { getClassLikeSymbolByFqName(outerClassId) } else null + + if (parentClassSymbol != null) { val parentStack = parentClassTypeParameterStackCache[parentClassSymbol] ?: (parentClassSymbol.fir as? FirJavaClass)?.javaTypeParameterStack @@ -527,25 +536,26 @@ class JavaSymbolProvider( ) override fun getPackage(fqName: FqName): FqName? { - return packageCache.lookupCacheOrCalculate(fqName) { - try { - val facade = KotlinJavaPsiFacade.getInstance(project) - val javaPackage = facade.findPackage(fqName.asString(), searchScope) ?: return@lookupCacheOrCalculate null - FqName(javaPackage.qualifiedName) - } catch (e: ProcessCanceledException) { - return@lookupCacheOrCalculate null - } + return packageCache.getValue(fqName) + } + + private fun findPackage(fqName: FqName): FqName? { + return try { + val facade = KotlinJavaPsiFacade.getInstance(project) + val javaPackage = facade.findPackage(fqName.asString(), searchScope) ?: return null + FqName(javaPackage.qualifiedName) + } catch (e: ProcessCanceledException) { + return null } } - private val knownClassNamesInPackage = mutableMapOf?>() - private fun hasTopLevelClassOf(classId: ClassId): Boolean { - val knownNames = knownClassNamesInPackage.getOrPut(classId.packageFqName) { - facade.knownClassNamesInPackage(classId.packageFqName, searchScope) - } ?: return true + val knownNames = knownClassNamesInPackage.getValue(classId.packageFqName) ?: return true return classId.relativeClassName.topLevelName() in knownNames } + + private fun getKnownClassNames(packageFqName: FqName): MutableSet? = + facade.knownClassNamesInPackage(packageFqName, searchScope) } fun FqName.topLevelName() = diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/providers/SymbolProviderCache.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/providers/SymbolProviderCache.kt index 0a489a928de..451c738d3fc 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/providers/SymbolProviderCache.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/providers/SymbolProviderCache.kt @@ -29,23 +29,6 @@ inline class SymbolProviderCache @PrivateForInline constructor(@Priv } } - @OptIn(PrivateForInline::class) - inline fun lookupCacheOrCalculateWithPostCompute( - key: K, crossinline l: (K) -> Pair, postCompute: (V, T) -> Unit - ): V? { - @Suppress("UNCHECKED_CAST") - return when (val value = cache[key]) { - null -> { - val calculated = l(key) - cache[key] = calculated.first ?: NullValue - calculated.first?.let { postCompute(it, calculated.second) } - calculated.first - } - NullValue -> null - else -> value as V - } - } - @OptIn(PrivateForInline::class) operator fun contains(key: K): Boolean = key in cache diff --git a/idea/testData/checker/regression/Jet53.kt b/idea/testData/checker/regression/Jet53.kt index e7a7f0c8db9..382978af233 100644 --- a/idea/testData/checker/regression/Jet53.kt +++ b/idea/testData/checker/regression/Jet53.kt @@ -1,3 +1,4 @@ +// FIR_COMPARISON import java.util.Collections fun checkSubtype(t: T) = t From 169134655a17289bb6d9a17523b809970c3a04b1 Mon Sep 17 00:00:00 2001 From: Ilya Kirillov Date: Sat, 16 Jan 2021 23:53:42 +0100 Subject: [PATCH 087/212] FIR: encapsulate KotlinDeserializedJvmSymbolsProvider.knownClassNamesInPackage into class --- .../KotlinDeserializedJvmSymbolsProvider.kt | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/deserialization/KotlinDeserializedJvmSymbolsProvider.kt b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/deserialization/KotlinDeserializedJvmSymbolsProvider.kt index 49222281729..2afb5ac1777 100644 --- a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/deserialization/KotlinDeserializedJvmSymbolsProvider.kt +++ b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/deserialization/KotlinDeserializedJvmSymbolsProvider.kt @@ -11,6 +11,7 @@ import org.jetbrains.kotlin.SpecialJvmAnnotations import org.jetbrains.kotlin.descriptors.SourceElement import org.jetbrains.kotlin.fir.FirSession import org.jetbrains.kotlin.fir.ThreadSafeMutableState +import org.jetbrains.kotlin.fir.caches.firCachesFactory import org.jetbrains.kotlin.fir.declarations.* import org.jetbrains.kotlin.fir.deserialization.FirConstDeserializer import org.jetbrains.kotlin.fir.deserialization.FirDeserializationContext @@ -66,6 +67,8 @@ class KotlinDeserializedJvmSymbolsProvider( private val typeAliasCache = SymbolProviderCache() private val packagePartsCache = SymbolProviderCache>() + private val knownNameInPackageCache = KnownNameInPackageCache(session, javaClassFinder) + // TODO: implement thread safety for this property private val handledByJava = HashSet() @@ -87,22 +90,12 @@ class KotlinDeserializedJvmSymbolsProvider( } } - private val knownClassNamesInPackage = mutableMapOf?>() - - // This function returns true if we are sure that no top-level class with this id is available - // If it returns false, it means we can say nothing about this id - private fun hasNoTopLevelClassOf(classId: ClassId): Boolean { - val knownNames = knownClassNamesInPackage.getOrPut(classId.packageFqName) { - javaClassFinder.knownClassNamesInPackage(classId.packageFqName) - } ?: return false - return classId.relativeClassName.topLevelName() !in knownNames - } private fun computePackagePartsInfos(packageFqName: FqName): List { return packagePartProvider.findPackageParts(packageFqName.asString()).mapNotNull { partName -> val classId = ClassId.topLevel(JvmClassName.byInternalName(partName).fqNameForTopLevelClassMaybeWithDollars) - if (hasNoTopLevelClassOf(classId)) return@mapNotNull null + if (knownNameInPackageCache.hasNoTopLevelClassOf(classId)) return@mapNotNull null val (kotlinJvmBinaryClass, byteContent) = kotlinClassFinder.findKotlinClassOrContent(classId) as? KotlinClassFinder.Result.KotlinClass ?: return@mapNotNull null @@ -308,7 +301,7 @@ class KotlinDeserializedJvmSymbolsProvider( classId: ClassId, parentContext: FirDeserializationContext? = null ): FirRegularClassSymbol? { - if (hasNoTopLevelClassOf(classId)) return null + if (knownNameInPackageCache.hasNoTopLevelClassOf(classId)) return null if (classId in classCache) return classCache[classId] if (classId in handledByJava) return null @@ -410,3 +403,16 @@ class KotlinDeserializedJvmSymbolsProvider( override fun getPackage(fqName: FqName): FqName? = null } + +private class KnownNameInPackageCache(session: FirSession, private val javaClassFinder: JavaClassFinder) { + private val knownClassNamesInPackage = session.firCachesFactory.createCache(javaClassFinder::knownClassNamesInPackage) + + /** + * This function returns true if we are sure that no top-level class with this id is available + * If it returns false, it means we can say nothing about this id + */ + fun hasNoTopLevelClassOf(classId: ClassId): Boolean { + val knownNames = knownClassNamesInPackage.getValue(classId.packageFqName) ?: return false + return classId.relativeClassName.topLevelName() !in knownNames + } +} From 3cee5e848a50708dd2a2036bc11cc6deed6b8de7 Mon Sep 17 00:00:00 2001 From: Ilya Kirillov Date: Sun, 17 Jan 2021 00:32:22 +0100 Subject: [PATCH 088/212] FIR: encapsulate annotation loading in KotlinDeserializedJvmSymbolsProvider.knownClassNamesInPackage into class --- .../java/deserialization/AnnotationsLoader.kt | 165 ++++++++++++++++++ .../JvmBinaryAnnotationDeserializer.kt | 18 +- .../KotlinDeserializedJvmSymbolsProvider.kt | 150 +--------------- 3 files changed, 172 insertions(+), 161 deletions(-) create mode 100644 compiler/fir/java/src/org/jetbrains/kotlin/fir/java/deserialization/AnnotationsLoader.kt diff --git a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/deserialization/AnnotationsLoader.kt b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/deserialization/AnnotationsLoader.kt new file mode 100644 index 00000000000..8df4b2e9244 --- /dev/null +++ b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/deserialization/AnnotationsLoader.kt @@ -0,0 +1,165 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.java.deserialization + +import org.jetbrains.kotlin.SpecialJvmAnnotations +import org.jetbrains.kotlin.fir.FirSession +import org.jetbrains.kotlin.fir.diagnostics.ConeSimpleDiagnostic +import org.jetbrains.kotlin.fir.diagnostics.DiagnosticKind +import org.jetbrains.kotlin.fir.expressions.FirAnnotationCall +import org.jetbrains.kotlin.fir.expressions.FirClassReferenceExpression +import org.jetbrains.kotlin.fir.expressions.FirExpression +import org.jetbrains.kotlin.fir.expressions.buildUnaryArgumentList +import org.jetbrains.kotlin.fir.expressions.builder.* +import org.jetbrains.kotlin.fir.java.createConstantOrError +import org.jetbrains.kotlin.fir.references.builder.buildErrorNamedReference +import org.jetbrains.kotlin.fir.references.builder.buildResolvedNamedReference +import org.jetbrains.kotlin.fir.references.impl.FirReferencePlaceholderForResolvedAnnotations +import org.jetbrains.kotlin.fir.resolve.firSymbolProvider +import org.jetbrains.kotlin.fir.resolve.providers.getClassDeclaredPropertySymbols +import org.jetbrains.kotlin.fir.symbols.ConeClassLikeLookupTag +import org.jetbrains.kotlin.fir.symbols.impl.ConeClassLikeLookupTagImpl +import org.jetbrains.kotlin.fir.types.FirResolvedTypeRef +import org.jetbrains.kotlin.fir.types.builder.buildResolvedTypeRef +import org.jetbrains.kotlin.fir.types.constructClassType +import org.jetbrains.kotlin.load.kotlin.KotlinJvmBinaryClass +import org.jetbrains.kotlin.name.ClassId +import org.jetbrains.kotlin.name.Name +import org.jetbrains.kotlin.resolve.constants.ClassLiteralValue + +internal class AnnotationsLoader(private val session: FirSession) { + private fun loadAnnotation( + annotationClassId: ClassId, result: MutableList, + ): KotlinJvmBinaryClass.AnnotationArgumentVisitor { + val lookupTag = ConeClassLikeLookupTagImpl(annotationClassId) + + return object : KotlinJvmBinaryClass.AnnotationArgumentVisitor { + private val argumentMap = mutableMapOf() + + override fun visit(name: Name?, value: Any?) { + if (name != null) { + argumentMap[name] = createConstant(value) + } + } + + private fun ClassLiteralValue.toFirClassReferenceExpression(): FirClassReferenceExpression { + val literalLookupTag = ConeClassLikeLookupTagImpl(classId) + return buildClassReferenceExpression { + classTypeRef = literalLookupTag.toDefaultResolvedTypeRef() + } + } + + private fun ClassId.toEnumEntryReferenceExpression(name: Name): FirExpression { + return buildFunctionCall { + val entryPropertySymbol = + session.firSymbolProvider.getClassDeclaredPropertySymbols( + this@toEnumEntryReferenceExpression, name, + ).firstOrNull() + + calleeReference = when { + entryPropertySymbol != null -> { + buildResolvedNamedReference { + this.name = name + resolvedSymbol = entryPropertySymbol + } + } + else -> { + buildErrorNamedReference { + diagnostic = ConeSimpleDiagnostic( + "Strange deserialized enum value: ${this@toEnumEntryReferenceExpression}.$name", + DiagnosticKind.Java, + ) + } + } + } + } + } + + override fun visitClassLiteral(name: Name, value: ClassLiteralValue) { + argumentMap[name] = buildGetClassCall { + argumentList = buildUnaryArgumentList(value.toFirClassReferenceExpression()) + } + } + + override fun visitEnum(name: Name, enumClassId: ClassId, enumEntryName: Name) { + argumentMap[name] = enumClassId.toEnumEntryReferenceExpression(enumEntryName) + } + + override fun visitArray(name: Name): KotlinJvmBinaryClass.AnnotationArrayArgumentVisitor { + return object : KotlinJvmBinaryClass.AnnotationArrayArgumentVisitor { + private val elements = mutableListOf() + + override fun visit(value: Any?) { + elements.add(createConstant(value)) + } + + override fun visitEnum(enumClassId: ClassId, enumEntryName: Name) { + elements.add(enumClassId.toEnumEntryReferenceExpression(enumEntryName)) + } + + override fun visitClassLiteral(value: ClassLiteralValue) { + elements.add( + buildGetClassCall { + argumentList = buildUnaryArgumentList(value.toFirClassReferenceExpression()) + } + ) + } + + override fun visitEnd() { + argumentMap[name] = buildArrayOfCall { + argumentList = buildArgumentList { + arguments += elements + } + } + } + } + } + + override fun visitAnnotation(name: Name, classId: ClassId): KotlinJvmBinaryClass.AnnotationArgumentVisitor { + val list = mutableListOf() + val visitor = loadAnnotation(classId, list) + return object : KotlinJvmBinaryClass.AnnotationArgumentVisitor by visitor { + override fun visitEnd() { + visitor.visitEnd() + argumentMap[name] = list.single() + } + } + } + + override fun visitEnd() { + result += buildAnnotationCall { + annotationTypeRef = lookupTag.toDefaultResolvedTypeRef() + argumentList = buildArgumentList { + for ((name, expression) in argumentMap) { + arguments += buildNamedArgumentExpression { + this.expression = expression + this.name = name + isSpread = false + } + } + } + calleeReference = FirReferencePlaceholderForResolvedAnnotations + } + } + + private fun createConstant(value: Any?): FirExpression { + return value.createConstantOrError(session) + } + } + } + + internal fun loadAnnotationIfNotSpecial( + annotationClassId: ClassId, result: MutableList, + ): KotlinJvmBinaryClass.AnnotationArgumentVisitor? { + if (annotationClassId in SpecialJvmAnnotations.SPECIAL_ANNOTATIONS) return null + return loadAnnotation(annotationClassId, result) + } + + private fun ConeClassLikeLookupTag.toDefaultResolvedTypeRef(): FirResolvedTypeRef = + buildResolvedTypeRef { + type = constructClassType(emptyArray(), isNullable = false) + } +} \ No newline at end of file diff --git a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/deserialization/JvmBinaryAnnotationDeserializer.kt b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/deserialization/JvmBinaryAnnotationDeserializer.kt index 5ad766e1620..1f420bc49cd 100644 --- a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/deserialization/JvmBinaryAnnotationDeserializer.kt +++ b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/deserialization/JvmBinaryAnnotationDeserializer.kt @@ -268,6 +268,7 @@ private data class MemberAnnotations(val memberAnnotations: MutableMap>() + val annotationsLoader = AnnotationsLoader(this) kotlinBinaryClass.visitMembers(object : KotlinJvmBinaryClass.MemberVisitor { override fun visitMethod(name: Name, desc: String): KotlinJvmBinaryClass.MethodAnnotationVisitor? { @@ -296,7 +297,7 @@ private fun FirSession.loadMemberAnnotations(kotlinBinaryClass: KotlinJvmBinaryC result = arrayListOf() memberAnnotations[paramSignature] = result } - return loadAnnotationIfNotSpecial(classId, result) + return annotationsLoader.loadAnnotationIfNotSpecial(classId, result) } } @@ -304,7 +305,7 @@ private fun FirSession.loadMemberAnnotations(kotlinBinaryClass: KotlinJvmBinaryC private val result = arrayListOf() override fun visitAnnotation(classId: ClassId, source: SourceElement): KotlinJvmBinaryClass.AnnotationArgumentVisitor? { - return loadAnnotationIfNotSpecial(classId, result) + return annotationsLoader.loadAnnotationIfNotSpecial(classId, result) } override fun visitEnd() { @@ -316,15 +317,4 @@ private fun FirSession.loadMemberAnnotations(kotlinBinaryClass: KotlinJvmBinaryC }, byteContent) return MemberAnnotations(memberAnnotations) -} - -// TODO: Or, better to migrate annotation deserialization in KotlinDeserializedJvmSymbolsProvider to here? -private fun FirSession.loadAnnotationIfNotSpecial( - annotationClassId: ClassId, - result: MutableList -): KotlinJvmBinaryClass.AnnotationArgumentVisitor? = - (firSymbolProvider as? FirCompositeSymbolProvider) - ?.providers - ?.filterIsInstance() - ?.singleOrNull() - ?.loadAnnotationIfNotSpecial(annotationClassId, result) +} \ No newline at end of file diff --git a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/deserialization/KotlinDeserializedJvmSymbolsProvider.kt b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/deserialization/KotlinDeserializedJvmSymbolsProvider.kt index 2afb5ac1777..31e2d300ca9 100644 --- a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/deserialization/KotlinDeserializedJvmSymbolsProvider.kt +++ b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/deserialization/KotlinDeserializedJvmSymbolsProvider.kt @@ -7,7 +7,6 @@ package org.jetbrains.kotlin.fir.java.deserialization import com.intellij.openapi.progress.ProcessCanceledException import com.intellij.openapi.project.Project -import org.jetbrains.kotlin.SpecialJvmAnnotations import org.jetbrains.kotlin.descriptors.SourceElement import org.jetbrains.kotlin.fir.FirSession import org.jetbrains.kotlin.fir.ThreadSafeMutableState @@ -16,27 +15,15 @@ import org.jetbrains.kotlin.fir.declarations.* import org.jetbrains.kotlin.fir.deserialization.FirConstDeserializer import org.jetbrains.kotlin.fir.deserialization.FirDeserializationContext import org.jetbrains.kotlin.fir.deserialization.deserializeClassToSymbol -import org.jetbrains.kotlin.fir.diagnostics.ConeSimpleDiagnostic -import org.jetbrains.kotlin.fir.diagnostics.DiagnosticKind import org.jetbrains.kotlin.fir.expressions.* import org.jetbrains.kotlin.fir.expressions.builder.* import org.jetbrains.kotlin.fir.java.JavaSymbolProvider -import org.jetbrains.kotlin.fir.java.createConstantOrError import org.jetbrains.kotlin.fir.java.topLevelName -import org.jetbrains.kotlin.fir.references.builder.buildErrorNamedReference -import org.jetbrains.kotlin.fir.references.builder.buildResolvedNamedReference -import org.jetbrains.kotlin.fir.references.impl.FirReferencePlaceholderForResolvedAnnotations -import org.jetbrains.kotlin.fir.resolve.firSymbolProvider import org.jetbrains.kotlin.fir.resolve.providers.* import org.jetbrains.kotlin.fir.scopes.KotlinScopeProvider -import org.jetbrains.kotlin.fir.symbols.ConeClassLikeLookupTag import org.jetbrains.kotlin.fir.symbols.impl.* -import org.jetbrains.kotlin.fir.types.FirResolvedTypeRef -import org.jetbrains.kotlin.fir.types.builder.buildResolvedTypeRef -import org.jetbrains.kotlin.fir.types.constructClassType import org.jetbrains.kotlin.load.java.JavaClassFinder import org.jetbrains.kotlin.load.kotlin.* -import org.jetbrains.kotlin.load.kotlin.KotlinJvmBinaryClass.AnnotationArrayArgumentVisitor import org.jetbrains.kotlin.load.kotlin.header.KotlinClassHeader import org.jetbrains.kotlin.metadata.ProtoBuf import org.jetbrains.kotlin.metadata.deserialization.Flags @@ -47,7 +34,6 @@ import org.jetbrains.kotlin.name.ClassId import org.jetbrains.kotlin.name.FqName import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.name.isOneSegmentFQN -import org.jetbrains.kotlin.resolve.constants.ClassLiteralValue import org.jetbrains.kotlin.resolve.jvm.JvmClassName import org.jetbrains.kotlin.serialization.deserialization.IncompatibleVersionErrorData import org.jetbrains.kotlin.serialization.deserialization.getName @@ -63,6 +49,7 @@ class KotlinDeserializedJvmSymbolsProvider( private val javaClassFinder: JavaClassFinder, private val kotlinScopeProvider: KotlinScopeProvider, ) : FirSymbolProvider(session) { + private val annotationsLoader = AnnotationsLoader(session) private val classCache = SymbolProviderCache() private val typeAliasCache = SymbolProviderCache() private val packagePartsCache = SymbolProviderCache>() @@ -159,137 +146,6 @@ class KotlinDeserializedJvmSymbolsProvider( return JvmProtoBufUtil.readClassDataFrom(data, strings) } - private fun ConeClassLikeLookupTag.toDefaultResolvedTypeRef(): FirResolvedTypeRef = - buildResolvedTypeRef { - type = constructClassType(emptyArray(), isNullable = false) - } - - private fun loadAnnotation( - annotationClassId: ClassId, result: MutableList, - ): KotlinJvmBinaryClass.AnnotationArgumentVisitor { - val lookupTag = ConeClassLikeLookupTagImpl(annotationClassId) - - return object : KotlinJvmBinaryClass.AnnotationArgumentVisitor { - private val argumentMap = mutableMapOf() - - override fun visit(name: Name?, value: Any?) { - if (name != null) { - argumentMap[name] = createConstant(value) - } - } - - private fun ClassLiteralValue.toFirClassReferenceExpression(): FirClassReferenceExpression { - val literalLookupTag = ConeClassLikeLookupTagImpl(classId) - return buildClassReferenceExpression { - classTypeRef = literalLookupTag.toDefaultResolvedTypeRef() - } - } - - private fun ClassId.toEnumEntryReferenceExpression(name: Name): FirExpression { - return buildFunctionCall { - val entryPropertySymbol = - this@KotlinDeserializedJvmSymbolsProvider.session.firSymbolProvider.getClassDeclaredPropertySymbols( - this@toEnumEntryReferenceExpression, name, - ).firstOrNull() - - calleeReference = when { - entryPropertySymbol != null -> { - buildResolvedNamedReference { - this.name = name - resolvedSymbol = entryPropertySymbol - } - } - else -> { - buildErrorNamedReference { - diagnostic = ConeSimpleDiagnostic( - "Strange deserialized enum value: ${this@toEnumEntryReferenceExpression}.$name", - DiagnosticKind.Java, - ) - } - } - } - } - } - - override fun visitClassLiteral(name: Name, value: ClassLiteralValue) { - argumentMap[name] = buildGetClassCall { - argumentList = buildUnaryArgumentList(value.toFirClassReferenceExpression()) - } - } - - override fun visitEnum(name: Name, enumClassId: ClassId, enumEntryName: Name) { - argumentMap[name] = enumClassId.toEnumEntryReferenceExpression(enumEntryName) - } - - override fun visitArray(name: Name): AnnotationArrayArgumentVisitor { - return object : AnnotationArrayArgumentVisitor { - private val elements = mutableListOf() - - override fun visit(value: Any?) { - elements.add(createConstant(value)) - } - - override fun visitEnum(enumClassId: ClassId, enumEntryName: Name) { - elements.add(enumClassId.toEnumEntryReferenceExpression(enumEntryName)) - } - - override fun visitClassLiteral(value: ClassLiteralValue) { - elements.add( - buildGetClassCall { - argumentList = buildUnaryArgumentList(value.toFirClassReferenceExpression()) - } - ) - } - - override fun visitEnd() { - argumentMap[name] = buildArrayOfCall { - argumentList = buildArgumentList { - arguments += elements - } - } - } - } - } - - override fun visitAnnotation(name: Name, classId: ClassId): KotlinJvmBinaryClass.AnnotationArgumentVisitor { - val list = mutableListOf() - val visitor = loadAnnotation(classId, list) - return object : KotlinJvmBinaryClass.AnnotationArgumentVisitor by visitor { - override fun visitEnd() { - visitor.visitEnd() - argumentMap[name] = list.single() - } - } - } - - override fun visitEnd() { - result += buildAnnotationCall { - annotationTypeRef = lookupTag.toDefaultResolvedTypeRef() - argumentList = buildArgumentList { - for ((name, expression) in argumentMap) { - arguments += buildNamedArgumentExpression { - this.expression = expression - this.name = name - isSpread = false - } - } - } - calleeReference = FirReferencePlaceholderForResolvedAnnotations - } - } - - private fun createConstant(value: Any?): FirExpression { - return value.createConstantOrError(session) - } - } - } - - internal fun loadAnnotationIfNotSpecial( - annotationClassId: ClassId, result: MutableList, - ): KotlinJvmBinaryClass.AnnotationArgumentVisitor? { - if (annotationClassId in SpecialJvmAnnotations.SPECIAL_ANNOTATIONS) return null - return loadAnnotation(annotationClassId, result) - } private fun findAndDeserializeClassViaParent(classId: ClassId): FirRegularClassSymbol? { val outerClassId = classId.outerClassId ?: return null @@ -344,7 +200,7 @@ class KotlinDeserializedJvmSymbolsProvider( kotlinJvmBinaryClass.loadClassAnnotations( object : KotlinJvmBinaryClass.AnnotationVisitor { override fun visitAnnotation(classId: ClassId, source: SourceElement): KotlinJvmBinaryClass.AnnotationArgumentVisitor? { - return loadAnnotationIfNotSpecial(classId, annotations) + return annotationsLoader.loadAnnotationIfNotSpecial(classId, annotations) } override fun visitEnd() { @@ -415,4 +271,4 @@ private class KnownNameInPackageCache(session: FirSession, private val javaClass val knownNames = knownClassNamesInPackage.getValue(classId.packageFqName) ?: return false return classId.relativeClassName.topLevelName() !in knownNames } -} +} \ No newline at end of file From b270d66f6826426edfef063c3bdd2b02bd0f7071 Mon Sep 17 00:00:00 2001 From: Ilya Kirillov Date: Tue, 19 Jan 2021 17:15:43 +0100 Subject: [PATCH 089/212] FIR: use FirCachesFactory for class cache in KotlinDeserializedJvmSymbolsProvider --- .../KotlinDeserializedJvmSymbolsProvider.kt | 72 +++++++++++-------- .../api/sessions/FirIdeSessionFactory.kt | 1 - 2 files changed, 42 insertions(+), 31 deletions(-) diff --git a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/deserialization/KotlinDeserializedJvmSymbolsProvider.kt b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/deserialization/KotlinDeserializedJvmSymbolsProvider.kt index 31e2d300ca9..eed93a2ec38 100644 --- a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/deserialization/KotlinDeserializedJvmSymbolsProvider.kt +++ b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/deserialization/KotlinDeserializedJvmSymbolsProvider.kt @@ -10,7 +10,7 @@ import com.intellij.openapi.project.Project import org.jetbrains.kotlin.descriptors.SourceElement import org.jetbrains.kotlin.fir.FirSession import org.jetbrains.kotlin.fir.ThreadSafeMutableState -import org.jetbrains.kotlin.fir.caches.firCachesFactory +import org.jetbrains.kotlin.fir.caches.* import org.jetbrains.kotlin.fir.declarations.* import org.jetbrains.kotlin.fir.deserialization.FirConstDeserializer import org.jetbrains.kotlin.fir.deserialization.FirDeserializationContext @@ -50,14 +50,22 @@ class KotlinDeserializedJvmSymbolsProvider( private val kotlinScopeProvider: KotlinScopeProvider, ) : FirSymbolProvider(session) { private val annotationsLoader = AnnotationsLoader(session) - private val classCache = SymbolProviderCache() private val typeAliasCache = SymbolProviderCache() private val packagePartsCache = SymbolProviderCache>() + private val classCache = + session.firCachesFactory.createCacheWithPostCompute( + createValue = { classId, context -> findAndDeserializeClass(classId, context) }, + postCompute = { _, symbol, result -> + if (result != null && symbol != null) { + postCompute(result.kotlinJvmBinaryClass, result.byteContent, symbol) + } + } + ) + + private val knownNameInPackageCache = KnownNameInPackageCache(session, javaClassFinder) - // TODO: implement thread safety for this property - private val handledByJava = HashSet() private class PackagePartsCacheData( val proto: ProtoBuf.Package, @@ -123,7 +131,7 @@ class KotlinDeserializedJvmSymbolsProvider( get() = classHeader.isPreRelease override fun getClassLikeSymbolByFqName(classId: ClassId): FirClassLikeSymbol<*>? { - return findAndDeserializeClass(classId) ?: findAndDeserializeTypeAlias(classId) + return getClass(classId) ?: findAndDeserializeTypeAlias(classId) } private fun findAndDeserializeTypeAlias( @@ -149,53 +157,58 @@ class KotlinDeserializedJvmSymbolsProvider( private fun findAndDeserializeClassViaParent(classId: ClassId): FirRegularClassSymbol? { val outerClassId = classId.outerClassId ?: return null - findAndDeserializeClass(outerClassId) ?: return null - return classCache[classId] + getClass(outerClassId) ?: return null + return classCache.getValueIfComputed(classId) + } + + private fun getClass( + classId: ClassId, + parentContext: FirDeserializationContext? = null + ): FirRegularClassSymbol? { + return classCache.getValue(classId, parentContext) } private fun findAndDeserializeClass( classId: ClassId, parentContext: FirDeserializationContext? = null - ): FirRegularClassSymbol? { - if (knownNameInPackageCache.hasNoTopLevelClassOf(classId)) return null - if (classId in classCache) return classCache[classId] - - if (classId in handledByJava) return null - + ): Pair { + if (knownNameInPackageCache.hasNoTopLevelClassOf(classId)) return null to null val result = try { kotlinClassFinder.findKotlinClassOrContent(classId) } catch (e: ProcessCanceledException) { - return null + return null to null } - val (kotlinJvmBinaryClass, byteContent) = when (result) { + val kotlinClass = when (result) { is KotlinClassFinder.Result.KotlinClass -> result is KotlinClassFinder.Result.ClassFileContent -> { - handledByJava.add(classId) - return try { - javaSymbolProvider.getFirJavaClass(classId, result) - } catch (e: ProcessCanceledException) { - null - } + return javaSymbolProvider.getFirJavaClass(classId, result) to null } - null -> return findAndDeserializeClassViaParent(classId) + null -> return findAndDeserializeClassViaParent(classId) to null } - if (kotlinJvmBinaryClass.classHeader.kind != KotlinClassHeader.Kind.CLASS) return null - val (nameResolver, classProto) = kotlinJvmBinaryClass.readClassDataFrom() ?: return null + if (kotlinClass.kotlinJvmBinaryClass.classHeader.kind != KotlinClassHeader.Kind.CLASS) return null to null + val (nameResolver, classProto) = kotlinClass.kotlinJvmBinaryClass.readClassDataFrom() ?: return null to null if (parentContext == null && Flags.CLASS_KIND.get(classProto.flags) == ProtoBuf.Class.Kind.COMPANION_OBJECT) { - return findAndDeserializeClassViaParent(classId) + return findAndDeserializeClassViaParent(classId) to null } val symbol = FirRegularClassSymbol(classId) deserializeClassToSymbol( classId, classProto, symbol, nameResolver, session, - JvmBinaryAnnotationDeserializer(session, kotlinJvmBinaryClass, byteContent), + JvmBinaryAnnotationDeserializer(session, kotlinClass.kotlinJvmBinaryClass, kotlinClass.byteContent), kotlinScopeProvider, - parentContext, KotlinJvmBinarySourceElement(kotlinJvmBinaryClass), - this::findAndDeserializeClass + parentContext, KotlinJvmBinarySourceElement(kotlinClass.kotlinJvmBinaryClass), + this::getClass ) - classCache[classId] = symbol + return symbol to kotlinClass + } + + fun postCompute( + kotlinJvmBinaryClass: KotlinJvmBinaryClass, + byteContent: ByteArray?, + symbol: FirRegularClassSymbol + ) { val annotations = mutableListOf() kotlinJvmBinaryClass.loadClassAnnotations( object : KotlinJvmBinaryClass.AnnotationVisitor { @@ -209,7 +222,6 @@ class KotlinDeserializedJvmSymbolsProvider( byteContent, ) (symbol.fir.annotations as MutableList) += annotations - return symbol } private fun loadFunctionsByName(part: PackagePartsCacheData, name: Name): List { diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/sessions/FirIdeSessionFactory.kt b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/sessions/FirIdeSessionFactory.kt index c7ee4898822..c4dcfb42c2f 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/sessions/FirIdeSessionFactory.kt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/sessions/FirIdeSessionFactory.kt @@ -38,7 +38,6 @@ import org.jetbrains.kotlin.idea.fir.low.level.api.fir.caches.FirThreadSafeCache import org.jetbrains.kotlin.idea.fir.low.level.api.lazy.resolve.FirLazyDeclarationResolver import org.jetbrains.kotlin.idea.fir.low.level.api.providers.FirModuleWithDependenciesSymbolProvider import org.jetbrains.kotlin.idea.fir.low.level.api.providers.FirIdeProvider -import org.jetbrains.kotlin.idea.fir.low.level.api.sessions.FirIdeSessionFactory.registerIdeComponents import org.jetbrains.kotlin.idea.fir.low.level.api.providers.FirThreadSafeSymbolProviderWrapper import org.jetbrains.kotlin.idea.fir.low.level.api.util.ModuleLibrariesSearchScope import org.jetbrains.kotlin.idea.fir.low.level.api.util.checkCanceled From 32ae395e05565660fbdf8dcfbb2a07ca04562e1e Mon Sep 17 00:00:00 2001 From: Ilya Kirillov Date: Tue, 19 Jan 2021 19:11:56 +0100 Subject: [PATCH 090/212] FIR: use FirCachesFactory for package type alias in KotlinDeserializedJvmSymbolsProvider --- .../KotlinDeserializedJvmSymbolsProvider.kt | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/deserialization/KotlinDeserializedJvmSymbolsProvider.kt b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/deserialization/KotlinDeserializedJvmSymbolsProvider.kt index eed93a2ec38..12d14b57009 100644 --- a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/deserialization/KotlinDeserializedJvmSymbolsProvider.kt +++ b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/deserialization/KotlinDeserializedJvmSymbolsProvider.kt @@ -50,7 +50,7 @@ class KotlinDeserializedJvmSymbolsProvider( private val kotlinScopeProvider: KotlinScopeProvider, ) : FirSymbolProvider(session) { private val annotationsLoader = AnnotationsLoader(session) - private val typeAliasCache = SymbolProviderCache() + private val typeAliasCache = session.firCachesFactory.createCache(::findAndDeserializeTypeAlias) private val packagePartsCache = SymbolProviderCache>() private val classCache = @@ -131,20 +131,22 @@ class KotlinDeserializedJvmSymbolsProvider( get() = classHeader.isPreRelease override fun getClassLikeSymbolByFqName(classId: ClassId): FirClassLikeSymbol<*>? { - return getClass(classId) ?: findAndDeserializeTypeAlias(classId) + return getClass(classId) ?: getTypeAlias(classId) } - private fun findAndDeserializeTypeAlias( + private fun getTypeAlias( classId: ClassId, ): FirTypeAliasSymbol? { if (!classId.relativeClassName.isOneSegmentFQN()) return null - return typeAliasCache.lookupCacheOrCalculate(classId) { - getPackageParts(classId.packageFqName).firstNotNullResult { part -> - val ids = part.typeAliasNameIndex[classId.shortClassName] - if (ids == null || ids.isEmpty()) return@firstNotNullResult null - val aliasProto = ids.map { part.proto.getTypeAlias(it) }.single() - part.context.memberDeserializer.loadTypeAlias(aliasProto).symbol - } + return typeAliasCache.getValue(classId) + } + + private fun findAndDeserializeTypeAlias(classId: ClassId): FirTypeAliasSymbol? { + return getPackageParts(classId.packageFqName).firstNotNullResult { part -> + val ids = part.typeAliasNameIndex[classId.shortClassName] + if (ids == null || ids.isEmpty()) return@firstNotNullResult null + val aliasProto = ids.map { part.proto.getTypeAlias(it) }.single() + part.context.memberDeserializer.loadTypeAlias(aliasProto).symbol } } From 6543429b9a50873021123f28113ed468025d3130 Mon Sep 17 00:00:00 2001 From: Ilya Kirillov Date: Tue, 19 Jan 2021 19:13:22 +0100 Subject: [PATCH 091/212] FIR: use FirCachesFactory for package parts cache in KotlinDeserializedJvmSymbolsProvider --- .../KotlinDeserializedJvmSymbolsProvider.kt | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/deserialization/KotlinDeserializedJvmSymbolsProvider.kt b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/deserialization/KotlinDeserializedJvmSymbolsProvider.kt index 12d14b57009..ab7f0ab23d0 100644 --- a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/deserialization/KotlinDeserializedJvmSymbolsProvider.kt +++ b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/deserialization/KotlinDeserializedJvmSymbolsProvider.kt @@ -51,7 +51,7 @@ class KotlinDeserializedJvmSymbolsProvider( ) : FirSymbolProvider(session) { private val annotationsLoader = AnnotationsLoader(session) private val typeAliasCache = session.firCachesFactory.createCache(::findAndDeserializeTypeAlias) - private val packagePartsCache = SymbolProviderCache>() + private val packagePartsCache = session.firCachesFactory.createCache(::tryComputePackagePartInfos) private val classCache = session.firCachesFactory.createCacheWithPostCompute( @@ -262,13 +262,15 @@ class KotlinDeserializedJvmSymbolsProvider( } private fun getPackageParts(packageFqName: FqName): Collection { - return packagePartsCache.lookupCacheOrCalculate(packageFqName) { - try { - computePackagePartsInfos(packageFqName) - } catch (e: ProcessCanceledException) { - emptyList() - } - }!! + return packagePartsCache.getValue(packageFqName) + } + + private fun tryComputePackagePartInfos(packageFqName: FqName): List { + return try { + computePackagePartsInfos(packageFqName) + } catch (e: ProcessCanceledException) { + emptyList() + } } override fun getPackage(fqName: FqName): FqName? = null From 6a83b8b5a4f2636c6c9fd16139d401ae0dc552d5 Mon Sep 17 00:00:00 2001 From: Ilya Kirillov Date: Wed, 20 Jan 2021 17:31:42 +0100 Subject: [PATCH 092/212] FIR: migrate FirDependenciesSymbolProviderImpl to FirCachesFactory --- .../impl/FirDependenciesSymbolProviderImpl.kt | 74 +++++++++---------- 1 file changed, 35 insertions(+), 39 deletions(-) diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/providers/impl/FirDependenciesSymbolProviderImpl.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/providers/impl/FirDependenciesSymbolProviderImpl.kt index 98ffefa6c29..833837538fb 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/providers/impl/FirDependenciesSymbolProviderImpl.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/providers/impl/FirDependenciesSymbolProviderImpl.kt @@ -7,11 +7,11 @@ package org.jetbrains.kotlin.fir.resolve.providers.impl import org.jetbrains.kotlin.fir.FirSession import org.jetbrains.kotlin.fir.ThreadSafeMutableState +import org.jetbrains.kotlin.fir.caches.* import org.jetbrains.kotlin.fir.dependenciesWithoutSelf import org.jetbrains.kotlin.fir.resolve.firSymbolProvider import org.jetbrains.kotlin.fir.resolve.providers.FirSymbolProvider import org.jetbrains.kotlin.fir.resolve.providers.FirSymbolProviderInternals -import org.jetbrains.kotlin.fir.resolve.providers.SymbolProviderCache import org.jetbrains.kotlin.fir.symbols.CallableId import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol import org.jetbrains.kotlin.fir.symbols.impl.FirClassLikeSymbol @@ -20,14 +20,16 @@ import org.jetbrains.kotlin.fir.symbols.impl.FirPropertySymbol import org.jetbrains.kotlin.name.ClassId import org.jetbrains.kotlin.name.FqName import org.jetbrains.kotlin.name.Name +import org.jetbrains.kotlin.utils.addToStdlib.firstNotNullResult @ThreadSafeMutableState open class FirDependenciesSymbolProviderImpl(session: FirSession) : FirSymbolProvider(session) { - private val classCache = SymbolProviderCache>() - private val topLevelCallableCache = SymbolProviderCache>>() - private val topLevelFunctionCache = SymbolProviderCache>() - private val topLevelPropertyCache = SymbolProviderCache>() - private val packageCache = SymbolProviderCache() + private val classCache = session.firCachesFactory.createCache(::computeClass) + private val topLevelCallableCache = session.firCachesFactory.createCache(::computeTopLevelCallables) + private val topLevelFunctionCache = session.firCachesFactory.createCache(::computeTopLevelFunctions) + private val topLevelPropertyCache = session.firCachesFactory.createCache(::computeTopLevelProperties) + private val packageCache = session.firCachesFactory.createCache(::computePackage) + protected open val dependencyProviders by lazy { val moduleInfo = session.moduleInfo ?: return@lazy emptyList() @@ -36,26 +38,36 @@ open class FirDependenciesSymbolProviderImpl(session: FirSession) : FirSymbolPro }.toList() } + @OptIn(FirSymbolProviderInternals::class, ExperimentalStdlibApi::class) + private fun computeTopLevelCallables(callableId: CallableId): List> = buildList { + dependencyProviders.forEach { it.getTopLevelCallableSymbolsTo(this, callableId.packageName, callableId.callableName) } + } + + @OptIn(FirSymbolProviderInternals::class, ExperimentalStdlibApi::class) + private fun computeTopLevelFunctions(callableId: CallableId): List = buildList { + dependencyProviders.forEach { it.getTopLevelFunctionSymbolsTo(this, callableId.packageName, callableId.callableName) } + } + + @OptIn(FirSymbolProviderInternals::class, ExperimentalStdlibApi::class) + private fun computeTopLevelProperties(callableId: CallableId): List = buildList { + dependencyProviders.forEach { it.getTopLevelPropertySymbolsTo(this, callableId.packageName, callableId.callableName) } + } + + private fun computePackage(it: FqName): FqName? = + dependencyProviders.firstNotNullResult { provider -> provider.getPackage(it) } + + private fun computeClass(classId: ClassId): FirClassLikeSymbol<*>? = + dependencyProviders.firstNotNullResult { provider -> provider.getClassLikeSymbolByFqName(classId) } + + @FirSymbolProviderInternals override fun getTopLevelFunctionSymbolsTo(destination: MutableList, packageFqName: FqName, name: Name) { - destination += topLevelFunctionCache.lookupCacheOrCalculate(CallableId(packageFqName, null, name)) { - val result = mutableListOf() - dependencyProviders.forEach { - it.getTopLevelFunctionSymbolsTo(result, packageFqName, name) - } - result - } ?: emptyList() + destination += topLevelFunctionCache.getValue(CallableId(packageFqName, name)) } @FirSymbolProviderInternals override fun getTopLevelPropertySymbolsTo(destination: MutableList, packageFqName: FqName, name: Name) { - destination += topLevelPropertyCache.lookupCacheOrCalculate(CallableId(packageFqName, null, name)) { - val result = mutableListOf() - dependencyProviders.forEach { - it.getTopLevelPropertySymbolsTo(result, packageFqName, name) - } - result - } ?: emptyList() + destination += topLevelPropertyCache.getValue(CallableId(packageFqName, name)) } @FirSymbolProviderInternals @@ -64,30 +76,14 @@ open class FirDependenciesSymbolProviderImpl(session: FirSession) : FirSymbolPro } override fun getTopLevelCallableSymbols(packageFqName: FqName, name: Name): List> { - return topLevelCallableCache.lookupCacheOrCalculate(CallableId(packageFqName, null, name)) { - dependencyProviders.flatMap { provider -> provider.getTopLevelCallableSymbols(packageFqName, name) } - } ?: emptyList() + return topLevelCallableCache.getValue(CallableId(packageFqName, name)) } override fun getClassLikeSymbolByFqName(classId: ClassId): FirClassLikeSymbol<*>? { - return classCache.lookupCacheOrCalculate(classId) { - for (provider in dependencyProviders) { - provider.getClassLikeSymbolByFqName(classId)?.let { - return@lookupCacheOrCalculate it - } - } - null - } + return classCache.getValue(classId) } override fun getPackage(fqName: FqName): FqName? { - return packageCache.lookupCacheOrCalculate(fqName) { - for (provider in dependencyProviders) { - provider.getPackage(fqName)?.let { - return@lookupCacheOrCalculate it - } - } - null - } + return packageCache.getValue(fqName) } } From 9f5b46cc76d12a47d7629fbf0ed9f91280e8b7b9 Mon Sep 17 00:00:00 2001 From: Ilya Kirillov Date: Wed, 27 Jan 2021 14:29:53 +0100 Subject: [PATCH 093/212] FIR: use MutableMap in JavaSymbolProvider.parentClassTypeParameterStackCache as temp solution parentClassTypeParameterStackCache will be soon removed as will SymbolProviderCache --- .../src/org/jetbrains/kotlin/fir/java/JavaSymbolProvider.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 856d4f108f3..cbeb0969e5a 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 @@ -68,8 +68,7 @@ class JavaSymbolProvider( private val scopeProvider = JavaScopeProvider(::wrapScopeWithJvmMapped, this) private val facade: KotlinJavaPsiFacade get() = KotlinJavaPsiFacade.getInstance(project) - private val parentClassTypeParameterStackCache: SymbolProviderCache = - SymbolProviderCache() + private val parentClassTypeParameterStackCache = mutableMapOf() private fun findClass( classId: ClassId, From c53d6ed5d2b18d53e2901a8a71aeb6dfac5b325f Mon Sep 17 00:00:00 2001 From: Ilya Kirillov Date: Wed, 20 Jan 2021 17:39:52 +0100 Subject: [PATCH 094/212] FIR: remove SymbolProviderCache as it is unused now --- .../resolve/providers/SymbolProviderCache.kt | 48 ------------------- 1 file changed, 48 deletions(-) delete mode 100644 compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/providers/SymbolProviderCache.kt diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/providers/SymbolProviderCache.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/providers/SymbolProviderCache.kt deleted file mode 100644 index 451c738d3fc..00000000000 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/providers/SymbolProviderCache.kt +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package org.jetbrains.kotlin.fir.resolve.providers - -import org.jetbrains.kotlin.fir.PrivateForInline - -@Suppress("EXPERIMENTAL_FEATURE_WARNING") -inline class SymbolProviderCache @PrivateForInline constructor(@PrivateForInline val cache: HashMap) { - @OptIn(PrivateForInline::class) - constructor() : this(HashMap()) - - @PrivateForInline - object NullValue - - @OptIn(PrivateForInline::class) - inline fun lookupCacheOrCalculate(key: K, crossinline l: (K) -> V?): V? { - @Suppress("UNCHECKED_CAST") - return when (val value = cache[key]) { - null -> { - val calculated = l(key) - cache[key] = calculated ?: NullValue - calculated - } - NullValue -> null - else -> value as V - } - } - - @OptIn(PrivateForInline::class) - operator fun contains(key: K): Boolean = key in cache - - @Suppress("UNCHECKED_CAST") - @OptIn(PrivateForInline::class) - operator fun get(key: K): V? = cache[key].takeIf { it !== NullValue } as V? - - @OptIn(PrivateForInline::class) - operator fun set(key: K, value: V) { - cache[key] = value - } - - @OptIn(PrivateForInline::class) - fun remove(key: K) { - cache.remove(key) - } -} From 1d167e4bc5c93613fe333a2fe38c87454b991815 Mon Sep 17 00:00:00 2001 From: Ilya Kirillov Date: Thu, 21 Jan 2021 10:47:17 +0100 Subject: [PATCH 095/212] FIR: enable inline classes support in kotlin.compiler.fir.tree module --- compiler/fir/tree/build.gradle.kts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/compiler/fir/tree/build.gradle.kts b/compiler/fir/tree/build.gradle.kts index 8a6b4d3d1e1..f2a608fb727 100644 --- a/compiler/fir/tree/build.gradle.kts +++ b/compiler/fir/tree/build.gradle.kts @@ -56,3 +56,9 @@ if (kotlinBuildProperties.isInJpsBuildIdeaSync) { this.module.generatedSourceDirs.add(generationRoot) } } + +kotlin { + sourceSets.all { + languageSettings.enableLanguageFeature("InlineClasses") + } +} \ No newline at end of file From 9b429fb535fc53a3be57bf5345026df328ffc0e4 Mon Sep 17 00:00:00 2001 From: Ilya Kirillov Date: Wed, 27 Jan 2021 21:11:42 +0100 Subject: [PATCH 096/212] FIR IDE: update testdata --- .../testData/symbolsByFqName/fileWalkDirectionEnum.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/idea/idea-frontend-fir/testData/symbolsByFqName/fileWalkDirectionEnum.txt b/idea/idea-frontend-fir/testData/symbolsByFqName/fileWalkDirectionEnum.txt index f948399b035..6d86b556205 100644 --- a/idea/idea-frontend-fir/testData/symbolsByFqName/fileWalkDirectionEnum.txt +++ b/idea/idea-frontend-fir/testData/symbolsByFqName/fileWalkDirectionEnum.txt @@ -24,8 +24,8 @@ KtFirFunctionSymbol: KtFirFunctionSymbol: annotatedType: [] kotlin/collections/List - annotationClassIds: [] - annotations: [] + annotationClassIds: [kotlin/internal/InlineOnly] + annotations: [kotlin/internal/InlineOnly()] callableIdIfNonLocal: kotlin.collections.listOf dispatchType: null isExtension: false From 46b7a774b558001c136be225cf4367fa09ba1aee Mon Sep 17 00:00:00 2001 From: Abduqodiri Qurbonzoda Date: Tue, 13 Oct 2020 02:39:07 +0300 Subject: [PATCH 097/212] Commonize CharCategory and related functions #KT-39177 #KT-43216 #KT-39906 #KT-30652 --- libraries/stdlib/api/js-v1/kotlin.text.kt | 87 ++++++++ libraries/stdlib/api/js/kotlin.text.kt | 87 ++++++++ libraries/stdlib/common/src/kotlin/TextH.kt | 1 - .../js-ir/src/generated/_CharCategories.kt | 84 +++++++ .../stdlib/js-ir/src/generated/_DigitChars.kt | 47 ++++ .../js-ir/src/generated/_LetterChars.kt | 114 ++++++++++ .../js-ir/src/generated/_WhitespaceChars.kt | 31 +++ .../js/src/generated/_CharCategories.kt | 84 +++++++ .../stdlib/js/src/generated/_DigitChars.kt | 47 ++++ .../stdlib/js/src/generated/_LetterChars.kt | 114 ++++++++++ .../js/src/generated/_WhitespaceChars.kt | 31 +++ .../js/src/kotlin/text/CharCategoryJS.kt | 172 ++++++++++++++ libraries/stdlib/js/src/kotlin/text/char.kt | 142 +++++++++++- .../jvm/src/kotlin/text/CharCategoryJVM.kt | 177 +++++++++++++++ .../stdlib/jvm/src/kotlin/text/CharJVM.kt | 46 ++-- libraries/stdlib/src/kotlin/text/Char.kt | 85 +++++++ .../{jvm => }/src/kotlin/text/CharCategory.kt | 78 ++++--- libraries/stdlib/test/text/CharTest.kt | 155 +++++++++++++ libraries/stdlib/wasm/src/kotlin/Text.kt | 87 +++++++- .../wasm/src/kotlin/text/CharCategory.kt | 171 ++++++++++++++ .../tools/kotlin-stdlib-gen/build.gradle | 7 + .../generators/unicode/GenerateUnicodeData.kt | 99 +++++++++ .../ranges/CharCategoryTestGenerator.kt | 173 +++++++++++++++ .../unicode/ranges/RangesGenerator.kt | 72 ++++++ .../unicode/ranges/RangesWritingStrategy.kt | 56 +++++ .../builders/CharCategoryRangesBuilder.kt | 47 ++++ .../ranges/builders/DigitRangesBuilder.kt | 25 +++ .../ranges/builders/LetterPatternBuilder.kt | 89 ++++++++ .../unicode/ranges/builders/RangesBuilder.kt | 192 ++++++++++++++++ .../builders/WhitespaceRangesBuilder.kt | 43 ++++ .../ranges/patterns/GapRangePattern.kt | 138 ++++++++++++ .../ranges/patterns/PeriodicRangePattern.kt | 195 ++++++++++++++++ .../unicode/ranges/patterns/RangePattern.kt | 61 +++++ .../ranges/writers/CategoryRangesWriter.kt | 172 ++++++++++++++ .../ranges/writers/DigitRangesWriter.kt | 60 +++++ .../unicode/ranges/writers/FileWriterUtils.kt | 76 +++++++ .../ranges/writers/LetterRangesWriter.kt | 210 ++++++++++++++++++ .../unicode/ranges/writers/RangesWriter.kt | 12 + .../ranges/writers/WhitespaceRangesWriter.kt | 62 ++++++ .../src/templates/dsl/Writers.kt | 6 +- 40 files changed, 3573 insertions(+), 62 deletions(-) create mode 100644 libraries/stdlib/js-ir/src/generated/_CharCategories.kt create mode 100644 libraries/stdlib/js-ir/src/generated/_DigitChars.kt create mode 100644 libraries/stdlib/js-ir/src/generated/_LetterChars.kt create mode 100644 libraries/stdlib/js-ir/src/generated/_WhitespaceChars.kt create mode 100644 libraries/stdlib/js/src/generated/_CharCategories.kt create mode 100644 libraries/stdlib/js/src/generated/_DigitChars.kt create mode 100644 libraries/stdlib/js/src/generated/_LetterChars.kt create mode 100644 libraries/stdlib/js/src/generated/_WhitespaceChars.kt create mode 100644 libraries/stdlib/js/src/kotlin/text/CharCategoryJS.kt create mode 100644 libraries/stdlib/jvm/src/kotlin/text/CharCategoryJVM.kt rename libraries/stdlib/{jvm => }/src/kotlin/text/CharCategory.kt (52%) create mode 100644 libraries/stdlib/wasm/src/kotlin/text/CharCategory.kt create mode 100644 libraries/tools/kotlin-stdlib-gen/src/generators/unicode/GenerateUnicodeData.kt create mode 100644 libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/CharCategoryTestGenerator.kt create mode 100644 libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/RangesGenerator.kt create mode 100644 libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/RangesWritingStrategy.kt create mode 100644 libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/builders/CharCategoryRangesBuilder.kt create mode 100644 libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/builders/DigitRangesBuilder.kt create mode 100644 libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/builders/LetterPatternBuilder.kt create mode 100644 libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/builders/RangesBuilder.kt create mode 100644 libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/builders/WhitespaceRangesBuilder.kt create mode 100644 libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/patterns/GapRangePattern.kt create mode 100644 libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/patterns/PeriodicRangePattern.kt create mode 100644 libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/patterns/RangePattern.kt create mode 100644 libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/writers/CategoryRangesWriter.kt create mode 100644 libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/writers/DigitRangesWriter.kt create mode 100644 libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/writers/FileWriterUtils.kt create mode 100644 libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/writers/LetterRangesWriter.kt create mode 100644 libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/writers/RangesWriter.kt create mode 100644 libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/writers/WhitespaceRangesWriter.kt diff --git a/libraries/stdlib/api/js-v1/kotlin.text.kt b/libraries/stdlib/api/js-v1/kotlin.text.kt index 902a3261170..7b8c42eb0a2 100644 --- a/libraries/stdlib/api/js-v1/kotlin.text.kt +++ b/libraries/stdlib/api/js-v1/kotlin.text.kt @@ -1,6 +1,8 @@ @kotlin.SinceKotlin(version = "1.2") public val kotlin.String.Companion.CASE_INSENSITIVE_ORDER: kotlin.Comparator { get; } +public val kotlin.Char.category: kotlin.text.CharCategory { get; } + public val kotlin.CharSequence.indices: kotlin.ranges.IntRange { get; } public val kotlin.CharSequence.lastIndex: kotlin.Int { get; } @@ -361,13 +363,25 @@ public inline fun kotlin.text.StringBuilder.insertRange(index: kotlin.Int, value public fun kotlin.CharSequence.isBlank(): kotlin.Boolean +public fun kotlin.Char.isDefined(): kotlin.Boolean + +public fun kotlin.Char.isDigit(): kotlin.Boolean + @kotlin.internal.InlineOnly public inline fun kotlin.CharSequence.isEmpty(): kotlin.Boolean public fun kotlin.Char.isHighSurrogate(): kotlin.Boolean +public fun kotlin.Char.isISOControl(): kotlin.Boolean + +public fun kotlin.Char.isLetter(): kotlin.Boolean + +public fun kotlin.Char.isLetterOrDigit(): kotlin.Boolean + public fun kotlin.Char.isLowSurrogate(): kotlin.Boolean +public fun kotlin.Char.isLowerCase(): kotlin.Boolean + @kotlin.internal.InlineOnly public inline fun kotlin.CharSequence.isNotBlank(): kotlin.Boolean @@ -382,6 +396,10 @@ public inline fun kotlin.CharSequence?.isNullOrEmpty(): kotlin.Boolean public fun kotlin.Char.isSurrogate(): kotlin.Boolean +public fun kotlin.Char.isTitleCase(): kotlin.Boolean + +public fun kotlin.Char.isUpperCase(): kotlin.Boolean + public fun kotlin.Char.isWhitespace(): kotlin.Boolean public operator fun kotlin.CharSequence.iterator(): kotlin.collections.CharIterator @@ -1178,6 +1196,75 @@ public interface Appendable { public abstract fun append(value: kotlin.CharSequence?, startIndex: kotlin.Int, endIndex: kotlin.Int): kotlin.text.Appendable } +public final enum class CharCategory : kotlin.Enum { + enum entry UNASSIGNED + + enum entry UPPERCASE_LETTER + + enum entry LOWERCASE_LETTER + + enum entry TITLECASE_LETTER + + enum entry MODIFIER_LETTER + + enum entry OTHER_LETTER + + enum entry NON_SPACING_MARK + + enum entry ENCLOSING_MARK + + enum entry COMBINING_SPACING_MARK + + enum entry DECIMAL_DIGIT_NUMBER + + enum entry LETTER_NUMBER + + enum entry OTHER_NUMBER + + enum entry SPACE_SEPARATOR + + enum entry LINE_SEPARATOR + + enum entry PARAGRAPH_SEPARATOR + + enum entry CONTROL + + enum entry FORMAT + + enum entry PRIVATE_USE + + enum entry SURROGATE + + enum entry DASH_PUNCTUATION + + enum entry START_PUNCTUATION + + enum entry END_PUNCTUATION + + enum entry CONNECTOR_PUNCTUATION + + enum entry OTHER_PUNCTUATION + + enum entry MATH_SYMBOL + + enum entry CURRENCY_SYMBOL + + enum entry MODIFIER_SYMBOL + + enum entry OTHER_SYMBOL + + enum entry INITIAL_QUOTE_PUNCTUATION + + enum entry FINAL_QUOTE_PUNCTUATION + + public final val code: kotlin.String { get; } + + public final operator fun contains(char: kotlin.Char): kotlin.Boolean + + public companion object of CharCategory { + } +} + @kotlin.SinceKotlin(version = "1.4") @kotlin.WasExperimental(markerClass = {kotlin.ExperimentalStdlibApi::class}) public open class CharacterCodingException : kotlin.Exception { diff --git a/libraries/stdlib/api/js/kotlin.text.kt b/libraries/stdlib/api/js/kotlin.text.kt index 902a3261170..7b8c42eb0a2 100644 --- a/libraries/stdlib/api/js/kotlin.text.kt +++ b/libraries/stdlib/api/js/kotlin.text.kt @@ -1,6 +1,8 @@ @kotlin.SinceKotlin(version = "1.2") public val kotlin.String.Companion.CASE_INSENSITIVE_ORDER: kotlin.Comparator { get; } +public val kotlin.Char.category: kotlin.text.CharCategory { get; } + public val kotlin.CharSequence.indices: kotlin.ranges.IntRange { get; } public val kotlin.CharSequence.lastIndex: kotlin.Int { get; } @@ -361,13 +363,25 @@ public inline fun kotlin.text.StringBuilder.insertRange(index: kotlin.Int, value public fun kotlin.CharSequence.isBlank(): kotlin.Boolean +public fun kotlin.Char.isDefined(): kotlin.Boolean + +public fun kotlin.Char.isDigit(): kotlin.Boolean + @kotlin.internal.InlineOnly public inline fun kotlin.CharSequence.isEmpty(): kotlin.Boolean public fun kotlin.Char.isHighSurrogate(): kotlin.Boolean +public fun kotlin.Char.isISOControl(): kotlin.Boolean + +public fun kotlin.Char.isLetter(): kotlin.Boolean + +public fun kotlin.Char.isLetterOrDigit(): kotlin.Boolean + public fun kotlin.Char.isLowSurrogate(): kotlin.Boolean +public fun kotlin.Char.isLowerCase(): kotlin.Boolean + @kotlin.internal.InlineOnly public inline fun kotlin.CharSequence.isNotBlank(): kotlin.Boolean @@ -382,6 +396,10 @@ public inline fun kotlin.CharSequence?.isNullOrEmpty(): kotlin.Boolean public fun kotlin.Char.isSurrogate(): kotlin.Boolean +public fun kotlin.Char.isTitleCase(): kotlin.Boolean + +public fun kotlin.Char.isUpperCase(): kotlin.Boolean + public fun kotlin.Char.isWhitespace(): kotlin.Boolean public operator fun kotlin.CharSequence.iterator(): kotlin.collections.CharIterator @@ -1178,6 +1196,75 @@ public interface Appendable { public abstract fun append(value: kotlin.CharSequence?, startIndex: kotlin.Int, endIndex: kotlin.Int): kotlin.text.Appendable } +public final enum class CharCategory : kotlin.Enum { + enum entry UNASSIGNED + + enum entry UPPERCASE_LETTER + + enum entry LOWERCASE_LETTER + + enum entry TITLECASE_LETTER + + enum entry MODIFIER_LETTER + + enum entry OTHER_LETTER + + enum entry NON_SPACING_MARK + + enum entry ENCLOSING_MARK + + enum entry COMBINING_SPACING_MARK + + enum entry DECIMAL_DIGIT_NUMBER + + enum entry LETTER_NUMBER + + enum entry OTHER_NUMBER + + enum entry SPACE_SEPARATOR + + enum entry LINE_SEPARATOR + + enum entry PARAGRAPH_SEPARATOR + + enum entry CONTROL + + enum entry FORMAT + + enum entry PRIVATE_USE + + enum entry SURROGATE + + enum entry DASH_PUNCTUATION + + enum entry START_PUNCTUATION + + enum entry END_PUNCTUATION + + enum entry CONNECTOR_PUNCTUATION + + enum entry OTHER_PUNCTUATION + + enum entry MATH_SYMBOL + + enum entry CURRENCY_SYMBOL + + enum entry MODIFIER_SYMBOL + + enum entry OTHER_SYMBOL + + enum entry INITIAL_QUOTE_PUNCTUATION + + enum entry FINAL_QUOTE_PUNCTUATION + + public final val code: kotlin.String { get; } + + public final operator fun contains(char: kotlin.Char): kotlin.Boolean + + public companion object of CharCategory { + } +} + @kotlin.SinceKotlin(version = "1.4") @kotlin.WasExperimental(markerClass = {kotlin.ExperimentalStdlibApi::class}) public open class CharacterCodingException : kotlin.Exception { diff --git a/libraries/stdlib/common/src/kotlin/TextH.kt b/libraries/stdlib/common/src/kotlin/TextH.kt index e750cd88edb..14f95af7b87 100644 --- a/libraries/stdlib/common/src/kotlin/TextH.kt +++ b/libraries/stdlib/common/src/kotlin/TextH.kt @@ -63,7 +63,6 @@ expect enum class RegexOption { // From char.kt -expect fun Char.isWhitespace(): Boolean expect fun Char.isHighSurrogate(): Boolean expect fun Char.isLowSurrogate(): Boolean diff --git a/libraries/stdlib/js-ir/src/generated/_CharCategories.kt b/libraries/stdlib/js-ir/src/generated/_CharCategories.kt new file mode 100644 index 00000000000..c4f7a9bd022 --- /dev/null +++ b/libraries/stdlib/js-ir/src/generated/_CharCategories.kt @@ -0,0 +1,84 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.text + +// +// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateUnicodeData.kt +// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib +// + +// 1343 ranges totally +private object Category { + val decodedRangeStart: IntArray + val decodedRangeCategory: IntArray + + init { + val toBase64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" + val fromBase64 = IntArray(128) + for (i in toBase64.indices) { + fromBase64[toBase64[i].toInt()] = i + } + + // rangeStartDiff.length = 1482 + val rangeStartDiff = "gBCFEDCKCDCaDDaDBhBCEEDDDDDEDXBHYBH5BRwBGDCHDCIDFHDCHFDCDEIRTEE7BGHDDJlCBbSEMOFGERwDEDDDDECEFCRBJhBFDCYFFCCzBvBjBBFC3BOhDBmBDGpBDDCtBBJIbEECLGDFCLDCgBBKVKEDiDDHCFECECKCEODBebC5CLBOKhBJDDDDWEBHFCFCPBZDEL1BVBSLPBgBB2BDBDICFBHKCCKCPDBHEDWBHEDDDDEDEDIBDGDCKCCGDDDCGECCWBFMDDCDEDDCHDDHKDDBKDBHFCWBFGFDBDDFEDBPDDKCHBGDCHEDWBFGFDCEDEDBHDDGDCKCGJEGDBFDDFDDDDDMEFDBFDCGBOKDFDFDCGFCXBQDDDDDBEGEDFDDKHBHDDGFCXBKBFCEFCFCHCHECCKDNCCHFCoBEDECFDDDDHDCCKJBGDCSDYBJEHBFDDEBIGKDCMuBFHEBGBIBKCkBFBFBXEIFJDFDGCKCEgBBDPEDGKKGECIBkBEOBDFFLBkBBIBEFFEClBrBCEBEGDBKGGDDDDDCHDENDCFEKDDlBDDFrBCDpKBECGEECpBBEChBBECGEECPB5BBECjCCDJUDQKG2CCGDsTCRBaCDrCDDIHNBEDLSDCJSCMLFCCM0BDHGFLBFDDKGKGEFDDBKGjBB1BHFChBDFmCKfDDDDDDCGDCFDKeCFLsBEaGKBDiBXDDD1BDGDEIGJEKGKGHBGCMF/BEBvBCEDDFHEKHKJJDDeDDGDKsBFEDCIEkBIICCDFKDDKeGCJHrBCDIIDBNBHEBEFDBFsB/BNBiBlB6BBF1EIiDJIGCGCIIIIGCGCIIIIOCIIIIIIDFEDDBFEDDDDEBDIFDDFEDBLFGCEEICFBJCDEDCLDKBFBKCCGDDKDDNDgBQNEBDMPFFDEDEBFFHECEBEEDFBEDDQjBCEDEFFCCJHBeEEfsIIEUCHCxCBeZoBGlCZLV8BuCW3FBJB2BIvDB4HOesBFCfKQgIjEW/BEgBCiIwBVCGnBCgBBpDvBBuBEDBHEFGCCjDCGEDCFCFlBDDF4BHCOBXJHBHBHBHBHBHBHBHBgBCECGHGEDIFBKCEDMEtBaB5CM2GaMEDDCKCGFCJEDFDDDC2CDDDB6CDCFrBB+CDEKgBkBMQfBKeIBPgBKnBPgKguGgC9vUDVB3jBD3BJoBGCsIBDQKCUuBDDKCcCCmCKCGIXJCNC/BBHGKDECEVFBEMCEEBqBDDGDFDXDCEBDGEG0BEICyBQCICKGSGDEBKcICXLCLBdDDBvBDECCDNCKECFCJKFBpBFEDCJDBICCKCEQBGDDByBEDCEFBYDCLEDDCKGCGCGJHBHBrBBEJDEwCjBIDCKGk9KMXExBEggCgoGuLCqDmBHMFFCKBNBFBIsDQRrLCQgCC2BoBMCCQGEGQDCQDDDDFDGDECEEFBnEEBFEDCKCDCaDDaDBFCKBtBCfDGCGCFEDDDDCECKDC" + val diff = decodeVarLenBase64(rangeStartDiff, fromBase64, 1342) + val start = IntArray(diff.size + 1) + for (i in diff.indices) { + start[i + 1] = start[i] + diff[i] + } + decodedRangeStart = start + + // rangeCategory.length = 2033 + val rangeCategory = "PsY44a41W54UYJYZYB14W7XC15WZPsYa84bl9Zw8b85Lr7C44brlerrYBZBCZCiBiBiBhCiiBhChiBhiCBhhChiCihBhChCChiBhChiClBCFhjCiBiBihDhiBhCCihBiBBhCCFCEbEbEb7EbGhCk7BixRkiCi4BRbh4BhRhCBRBCiiBBCiBChiZBCBCiBcGHhChCiBRBxxEYC40Rx8c6RGUm4GRFRFYRQZ44acG4wRYFEFGJYllGFlYGwcGmkEmcGFJFl8cYxwFGFGRFGFRJFGkkcYkxRm6aFGEGmmEmEGRYRFGxxYFRFRFRGQGIFmIFIGIooGFGFGYJ4EFmoIRFlxRlxRFRFxlRxlFllRxmFIGxxIoxRomFRIRxlFlmGRJFaL86F4mRxmGoRFRFRFRFllRxGIGRxmGxmGmxRxGRFlRRJmmFllGYRmmIRFllRlRFRFllRFxxGFIGmmRoxImxRFRllGmxRJ4aRFGxmIoRFlxRlxRFRFllRFxxGlImoGmmRxoIxoIGRmmIRxlFlmGRJ8FLRxmFFRFllRllRxxFlRlxRxlFRFRFRooGRIooRomRxFRIRJLc8aRmoIoGFllRlRFRFRlmGmoIooRGRGRxmGFRllGmxRJRYL8lGooYFllRlRFRFRFRmlIIxGooRGRIRlxFGRJxlFRGIFllRlRFlmGIGxIooRomF8xRxxFllILFGRJLcFxmIoRFRFRFxlRFRxxGxxIooGmmRRIRJxxIoYRFllGGRaFEGYJYRxlFRFRFlRFllGGlxRFxEGRJRFRFcY84c8mGcJL8G1WIFRFRGIGmmYFGRGRcGc88RYcYRFIGIGmmIomGFJYFooGmlFllGmmFIFIFGFmoIGIomFJIm8cBhRRxxBC4ECFRFRFlRFRFRFRFRFRFlRFRFRFRFRFRGYLRFcRBRCxxUF8YFMF1WRFYKFRFRFGRFGYRFGRFllRlRGRFmmIGIooGGY44E46FmxRJRLRY44U44GmmQRJRFEFRFGFlGRFRFxmGmoIooGmoIoxRxxIoGIGRxxcx4YJFRFRFRFRJLRcFmmIomRx4YFoGGmRomIGIGmxRJRJRYEYRGmmHRGIFmIGmIIooGFRJYcGcRmmIFomGmmIomGmlFJFmoGooGGIRYFIGIGRYJRFJFEYCRBRBYRGYGIGFGFllGomGFRCECECEGRGhCCiBCBCRBRCBCBCRBRCxBCBCRCDCDCDCiiRBj7CbCiiRBj7b7iCiiRxiCBRbCBbxxCiiRBj7bRMQUY9+V9+VYtOQMY9eY43X44Z1WY54XYMQRQrERLZ12ELZ12RERaRGHGHGR88B88BihBhiChhC8hcZBc8BB8CBCFi8cihBZBC8Z8CLKhCKr8cRZcZc88ZcZc85Z8ZcZc1WcZc1WcZcZcZcRcRLcLcZcZcZcZc1WLcZ1WZ1WZcZ1WZ1WZ1WZcZcZcRcRcBRCixBBCiBBihCCEBhCCchCGhCRY44LCiRRxxCFRkYRGFRFRFRFRFRFRFRFRFRGY9eY49eY44U49e49e1WYEYUY04VY48cRcRcRcRcRs4Y48ElK1Wc1W12U2cKGooUE88KqqEl4c8RFxxGm7bkkFUF4kEkFRFRFx8cLcFcRFcRLcLcLcLcLcFcFRFEFRcRFEYFEYFJFRhClmHnnYG4EhCEGFKGYRbEbhCCiBECiBhCk7bhClBihCiBBCBhCRhiBhhCCRhiFkkCFlGllGllGFooGmIcGRL88aRFYRIFIGRYJRGFYl4FGJFGYFGIRYFRGIFmoIGIGIYxEJRYFmEFJFRFGmoImoIGRFGFmIRJRYFEFcloGIFmlGmlFGFlmGFRllEYFomGo4YlkEoGRFRFRFRFRFRCbECk7bRCFooG4oGRJRFRFRFRTSFRFRCRCRlGFZFRFRlxFFbRF2VRFRFRF6cRGY41WRG40UX1W44V24Y44X33Y44R44U1WY50Z5R46YRFRFxxQY44a41W54UYJYZYB14W7XC15WZ12YYFEFEFRFRFRFlxRllRxxa65b86axcZcRQcR" + decodedRangeCategory = decodeVarLenBase64(rangeCategory, fromBase64, 1343) + } +} + +private fun categoryValueFrom(code: Int, ch: Int): Int { + return when { + code < 0x20 -> code + code < 0x400 -> if ((ch and 1) == 1) code shr 5 else code and 0x1f + else -> + when (ch % 3) { + 2 -> code shr 10 + 1 -> (code shr 5) and 0x1f + else -> code and 0x1f + } + } +} + +/** + * Returns the Unicode general category of this character as an Int. + */ +internal fun Char.getCategoryValue(): Int { + val ch = this.toInt() + + val index = binarySearchRange(Category.decodedRangeStart, ch) + val start = Category.decodedRangeStart[index] + val code = Category.decodedRangeCategory[index] + val value = categoryValueFrom(code, ch - start) + + return if (value == 17) CharCategory.UNASSIGNED.value else value +} + +internal fun decodeVarLenBase64(base64: String, fromBase64: IntArray, resultLength: Int): IntArray { + val result = IntArray(resultLength) + var index = 0 + var int = 0 + var shift = 0 + for (char in base64) { + val sixBit = fromBase64[char.toInt()] + int = int or ((sixBit and 0x1f) shl shift) + if (sixBit < 0x20) { + result[index++] = int + int = 0 + shift = 0 + } else { + shift += 5 + } + } + return result +} diff --git a/libraries/stdlib/js-ir/src/generated/_DigitChars.kt b/libraries/stdlib/js-ir/src/generated/_DigitChars.kt new file mode 100644 index 00000000000..40eac212ea2 --- /dev/null +++ b/libraries/stdlib/js-ir/src/generated/_DigitChars.kt @@ -0,0 +1,47 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.text + +// +// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateUnicodeData.kt +// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib +// + +// 37 ranges totally +private object Digit { + internal val rangeStart = intArrayOf( + 0x0030, 0x0660, 0x06f0, 0x07c0, 0x0966, 0x09e6, 0x0a66, 0x0ae6, 0x0b66, 0x0be6, 0x0c66, 0x0ce6, 0x0d66, 0x0de6, 0x0e50, 0x0ed0, 0x0f20, 0x1040, 0x1090, 0x17e0, + 0x1810, 0x1946, 0x19d0, 0x1a80, 0x1a90, 0x1b50, 0x1bb0, 0x1c40, 0x1c50, 0xa620, 0xa8d0, 0xa900, 0xa9d0, 0xa9f0, 0xaa50, 0xabf0, 0xff10, + ) +} + +internal fun binarySearchRange(array: IntArray, needle: Int): Int { + var bottom = 0 + var top = array.size - 1 + var middle = -1 + var value = 0 + while (bottom <= top) { + middle = (bottom + top) / 2 + value = array[middle] + if (needle > value) + bottom = middle + 1 + else if (needle == value) + return middle + else + top = middle - 1 + } + return middle - (if (needle < value) 1 else 0) +} + +/** + * Returns `true` if this character is a digit. + */ +internal fun Char.isDigitImpl(): Boolean { + val ch = this.toInt() + val index = binarySearchRange(Digit.rangeStart, ch) + val high = Digit.rangeStart[index] + 9 + return ch <= high +} diff --git a/libraries/stdlib/js-ir/src/generated/_LetterChars.kt b/libraries/stdlib/js-ir/src/generated/_LetterChars.kt new file mode 100644 index 00000000000..ba9f83e77c1 --- /dev/null +++ b/libraries/stdlib/js-ir/src/generated/_LetterChars.kt @@ -0,0 +1,114 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.text + +// +// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateUnicodeData.kt +// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib +// + +// 222 ranges totally +private object Letter { + val decodedRangeStart: IntArray + val decodedRangeLength: IntArray + val decodedRangeCategory: IntArray + + init { + val toBase64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" + val fromBase64 = IntArray(128) + for (i in toBase64.indices) { + fromBase64[toBase64[i].toInt()] = i + } + + // rangeStartDiff.length = 356 + val rangeStartDiff = "hCgBpCQGYHZH5BRpBPPPPPPRMP5BPPlCPP6BkEPPPPcPXPzBvBrB3BOiDoBHwD+E3DauCnFmBmB2D6E1BlBTiBmBlBP5BhBiBrBvBjBqBnBPRtBiCmCtBlB0BmB5BiB7BmBgEmChBZgCoEoGVpBSfRhBPqKQ2BwBYoFgB4CJuTiEvBuCuDrF5DgEgFlJ1DgFmBQtBsBRGsB+BPiBlD1EIjDPRPPPQPPPPPGQSQS/DxENVNU+B9zCwBwBPPCkDPNnBPqDYY1R8B7FkFgTgwGgwUwmBgKwBuBScmEP/BPPPPPPrBP8B7F1B/ErBqC6B7BiBmBfQsBUwCw/KwqIwLwETPcPjQgJxFgBlBsD" + val diff = decodeVarLenBase64(rangeStartDiff, fromBase64, 222) + val start = IntArray(diff.size) + for (i in diff.indices) { + if (i == 0) start[i] = diff[i] + else start[i] = start[i - 1] + diff[i] + } + decodedRangeStart = start + + // rangeLength.length = 328 + val rangeLength = "aaMBXHYH5BRpBPPPPPPRMP5BPPlCPPzBDOOPPcPXPzBvBjB3BOhDmBBpB7DoDYxB+EiBP1DoExBkBQhBekBPmBgBhBctBiBMWOOXhCsBpBkBUV3Ba4BkB0DlCgBXgBtD4FSdBfPhBPpKP0BvBXjEQ2CGsT8DhBtCqDpFvD1D3E0IrD2EkBJrBDOBsB+BPiBlB1EIjDPPPPPPPPPPPGPPMNLsBNPNPKCvBvBPPCkDPBmBPhDXXgD4B6FzEgDguG9vUtkB9JcuBSckEP/BPPPPPPBPf4FrBjEhBpC3B5BKaWPrBOwCk/KsCuLqDHPbPxPsFtEaaqDL" + decodedRangeLength = decodeVarLenBase64(rangeLength, fromBase64, 222) + + // rangeCategory.length = 959 + val rangeCategory = "GFjgggUHGGFFZZZmzpz5qB6s6020B60ptltB6smt2sB60mz22B1+vv+8BZZ5s2850BW5q1ymtB506smzBF3q1q1qB1q1q1+Bgii4wDTm74g3KiggxqM60q1q1Bq1o1q1BF1qlrqrBZ2q5wprBGFZWWZGHFsjiooLowgmOowjkwCkgoiIk7ligGogiioBkwkiYkzj2oNoi+sbkwj04DghhkQ8wgiYkgoioDsgnkwC4gikQ//v+85BkwvoIsgoyI4yguI0whiwEowri4CoghsJowgqYowgm4DkwgsY/nwnzPowhmYkg6wI8yggZswikwHgxgmIoxgqYkwgk4DkxgmIkgoioBsgssoBgzgyI8g9gL8g9kI0wgwJoxgkoC0wgioFkw/wI0w53iF4gioYowjmgBHGq1qkgwBF1q1q8qBHwghuIwghyKk0goQkwgoQk3goQHGFHkyg0pBgxj6IoinkxDswno7Ikwhz9Bo0gioB8z48Rwli0xN0mpjoX8w78pDwltoqKHFGGwwgsIHFH3q1q16BFHWFZ1q10q1B2qlwq1B1q10q1B2q1yq1B6q1gq1Biq1qhxBir1qp1Bqt1q1qB1g1q1+B//3q16B///q1qBH/qlqq9Bholqq9B1i00a1q10qD1op1HkwmigEigiy6Cptogq1Bixo1kDq7/j00B2qgoBWGFm1lz50B6s5q1+BGWhggzhwBFFhgk4//Bo2jigE8wguI8wguI8wgugUog1qoB4qjmIwwi2KgkYHHH4lBgiFWkgIWoghssMmz5smrBZ3q1y50B5sm7gzBtz1smzB5smz50BqzqtmzB5sgzqzBF2/9//5BowgoIwmnkzPkwgk4C8ys65BkgoqI0wgy6FghquZo2giY0ghiIsgh24B4ghsQ8QF/v1q1OFs0O8iCHHF1qggz/B8wg6Iznv+//B08QgohsjK0QGFk7hsQ4gB" + decodedRangeCategory = decodeVarLenBase64(rangeCategory, fromBase64, 222) + } +} + +/** + * Returns `true` if this character is a letter. + */ +internal fun Char.isLetterImpl(): Boolean { + return getLetterType() != 0 +} + +/** + * Returns `true` if this character is a lower case letter. + */ +internal fun Char.isLowerCaseImpl(): Boolean { + return getLetterType() == 1 +} + +/** + * Returns `true` if this character is an upper case letter. + */ +internal fun Char.isUpperCaseImpl(): Boolean { + return getLetterType() == 2 +} + +/** + * Returns + * - `1` if the character is a lower case letter, + * - `2` if the character is an upper case letter, + * - `3` if the character is a letter but not a lower or upper case letter, + * - `0` otherwise. + */ +private fun Char.getLetterType(): Int { + val ch = this.toInt() + val index = binarySearchRange(Letter.decodedRangeStart, ch) + + val rangeStart = Letter.decodedRangeStart[index] + val rangeEnd = rangeStart + Letter.decodedRangeLength[index] - 1 + val code = Letter.decodedRangeCategory[index] + + if (ch > rangeEnd) { + return 0 + } + + val lastTwoBits = code and 0x3 + + if (lastTwoBits == 0) { // gap pattern + var shift = 2 + var threshold = rangeStart + for (i in 0..1) { + threshold += (code shr shift) and 0x7f + if (threshold > ch) { + return 3 + } + shift += 7 + threshold += (code shr shift) and 0x7f + if (threshold > ch) { + return 0 + } + shift += 7 + } + return 3 + } + + if (code <= 0x7) { + return lastTwoBits + } + + val distance = (ch - rangeStart) + val shift = if (code <= 0x1F) distance % 2 else distance + return (code shr (2 * shift)) and 0x3 +} + diff --git a/libraries/stdlib/js-ir/src/generated/_WhitespaceChars.kt b/libraries/stdlib/js-ir/src/generated/_WhitespaceChars.kt new file mode 100644 index 00000000000..fe55745b8bd --- /dev/null +++ b/libraries/stdlib/js-ir/src/generated/_WhitespaceChars.kt @@ -0,0 +1,31 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.text + +// +// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateUnicodeData.kt +// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib +// + +// 9 ranges totally +/** + * Returns `true` if this character is a whitespace. + */ +internal fun Char.isWhitespaceImpl(): Boolean { + val ch = this.toInt() + return ch in 0x0009..0x000d + || ch in 0x001c..0x0020 + || ch == 0x00a0 + || ch > 0x1000 && ( + ch == 0x1680 + || ch in 0x2000..0x200a + || ch == 0x2028 + || ch == 0x2029 + || ch == 0x202f + || ch == 0x205f + || ch == 0x3000 + ) +} diff --git a/libraries/stdlib/js/src/generated/_CharCategories.kt b/libraries/stdlib/js/src/generated/_CharCategories.kt new file mode 100644 index 00000000000..c4f7a9bd022 --- /dev/null +++ b/libraries/stdlib/js/src/generated/_CharCategories.kt @@ -0,0 +1,84 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.text + +// +// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateUnicodeData.kt +// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib +// + +// 1343 ranges totally +private object Category { + val decodedRangeStart: IntArray + val decodedRangeCategory: IntArray + + init { + val toBase64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" + val fromBase64 = IntArray(128) + for (i in toBase64.indices) { + fromBase64[toBase64[i].toInt()] = i + } + + // rangeStartDiff.length = 1482 + val rangeStartDiff = "gBCFEDCKCDCaDDaDBhBCEEDDDDDEDXBHYBH5BRwBGDCHDCIDFHDCHFDCDEIRTEE7BGHDDJlCBbSEMOFGERwDEDDDDECEFCRBJhBFDCYFFCCzBvBjBBFC3BOhDBmBDGpBDDCtBBJIbEECLGDFCLDCgBBKVKEDiDDHCFECECKCEODBebC5CLBOKhBJDDDDWEBHFCFCPBZDEL1BVBSLPBgBB2BDBDICFBHKCCKCPDBHEDWBHEDDDDEDEDIBDGDCKCCGDDDCGECCWBFMDDCDEDDCHDDHKDDBKDBHFCWBFGFDBDDFEDBPDDKCHBGDCHEDWBFGFDCEDEDBHDDGDCKCGJEGDBFDDFDDDDDMEFDBFDCGBOKDFDFDCGFCXBQDDDDDBEGEDFDDKHBHDDGFCXBKBFCEFCFCHCHECCKDNCCHFCoBEDECFDDDDHDCCKJBGDCSDYBJEHBFDDEBIGKDCMuBFHEBGBIBKCkBFBFBXEIFJDFDGCKCEgBBDPEDGKKGECIBkBEOBDFFLBkBBIBEFFEClBrBCEBEGDBKGGDDDDDCHDENDCFEKDDlBDDFrBCDpKBECGEECpBBEChBBECGEECPB5BBECjCCDJUDQKG2CCGDsTCRBaCDrCDDIHNBEDLSDCJSCMLFCCM0BDHGFLBFDDKGKGEFDDBKGjBB1BHFChBDFmCKfDDDDDDCGDCFDKeCFLsBEaGKBDiBXDDD1BDGDEIGJEKGKGHBGCMF/BEBvBCEDDFHEKHKJJDDeDDGDKsBFEDCIEkBIICCDFKDDKeGCJHrBCDIIDBNBHEBEFDBFsB/BNBiBlB6BBF1EIiDJIGCGCIIIIGCGCIIIIOCIIIIIIDFEDDBFEDDDDEBDIFDDFEDBLFGCEEICFBJCDEDCLDKBFBKCCGDDKDDNDgBQNEBDMPFFDEDEBFFHECEBEEDFBEDDQjBCEDEFFCCJHBeEEfsIIEUCHCxCBeZoBGlCZLV8BuCW3FBJB2BIvDB4HOesBFCfKQgIjEW/BEgBCiIwBVCGnBCgBBpDvBBuBEDBHEFGCCjDCGEDCFCFlBDDF4BHCOBXJHBHBHBHBHBHBHBHBgBCECGHGEDIFBKCEDMEtBaB5CM2GaMEDDCKCGFCJEDFDDDC2CDDDB6CDCFrBB+CDEKgBkBMQfBKeIBPgBKnBPgKguGgC9vUDVB3jBD3BJoBGCsIBDQKCUuBDDKCcCCmCKCGIXJCNC/BBHGKDECEVFBEMCEEBqBDDGDFDXDCEBDGEG0BEICyBQCICKGSGDEBKcICXLCLBdDDBvBDECCDNCKECFCJKFBpBFEDCJDBICCKCEQBGDDByBEDCEFBYDCLEDDCKGCGCGJHBHBrBBEJDEwCjBIDCKGk9KMXExBEggCgoGuLCqDmBHMFFCKBNBFBIsDQRrLCQgCC2BoBMCCQGEGQDCQDDDDFDGDECEEFBnEEBFEDCKCDCaDDaDBFCKBtBCfDGCGCFEDDDDCECKDC" + val diff = decodeVarLenBase64(rangeStartDiff, fromBase64, 1342) + val start = IntArray(diff.size + 1) + for (i in diff.indices) { + start[i + 1] = start[i] + diff[i] + } + decodedRangeStart = start + + // rangeCategory.length = 2033 + val rangeCategory = "PsY44a41W54UYJYZYB14W7XC15WZPsYa84bl9Zw8b85Lr7C44brlerrYBZBCZCiBiBiBhCiiBhChiBhiCBhhChiCihBhChCChiBhChiClBCFhjCiBiBihDhiBhCCihBiBBhCCFCEbEbEb7EbGhCk7BixRkiCi4BRbh4BhRhCBRBCiiBBCiBChiZBCBCiBcGHhChCiBRBxxEYC40Rx8c6RGUm4GRFRFYRQZ44acG4wRYFEFGJYllGFlYGwcGmkEmcGFJFl8cYxwFGFGRFGFRJFGkkcYkxRm6aFGEGmmEmEGRYRFGxxYFRFRFRGQGIFmIFIGIooGFGFGYJ4EFmoIRFlxRlxRFRFxlRxlFllRxmFIGxxIoxRomFRIRxlFlmGRJFaL86F4mRxmGoRFRFRFRFllRxGIGRxmGxmGmxRxGRFlRRJmmFllGYRmmIRFllRlRFRFllRFxxGFIGmmRoxImxRFRllGmxRJ4aRFGxmIoRFlxRlxRFRFllRFxxGlImoGmmRxoIxoIGRmmIRxlFlmGRJ8FLRxmFFRFllRllRxxFlRlxRxlFRFRFRooGRIooRomRxFRIRJLc8aRmoIoGFllRlRFRFRlmGmoIooRGRGRxmGFRllGmxRJRYL8lGooYFllRlRFRFRFRmlIIxGooRGRIRlxFGRJxlFRGIFllRlRFlmGIGxIooRomF8xRxxFllILFGRJLcFxmIoRFRFRFxlRFRxxGxxIooGmmRRIRJxxIoYRFllGGRaFEGYJYRxlFRFRFlRFllGGlxRFxEGRJRFRFcY84c8mGcJL8G1WIFRFRGIGmmYFGRGRcGc88RYcYRFIGIGmmIomGFJYFooGmlFllGmmFIFIFGFmoIGIomFJIm8cBhRRxxBC4ECFRFRFlRFRFRFRFRFRFlRFRFRFRFRFRGYLRFcRBRCxxUF8YFMF1WRFYKFRFRFGRFGYRFGRFllRlRGRFmmIGIooGGY44E46FmxRJRLRY44U44GmmQRJRFEFRFGFlGRFRFxmGmoIooGmoIoxRxxIoGIGRxxcx4YJFRFRFRFRJLRcFmmIomRx4YFoGGmRomIGIGmxRJRJRYEYRGmmHRGIFmIGmIIooGFRJYcGcRmmIFomGmmIomGmlFJFmoGooGGIRYFIGIGRYJRFJFEYCRBRBYRGYGIGFGFllGomGFRCECECEGRGhCCiBCBCRBRCBCBCRBRCxBCBCRCDCDCDCiiRBj7CbCiiRBj7b7iCiiRxiCBRbCBbxxCiiRBj7bRMQUY9+V9+VYtOQMY9eY43X44Z1WY54XYMQRQrERLZ12ELZ12RERaRGHGHGR88B88BihBhiChhC8hcZBc8BB8CBCFi8cihBZBC8Z8CLKhCKr8cRZcZc88ZcZc85Z8ZcZc1WcZc1WcZcZcZcRcRLcLcZcZcZcZc1WLcZ1WZ1WZcZ1WZ1WZ1WZcZcZcRcRcBRCixBBCiBBihCCEBhCCchCGhCRY44LCiRRxxCFRkYRGFRFRFRFRFRFRFRFRFRGY9eY49eY44U49e49e1WYEYUY04VY48cRcRcRcRcRs4Y48ElK1Wc1W12U2cKGooUE88KqqEl4c8RFxxGm7bkkFUF4kEkFRFRFx8cLcFcRFcRLcLcLcLcLcFcFRFEFRcRFEYFEYFJFRhClmHnnYG4EhCEGFKGYRbEbhCCiBECiBhCk7bhClBihCiBBCBhCRhiBhhCCRhiFkkCFlGllGllGFooGmIcGRL88aRFYRIFIGRYJRGFYl4FGJFGYFGIRYFRGIFmoIGIGIYxEJRYFmEFJFRFGmoImoIGRFGFmIRJRYFEFcloGIFmlGmlFGFlmGFRllEYFomGo4YlkEoGRFRFRFRFRFRCbECk7bRCFooG4oGRJRFRFRFRTSFRFRCRCRlGFZFRFRlxFFbRF2VRFRFRF6cRGY41WRG40UX1W44V24Y44X33Y44R44U1WY50Z5R46YRFRFxxQY44a41W54UYJYZYB14W7XC15WZ12YYFEFEFRFRFRFlxRllRxxa65b86axcZcRQcR" + decodedRangeCategory = decodeVarLenBase64(rangeCategory, fromBase64, 1343) + } +} + +private fun categoryValueFrom(code: Int, ch: Int): Int { + return when { + code < 0x20 -> code + code < 0x400 -> if ((ch and 1) == 1) code shr 5 else code and 0x1f + else -> + when (ch % 3) { + 2 -> code shr 10 + 1 -> (code shr 5) and 0x1f + else -> code and 0x1f + } + } +} + +/** + * Returns the Unicode general category of this character as an Int. + */ +internal fun Char.getCategoryValue(): Int { + val ch = this.toInt() + + val index = binarySearchRange(Category.decodedRangeStart, ch) + val start = Category.decodedRangeStart[index] + val code = Category.decodedRangeCategory[index] + val value = categoryValueFrom(code, ch - start) + + return if (value == 17) CharCategory.UNASSIGNED.value else value +} + +internal fun decodeVarLenBase64(base64: String, fromBase64: IntArray, resultLength: Int): IntArray { + val result = IntArray(resultLength) + var index = 0 + var int = 0 + var shift = 0 + for (char in base64) { + val sixBit = fromBase64[char.toInt()] + int = int or ((sixBit and 0x1f) shl shift) + if (sixBit < 0x20) { + result[index++] = int + int = 0 + shift = 0 + } else { + shift += 5 + } + } + return result +} diff --git a/libraries/stdlib/js/src/generated/_DigitChars.kt b/libraries/stdlib/js/src/generated/_DigitChars.kt new file mode 100644 index 00000000000..40eac212ea2 --- /dev/null +++ b/libraries/stdlib/js/src/generated/_DigitChars.kt @@ -0,0 +1,47 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.text + +// +// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateUnicodeData.kt +// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib +// + +// 37 ranges totally +private object Digit { + internal val rangeStart = intArrayOf( + 0x0030, 0x0660, 0x06f0, 0x07c0, 0x0966, 0x09e6, 0x0a66, 0x0ae6, 0x0b66, 0x0be6, 0x0c66, 0x0ce6, 0x0d66, 0x0de6, 0x0e50, 0x0ed0, 0x0f20, 0x1040, 0x1090, 0x17e0, + 0x1810, 0x1946, 0x19d0, 0x1a80, 0x1a90, 0x1b50, 0x1bb0, 0x1c40, 0x1c50, 0xa620, 0xa8d0, 0xa900, 0xa9d0, 0xa9f0, 0xaa50, 0xabf0, 0xff10, + ) +} + +internal fun binarySearchRange(array: IntArray, needle: Int): Int { + var bottom = 0 + var top = array.size - 1 + var middle = -1 + var value = 0 + while (bottom <= top) { + middle = (bottom + top) / 2 + value = array[middle] + if (needle > value) + bottom = middle + 1 + else if (needle == value) + return middle + else + top = middle - 1 + } + return middle - (if (needle < value) 1 else 0) +} + +/** + * Returns `true` if this character is a digit. + */ +internal fun Char.isDigitImpl(): Boolean { + val ch = this.toInt() + val index = binarySearchRange(Digit.rangeStart, ch) + val high = Digit.rangeStart[index] + 9 + return ch <= high +} diff --git a/libraries/stdlib/js/src/generated/_LetterChars.kt b/libraries/stdlib/js/src/generated/_LetterChars.kt new file mode 100644 index 00000000000..ba9f83e77c1 --- /dev/null +++ b/libraries/stdlib/js/src/generated/_LetterChars.kt @@ -0,0 +1,114 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.text + +// +// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateUnicodeData.kt +// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib +// + +// 222 ranges totally +private object Letter { + val decodedRangeStart: IntArray + val decodedRangeLength: IntArray + val decodedRangeCategory: IntArray + + init { + val toBase64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" + val fromBase64 = IntArray(128) + for (i in toBase64.indices) { + fromBase64[toBase64[i].toInt()] = i + } + + // rangeStartDiff.length = 356 + val rangeStartDiff = "hCgBpCQGYHZH5BRpBPPPPPPRMP5BPPlCPP6BkEPPPPcPXPzBvBrB3BOiDoBHwD+E3DauCnFmBmB2D6E1BlBTiBmBlBP5BhBiBrBvBjBqBnBPRtBiCmCtBlB0BmB5BiB7BmBgEmChBZgCoEoGVpBSfRhBPqKQ2BwBYoFgB4CJuTiEvBuCuDrF5DgEgFlJ1DgFmBQtBsBRGsB+BPiBlD1EIjDPRPPPQPPPPPGQSQS/DxENVNU+B9zCwBwBPPCkDPNnBPqDYY1R8B7FkFgTgwGgwUwmBgKwBuBScmEP/BPPPPPPrBP8B7F1B/ErBqC6B7BiBmBfQsBUwCw/KwqIwLwETPcPjQgJxFgBlBsD" + val diff = decodeVarLenBase64(rangeStartDiff, fromBase64, 222) + val start = IntArray(diff.size) + for (i in diff.indices) { + if (i == 0) start[i] = diff[i] + else start[i] = start[i - 1] + diff[i] + } + decodedRangeStart = start + + // rangeLength.length = 328 + val rangeLength = "aaMBXHYH5BRpBPPPPPPRMP5BPPlCPPzBDOOPPcPXPzBvBjB3BOhDmBBpB7DoDYxB+EiBP1DoExBkBQhBekBPmBgBhBctBiBMWOOXhCsBpBkBUV3Ba4BkB0DlCgBXgBtD4FSdBfPhBPpKP0BvBXjEQ2CGsT8DhBtCqDpFvD1D3E0IrD2EkBJrBDOBsB+BPiBlB1EIjDPPPPPPPPPPPGPPMNLsBNPNPKCvBvBPPCkDPBmBPhDXXgD4B6FzEgDguG9vUtkB9JcuBSckEP/BPPPPPPBPf4FrBjEhBpC3B5BKaWPrBOwCk/KsCuLqDHPbPxPsFtEaaqDL" + decodedRangeLength = decodeVarLenBase64(rangeLength, fromBase64, 222) + + // rangeCategory.length = 959 + val rangeCategory = "GFjgggUHGGFFZZZmzpz5qB6s6020B60ptltB6smt2sB60mz22B1+vv+8BZZ5s2850BW5q1ymtB506smzBF3q1q1qB1q1q1+Bgii4wDTm74g3KiggxqM60q1q1Bq1o1q1BF1qlrqrBZ2q5wprBGFZWWZGHFsjiooLowgmOowjkwCkgoiIk7ligGogiioBkwkiYkzj2oNoi+sbkwj04DghhkQ8wgiYkgoioDsgnkwC4gikQ//v+85BkwvoIsgoyI4yguI0whiwEowri4CoghsJowgqYowgm4DkwgsY/nwnzPowhmYkg6wI8yggZswikwHgxgmIoxgqYkwgk4DkxgmIkgoioBsgssoBgzgyI8g9gL8g9kI0wgwJoxgkoC0wgioFkw/wI0w53iF4gioYowjmgBHGq1qkgwBF1q1q8qBHwghuIwghyKk0goQkwgoQk3goQHGFHkyg0pBgxj6IoinkxDswno7Ikwhz9Bo0gioB8z48Rwli0xN0mpjoX8w78pDwltoqKHFGGwwgsIHFH3q1q16BFHWFZ1q10q1B2qlwq1B1q10q1B2q1yq1B6q1gq1Biq1qhxBir1qp1Bqt1q1qB1g1q1+B//3q16B///q1qBH/qlqq9Bholqq9B1i00a1q10qD1op1HkwmigEigiy6Cptogq1Bixo1kDq7/j00B2qgoBWGFm1lz50B6s5q1+BGWhggzhwBFFhgk4//Bo2jigE8wguI8wguI8wgugUog1qoB4qjmIwwi2KgkYHHH4lBgiFWkgIWoghssMmz5smrBZ3q1y50B5sm7gzBtz1smzB5smz50BqzqtmzB5sgzqzBF2/9//5BowgoIwmnkzPkwgk4C8ys65BkgoqI0wgy6FghquZo2giY0ghiIsgh24B4ghsQ8QF/v1q1OFs0O8iCHHF1qggz/B8wg6Iznv+//B08QgohsjK0QGFk7hsQ4gB" + decodedRangeCategory = decodeVarLenBase64(rangeCategory, fromBase64, 222) + } +} + +/** + * Returns `true` if this character is a letter. + */ +internal fun Char.isLetterImpl(): Boolean { + return getLetterType() != 0 +} + +/** + * Returns `true` if this character is a lower case letter. + */ +internal fun Char.isLowerCaseImpl(): Boolean { + return getLetterType() == 1 +} + +/** + * Returns `true` if this character is an upper case letter. + */ +internal fun Char.isUpperCaseImpl(): Boolean { + return getLetterType() == 2 +} + +/** + * Returns + * - `1` if the character is a lower case letter, + * - `2` if the character is an upper case letter, + * - `3` if the character is a letter but not a lower or upper case letter, + * - `0` otherwise. + */ +private fun Char.getLetterType(): Int { + val ch = this.toInt() + val index = binarySearchRange(Letter.decodedRangeStart, ch) + + val rangeStart = Letter.decodedRangeStart[index] + val rangeEnd = rangeStart + Letter.decodedRangeLength[index] - 1 + val code = Letter.decodedRangeCategory[index] + + if (ch > rangeEnd) { + return 0 + } + + val lastTwoBits = code and 0x3 + + if (lastTwoBits == 0) { // gap pattern + var shift = 2 + var threshold = rangeStart + for (i in 0..1) { + threshold += (code shr shift) and 0x7f + if (threshold > ch) { + return 3 + } + shift += 7 + threshold += (code shr shift) and 0x7f + if (threshold > ch) { + return 0 + } + shift += 7 + } + return 3 + } + + if (code <= 0x7) { + return lastTwoBits + } + + val distance = (ch - rangeStart) + val shift = if (code <= 0x1F) distance % 2 else distance + return (code shr (2 * shift)) and 0x3 +} + diff --git a/libraries/stdlib/js/src/generated/_WhitespaceChars.kt b/libraries/stdlib/js/src/generated/_WhitespaceChars.kt new file mode 100644 index 00000000000..fe55745b8bd --- /dev/null +++ b/libraries/stdlib/js/src/generated/_WhitespaceChars.kt @@ -0,0 +1,31 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.text + +// +// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateUnicodeData.kt +// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib +// + +// 9 ranges totally +/** + * Returns `true` if this character is a whitespace. + */ +internal fun Char.isWhitespaceImpl(): Boolean { + val ch = this.toInt() + return ch in 0x0009..0x000d + || ch in 0x001c..0x0020 + || ch == 0x00a0 + || ch > 0x1000 && ( + ch == 0x1680 + || ch in 0x2000..0x200a + || ch == 0x2028 + || ch == 0x2029 + || ch == 0x202f + || ch == 0x205f + || ch == 0x3000 + ) +} diff --git a/libraries/stdlib/js/src/kotlin/text/CharCategoryJS.kt b/libraries/stdlib/js/src/kotlin/text/CharCategoryJS.kt new file mode 100644 index 00000000000..45bf9a0417f --- /dev/null +++ b/libraries/stdlib/js/src/kotlin/text/CharCategoryJS.kt @@ -0,0 +1,172 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.text + +public actual enum class CharCategory(internal val value: Int, public actual val code: String) { + /** + * General category "Cn" in the Unicode specification. + */ + UNASSIGNED(0, "Cn"), + + /** + * General category "Lu" in the Unicode specification. + */ + UPPERCASE_LETTER(1, "Lu"), + + /** + * General category "Ll" in the Unicode specification. + */ + LOWERCASE_LETTER(2, "Ll"), + + /** + * General category "Lt" in the Unicode specification. + */ + TITLECASE_LETTER(3, "Lt"), + + /** + * General category "Lm" in the Unicode specification. + */ + MODIFIER_LETTER(4, "Lm"), + + /** + * General category "Lo" in the Unicode specification. + */ + OTHER_LETTER(5, "Lo"), + + /** + * General category "Mn" in the Unicode specification. + */ + NON_SPACING_MARK(6, "Mn"), + + /** + * General category "Me" in the Unicode specification. + */ + ENCLOSING_MARK(7, "Me"), + + /** + * General category "Mc" in the Unicode specification. + */ + COMBINING_SPACING_MARK(8, "Mc"), + + /** + * General category "Nd" in the Unicode specification. + */ + DECIMAL_DIGIT_NUMBER(9, "Nd"), + + /** + * General category "Nl" in the Unicode specification. + */ + LETTER_NUMBER(10, "Nl"), + + /** + * General category "No" in the Unicode specification. + */ + OTHER_NUMBER(11, "No"), + + /** + * General category "Zs" in the Unicode specification. + */ + SPACE_SEPARATOR(12, "Zs"), + + /** + * General category "Zl" in the Unicode specification. + */ + LINE_SEPARATOR(13, "Zl"), + + /** + * General category "Zp" in the Unicode specification. + */ + PARAGRAPH_SEPARATOR(14, "Zp"), + + /** + * General category "Cc" in the Unicode specification. + */ + CONTROL(15, "Cc"), + + /** + * General category "Cf" in the Unicode specification. + */ + FORMAT(16, "Cf"), + + /** + * General category "Co" in the Unicode specification. + */ + PRIVATE_USE(18, "Co"), + + /** + * General category "Cs" in the Unicode specification. + */ + SURROGATE(19, "Cs"), + + /** + * General category "Pd" in the Unicode specification. + */ + DASH_PUNCTUATION(20, "Pd"), + + /** + * General category "Ps" in the Unicode specification. + */ + START_PUNCTUATION(21, "Ps"), + + /** + * General category "Pe" in the Unicode specification. + */ + END_PUNCTUATION(22, "Pe"), + + /** + * General category "Pc" in the Unicode specification. + */ + CONNECTOR_PUNCTUATION(23, "Pc"), + + /** + * General category "Po" in the Unicode specification. + */ + OTHER_PUNCTUATION(24, "Po"), + + /** + * General category "Sm" in the Unicode specification. + */ + MATH_SYMBOL(25, "Sm"), + + /** + * General category "Sc" in the Unicode specification. + */ + CURRENCY_SYMBOL(26, "Sc"), + + /** + * General category "Sk" in the Unicode specification. + */ + MODIFIER_SYMBOL(27, "Sk"), + + /** + * General category "So" in the Unicode specification. + */ + OTHER_SYMBOL(28, "So"), + + /** + * General category "Pi" in the Unicode specification. + */ + INITIAL_QUOTE_PUNCTUATION(29, "Pi"), + + /** + * General category "Pf" in the Unicode specification. + */ + FINAL_QUOTE_PUNCTUATION(30, "Pf"); + + /** + * Returns `true` if [char] character belongs to this category. + */ + public actual operator fun contains(char: Char): Boolean = char.getCategoryValue() == this.value + + companion object { + internal fun valueOf(category: Int): CharCategory = + when (category) { + in 0..16 -> values()[category] + in 18..30 -> values()[category - 1] + else -> throw IllegalArgumentException("Category #$category is not defined.") + } + } +} diff --git a/libraries/stdlib/js/src/kotlin/text/char.kt b/libraries/stdlib/js/src/kotlin/text/char.kt index 654e619a8dc..442e0f178cf 100644 --- a/libraries/stdlib/js/src/kotlin/text/char.kt +++ b/libraries/stdlib/js/src/kotlin/text/char.kt @@ -5,9 +5,6 @@ package kotlin.text -// actually \s is enough to match all whitespace, but \xA0 added because of different regexp behavior of Rhino used in Selenium tests -public actual fun Char.isWhitespace(): Boolean = toString().matches("[\\s\\xA0]") - /** * Converts this character to lower case using Unicode mapping rules of the invariant locale. */ @@ -91,3 +88,142 @@ public actual fun Char.isHighSurrogate(): Boolean = this in Char.MIN_HIGH_SURROG * Returns `true` if this character is a Unicode low-surrogate code unit (also known as trailing-surrogate code unit). */ public actual fun Char.isLowSurrogate(): Boolean = this in Char.MIN_LOW_SURROGATE..Char.MAX_LOW_SURROGATE + +/** + * Returns the Unicode general category of this character. + */ +public actual val Char.category: CharCategory + get() = CharCategory.valueOf(getCategoryValue()) + +/** + * Returns `true` if this character (Unicode code point) is defined in Unicode. + * + * A character is considered to be defined in Unicode if its [category] is not [CharCategory.UNASSIGNED]. + */ +public actual fun Char.isDefined(): Boolean { + if (this < '\u0080') { + return true + } + return getCategoryValue() != CharCategory.UNASSIGNED.value +} + +/** + * Returns `true` if this character is a letter. + * + * A character is considered to be a letter if its [category] is [CharCategory.UPPERCASE_LETTER], + * [CharCategory.LOWERCASE_LETTER], [CharCategory.TITLECASE_LETTER], [CharCategory.MODIFIER_LETTER], or [CharCategory.OTHER_LETTER]. + * + * @sample samples.text.Chars.isLetter + */ +public actual fun Char.isLetter(): Boolean { + if (this in 'a'..'z' || this in 'A'..'Z') { + return true + } + if (this < '\u0080') { + return false + } + return isLetterImpl() +} + +/** + * Returns `true` if this character is a letter or digit. + * + * @see isLetter + * @see isDigit + * + * @sample samples.text.Chars.isLetterOrDigit + */ +public actual fun Char.isLetterOrDigit(): Boolean { + if (this in 'a'..'z' || this in 'A'..'Z' || this in '0'..'9') { + return true + } + if (this < '\u0080') { + return false + } + + return isDigitImpl() || isLetterImpl() +} + +/** + * Returns `true` if this character is a digit. + * + * A character is considered to be a digit if its [category] is [CharCategory.DECIMAL_DIGIT_NUMBER]. + * + * @sample samples.text.Chars.isDigit + */ +public actual fun Char.isDigit(): Boolean { + if (this in '0'..'9') { + return true + } + if (this < '\u0080') { + return false + } + return isDigitImpl() +} + +/** + * Returns `true` if this character is an upper case letter. + * + * A character is considered to be an upper case letter if its [category] is [CharCategory.UPPERCASE_LETTER]. + * + * @sample samples.text.Chars.isUpperCase + */ +public actual fun Char.isUpperCase(): Boolean { + if (this in 'A'..'Z') { + return true + } + if (this < '\u0080') { + return false + } + return isUpperCaseImpl() +} + +/** + * Returns `true` if this character is a lower case letter. + * + * A character is considered to be a lower case letter if its [category] is [CharCategory.LOWERCASE_LETTER]. + * + * @sample samples.text.Chars.isLowerCase + */ +public actual fun Char.isLowerCase(): Boolean { + if (this in 'a'..'z') { + return true + } + if (this < '\u0080') { + return false + } + return isLowerCaseImpl() +} + +/** + * Returns `true` if this character is a title case letter. + * + * A character is considered to be a title case letter if its [category] is [CharCategory.TITLECASE_LETTER]. + * + * @sample samples.text.Chars.isTitleCase + */ +public actual fun Char.isTitleCase(): Boolean { + if (this < '\u0080') { + return false + } + return getCategoryValue() == CharCategory.TITLECASE_LETTER.value +} + +/** + * Returns `true` if this character is an ISO control character. + * + * A character is considered to be an ISO control character if its [category] is [CharCategory.CONTROL]. + * + * @sample samples.text.Chars.isISOControl + */ +public actual fun Char.isISOControl(): Boolean { + return this <= '\u001F' || this in '\u007F'..'\u009F' +} + +/** + * Determines whether a character is whitespace according to the Unicode standard. + * Returns `true` if the character is whitespace. + * + * @sample samples.text.Chars.isWhitespace + */ +public actual fun Char.isWhitespace(): Boolean = isWhitespaceImpl() \ No newline at end of file diff --git a/libraries/stdlib/jvm/src/kotlin/text/CharCategoryJVM.kt b/libraries/stdlib/jvm/src/kotlin/text/CharCategoryJVM.kt new file mode 100644 index 00000000000..64304e988ae --- /dev/null +++ b/libraries/stdlib/jvm/src/kotlin/text/CharCategoryJVM.kt @@ -0,0 +1,177 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.text + +public actual enum class CharCategory(public val value: Int, public actual val code: String) { + /** + * General category "Cn" in the Unicode specification. + */ + UNASSIGNED(0, "Cn"), + + /** + * General category "Lu" in the Unicode specification. + */ + UPPERCASE_LETTER(1, "Lu"), + + /** + * General category "Ll" in the Unicode specification. + */ + LOWERCASE_LETTER(2, "Ll"), + + /** + * General category "Lt" in the Unicode specification. + */ + TITLECASE_LETTER(3, "Lt"), + + /** + * General category "Lm" in the Unicode specification. + */ + MODIFIER_LETTER(4, "Lm"), + + /** + * General category "Lo" in the Unicode specification. + */ + OTHER_LETTER(5, "Lo"), + + /** + * General category "Mn" in the Unicode specification. + */ + NON_SPACING_MARK(6, "Mn"), + + /** + * General category "Me" in the Unicode specification. + */ + ENCLOSING_MARK(7, "Me"), + + /** + * General category "Mc" in the Unicode specification. + */ + COMBINING_SPACING_MARK(8, "Mc"), + + /** + * General category "Nd" in the Unicode specification. + */ + DECIMAL_DIGIT_NUMBER(9, "Nd"), + + /** + * General category "Nl" in the Unicode specification. + */ + LETTER_NUMBER(10, "Nl"), + + /** + * General category "No" in the Unicode specification. + */ + OTHER_NUMBER(11, "No"), + + /** + * General category "Zs" in the Unicode specification. + */ + SPACE_SEPARATOR(12, "Zs"), + + /** + * General category "Zl" in the Unicode specification. + */ + LINE_SEPARATOR(13, "Zl"), + + /** + * General category "Zp" in the Unicode specification. + */ + PARAGRAPH_SEPARATOR(14, "Zp"), + + /** + * General category "Cc" in the Unicode specification. + */ + CONTROL(15, "Cc"), + + /** + * General category "Cf" in the Unicode specification. + */ + FORMAT(16, "Cf"), + + /** + * General category "Co" in the Unicode specification. + */ + PRIVATE_USE(18, "Co"), + + /** + * General category "Cs" in the Unicode specification. + */ + SURROGATE(19, "Cs"), + + /** + * General category "Pd" in the Unicode specification. + */ + DASH_PUNCTUATION(20, "Pd"), + + /** + * General category "Ps" in the Unicode specification. + */ + START_PUNCTUATION(21, "Ps"), + + /** + * General category "Pe" in the Unicode specification. + */ + END_PUNCTUATION(22, "Pe"), + + /** + * General category "Pc" in the Unicode specification. + */ + CONNECTOR_PUNCTUATION(23, "Pc"), + + /** + * General category "Po" in the Unicode specification. + */ + OTHER_PUNCTUATION(24, "Po"), + + /** + * General category "Sm" in the Unicode specification. + */ + MATH_SYMBOL(25, "Sm"), + + /** + * General category "Sc" in the Unicode specification. + */ + CURRENCY_SYMBOL(26, "Sc"), + + /** + * General category "Sk" in the Unicode specification. + */ + MODIFIER_SYMBOL(27, "Sk"), + + /** + * General category "So" in the Unicode specification. + */ + OTHER_SYMBOL(28, "So"), + + /** + * General category "Pi" in the Unicode specification. + */ + INITIAL_QUOTE_PUNCTUATION(29, "Pi"), + + /** + * General category "Pf" in the Unicode specification. + */ + FINAL_QUOTE_PUNCTUATION(30, "Pf"); + + /** + * Returns `true` if [char] character belongs to this category. + */ + public actual operator fun contains(char: Char): Boolean = Character.getType(char) == this.value + + companion object { + /** + * Returns the [CharCategory] corresponding to the specified [category] that represents a Java general category constant. + * + * @throws IllegalArgumentException if the [category] does not represent a Java general category constant. + */ + public fun valueOf(category: Int): CharCategory = + when (category) { + in 0..16 -> values()[category] + in 18..30 -> values()[category - 1] + else -> throw IllegalArgumentException("Category #$category is not defined.") + } + } +} \ No newline at end of file diff --git a/libraries/stdlib/jvm/src/kotlin/text/CharJVM.kt b/libraries/stdlib/jvm/src/kotlin/text/CharJVM.kt index 23489d81e19..309616a0e4d 100644 --- a/libraries/stdlib/jvm/src/kotlin/text/CharJVM.kt +++ b/libraries/stdlib/jvm/src/kotlin/text/CharJVM.kt @@ -10,32 +10,51 @@ package kotlin.text import java.util.Locale +/** + * Returns the Unicode general category of this character. + */ +public actual val Char.category: CharCategory + get() = CharCategory.valueOf(Character.getType(this)) + /** * Returns `true` if this character (Unicode code point) is defined in Unicode. + * + * A character is considered to be defined in Unicode if its [category] is not [CharCategory.UNASSIGNED]. */ @kotlin.internal.InlineOnly -public inline fun Char.isDefined(): Boolean = Character.isDefined(this) +public actual inline fun Char.isDefined(): Boolean = Character.isDefined(this) /** * Returns `true` if this character is a letter. + * + * A character is considered to be a letter if its [category] is [CharCategory.UPPERCASE_LETTER], + * [CharCategory.LOWERCASE_LETTER], [CharCategory.TITLECASE_LETTER], [CharCategory.MODIFIER_LETTER], or [CharCategory.OTHER_LETTER]. + * * @sample samples.text.Chars.isLetter */ @kotlin.internal.InlineOnly -public inline fun Char.isLetter(): Boolean = Character.isLetter(this) +public actual inline fun Char.isLetter(): Boolean = Character.isLetter(this) /** * Returns `true` if this character is a letter or digit. + * + * @see isLetter + * @see isDigit + * * @sample samples.text.Chars.isLetterOrDigit */ @kotlin.internal.InlineOnly -public inline fun Char.isLetterOrDigit(): Boolean = Character.isLetterOrDigit(this) +public actual inline fun Char.isLetterOrDigit(): Boolean = Character.isLetterOrDigit(this) /** - * Returns `true` if this character (Unicode code point) is a digit. + * Returns `true` if this character is a digit. + * + * A character is considered to be a digit if its [category] is [CharCategory.DECIMAL_DIGIT_NUMBER]. + * * @sample samples.text.Chars.isDigit */ @kotlin.internal.InlineOnly -public inline fun Char.isDigit(): Boolean = Character.isDigit(this) +public actual inline fun Char.isDigit(): Boolean = Character.isDigit(this) /** @@ -47,10 +66,13 @@ public inline fun Char.isIdentifierIgnorable(): Boolean = Character.isIdentifier /** * Returns `true` if this character is an ISO control character. + * + * A character is considered to be an ISO control character if its [category] is [CharCategory.CONTROL]. + * * @sample samples.text.Chars.isISOControl */ @kotlin.internal.InlineOnly -public inline fun Char.isISOControl(): Boolean = Character.isISOControl(this) +public actual inline fun Char.isISOControl(): Boolean = Character.isISOControl(this) /** * Returns `true` if this character (Unicode code point) may be part of a Java identifier as other than the first character. @@ -69,6 +91,7 @@ public inline fun Char.isJavaIdentifierStart(): Boolean = Character.isJavaIdenti /** * Determines whether a character is whitespace according to the Unicode standard. * Returns `true` if the character is whitespace. + * * @sample samples.text.Chars.isWhitespace */ public actual fun Char.isWhitespace(): Boolean = Character.isWhitespace(this) || Character.isSpaceChar(this) @@ -78,14 +101,14 @@ public actual fun Char.isWhitespace(): Boolean = Character.isWhitespace(this) || * @sample samples.text.Chars.isUpperCase */ @kotlin.internal.InlineOnly -public inline fun Char.isUpperCase(): Boolean = Character.isUpperCase(this) +public actual inline fun Char.isUpperCase(): Boolean = Character.isUpperCase(this) /** * Returns `true` if this character is lower case. * @sample samples.text.Chars.isLowerCase */ @kotlin.internal.InlineOnly -public inline fun Char.isLowerCase(): Boolean = Character.isLowerCase(this) +public actual inline fun Char.isLowerCase(): Boolean = Character.isLowerCase(this) /** * Converts this character to lower case using Unicode mapping rules of the invariant locale. @@ -192,7 +215,7 @@ public fun Char.lowercase(locale: Locale): String = toString().lowercase(locale) * @sample samples.text.Chars.isTitleCase */ @kotlin.internal.InlineOnly -public inline fun Char.isTitleCase(): Boolean = Character.isTitleCase(this) +public actual inline fun Char.isTitleCase(): Boolean = Character.isTitleCase(this) /** * Converts this character to title case using Unicode mapping rules of the invariant locale. @@ -260,11 +283,6 @@ public fun Char.titlecase(locale: Locale): String { return titlecaseChar().toString() } -/** - * Returns a value indicating a character's general category. - */ -public val Char.category: CharCategory get() = CharCategory.valueOf(Character.getType(this)) - /** * Returns the Unicode directionality property for the given character. */ diff --git a/libraries/stdlib/src/kotlin/text/Char.kt b/libraries/stdlib/src/kotlin/text/Char.kt index a71cf8999f2..6cf68a28206 100644 --- a/libraries/stdlib/src/kotlin/text/Char.kt +++ b/libraries/stdlib/src/kotlin/text/Char.kt @@ -227,3 +227,88 @@ public fun Char.equals(other: Char, ignoreCase: Boolean = false): Boolean { * Returns `true` if this character is a Unicode surrogate code unit. */ public fun Char.isSurrogate(): Boolean = this in Char.MIN_SURROGATE..Char.MAX_SURROGATE + +/** + * Returns the Unicode general category of this character. + */ +public expect val Char.category: CharCategory + +/** + * Returns `true` if this character (Unicode code point) is defined in Unicode. + * + * A character is considered to be defined in Unicode if its [category] is not [CharCategory.UNASSIGNED]. + */ +public expect fun Char.isDefined(): Boolean + +/** + * Returns `true` if this character is a letter. + * + * A character is considered to be a letter if its [category] is [CharCategory.UPPERCASE_LETTER], + * [CharCategory.LOWERCASE_LETTER], [CharCategory.TITLECASE_LETTER], [CharCategory.MODIFIER_LETTER], or [CharCategory.OTHER_LETTER]. + * + * @sample samples.text.Chars.isLetter + */ +public expect fun Char.isLetter(): Boolean + +/** + * Returns `true` if this character is a letter or digit. + * + * @see isLetter + * @see isDigit + * + * @sample samples.text.Chars.isLetterOrDigit + */ +public expect fun Char.isLetterOrDigit(): Boolean + +/** + * Returns `true` if this character is a digit. + * + * A character is considered to be a digit if its [category] is [CharCategory.DECIMAL_DIGIT_NUMBER]. + * + * @sample samples.text.Chars.isDigit + */ +public expect fun Char.isDigit(): Boolean + +/** + * Returns `true` if this character is an upper case letter. + * + * A character is considered to be an upper case letter if its [category] is [CharCategory.UPPERCASE_LETTER]. + * + * @sample samples.text.Chars.isUpperCase + */ +public expect fun Char.isUpperCase(): Boolean + +/** + * Returns `true` if this character is a lower case letter. + * + * A character is considered to be a lower case letter if its [category] is [CharCategory.LOWERCASE_LETTER]. + * + * @sample samples.text.Chars.isLowerCase + */ +public expect fun Char.isLowerCase(): Boolean + +/** + * Returns `true` if this character is a title case letter. + * + * A character is considered to be a title case letter if its [category] is [CharCategory.TITLECASE_LETTER]. + * + * @sample samples.text.Chars.isTitleCase + */ +public expect fun Char.isTitleCase(): Boolean + +/** + * Returns `true` if this character is an ISO control character. + * + * A character is considered to be an ISO control character if its [category] is [CharCategory.CONTROL]. + * + * @sample samples.text.Chars.isISOControl + */ +public expect fun Char.isISOControl(): Boolean + +/** + * Determines whether a character is whitespace according to the Unicode standard. + * Returns `true` if the character is whitespace. + * + * @sample samples.text.Chars.isWhitespace + */ +public expect fun Char.isWhitespace(): Boolean diff --git a/libraries/stdlib/jvm/src/kotlin/text/CharCategory.kt b/libraries/stdlib/src/kotlin/text/CharCategory.kt similarity index 52% rename from libraries/stdlib/jvm/src/kotlin/text/CharCategory.kt rename to libraries/stdlib/src/kotlin/text/CharCategory.kt index ea23e401763..663818c84a5 100644 --- a/libraries/stdlib/jvm/src/kotlin/text/CharCategory.kt +++ b/libraries/stdlib/src/kotlin/text/CharCategory.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ @@ -8,166 +8,164 @@ package kotlin.text /** * Represents the character general category in the Unicode specification. */ -public enum class CharCategory(public val value: Int, public val code: String) { +public expect enum class CharCategory { /** * General category "Cn" in the Unicode specification. */ - UNASSIGNED(Character.UNASSIGNED.toInt(), "Cn"), + UNASSIGNED, /** * General category "Lu" in the Unicode specification. */ - UPPERCASE_LETTER(Character.UPPERCASE_LETTER.toInt(), "Lu"), + UPPERCASE_LETTER, /** * General category "Ll" in the Unicode specification. */ - LOWERCASE_LETTER(Character.LOWERCASE_LETTER.toInt(), "Ll"), + LOWERCASE_LETTER, /** * General category "Lt" in the Unicode specification. */ - TITLECASE_LETTER(Character.TITLECASE_LETTER.toInt(), "Lt"), + TITLECASE_LETTER, /** * General category "Lm" in the Unicode specification. */ - MODIFIER_LETTER(Character.MODIFIER_LETTER.toInt(), "Lm"), + MODIFIER_LETTER, /** * General category "Lo" in the Unicode specification. */ - OTHER_LETTER(Character.OTHER_LETTER.toInt(), "Lo"), + OTHER_LETTER, /** * General category "Mn" in the Unicode specification. */ - NON_SPACING_MARK(Character.NON_SPACING_MARK.toInt(), "Mn"), + NON_SPACING_MARK, /** * General category "Me" in the Unicode specification. */ - ENCLOSING_MARK(Character.ENCLOSING_MARK.toInt(), "Me"), + ENCLOSING_MARK, /** * General category "Mc" in the Unicode specification. */ - COMBINING_SPACING_MARK(Character.COMBINING_SPACING_MARK.toInt(), "Mc"), + COMBINING_SPACING_MARK, /** * General category "Nd" in the Unicode specification. */ - DECIMAL_DIGIT_NUMBER(Character.DECIMAL_DIGIT_NUMBER.toInt(), "Nd"), + DECIMAL_DIGIT_NUMBER, /** * General category "Nl" in the Unicode specification. */ - LETTER_NUMBER(Character.LETTER_NUMBER.toInt(), "Nl"), + LETTER_NUMBER, /** * General category "No" in the Unicode specification. */ - OTHER_NUMBER(Character.OTHER_NUMBER.toInt(), "No"), + OTHER_NUMBER, /** * General category "Zs" in the Unicode specification. */ - SPACE_SEPARATOR(Character.SPACE_SEPARATOR.toInt(), "Zs"), + SPACE_SEPARATOR, /** * General category "Zl" in the Unicode specification. */ - LINE_SEPARATOR(Character.LINE_SEPARATOR.toInt(), "Zl"), + LINE_SEPARATOR, /** * General category "Zp" in the Unicode specification. */ - PARAGRAPH_SEPARATOR(Character.PARAGRAPH_SEPARATOR.toInt(), "Zp"), + PARAGRAPH_SEPARATOR, /** * General category "Cc" in the Unicode specification. */ - CONTROL(Character.CONTROL.toInt(), "Cc"), + CONTROL, /** * General category "Cf" in the Unicode specification. */ - FORMAT(Character.FORMAT.toInt(), "Cf"), + FORMAT, /** * General category "Co" in the Unicode specification. */ - PRIVATE_USE(Character.PRIVATE_USE.toInt(), "Co"), + PRIVATE_USE, /** * General category "Cs" in the Unicode specification. */ - SURROGATE(Character.SURROGATE.toInt(), "Cs"), + SURROGATE, /** * General category "Pd" in the Unicode specification. */ - DASH_PUNCTUATION(Character.DASH_PUNCTUATION.toInt(), "Pd"), + DASH_PUNCTUATION, /** * General category "Ps" in the Unicode specification. */ - START_PUNCTUATION(Character.START_PUNCTUATION.toInt(), "Ps"), + START_PUNCTUATION, /** * General category "Pe" in the Unicode specification. */ - END_PUNCTUATION(Character.END_PUNCTUATION.toInt(), "Pe"), + END_PUNCTUATION, /** * General category "Pc" in the Unicode specification. */ - CONNECTOR_PUNCTUATION(Character.CONNECTOR_PUNCTUATION.toInt(), "Pc"), + CONNECTOR_PUNCTUATION, /** * General category "Po" in the Unicode specification. */ - OTHER_PUNCTUATION(Character.OTHER_PUNCTUATION.toInt(), "Po"), + OTHER_PUNCTUATION, /** * General category "Sm" in the Unicode specification. */ - MATH_SYMBOL(Character.MATH_SYMBOL.toInt(), "Sm"), + MATH_SYMBOL, /** * General category "Sc" in the Unicode specification. */ - CURRENCY_SYMBOL(Character.CURRENCY_SYMBOL.toInt(), "Sc"), + CURRENCY_SYMBOL, /** * General category "Sk" in the Unicode specification. */ - MODIFIER_SYMBOL(Character.MODIFIER_SYMBOL.toInt(), "Sk"), + MODIFIER_SYMBOL, /** * General category "So" in the Unicode specification. */ - OTHER_SYMBOL(Character.OTHER_SYMBOL.toInt(), "So"), + OTHER_SYMBOL, /** * General category "Pi" in the Unicode specification. */ - INITIAL_QUOTE_PUNCTUATION(Character.INITIAL_QUOTE_PUNCTUATION.toInt(), "Pi"), + INITIAL_QUOTE_PUNCTUATION, /** * General category "Pf" in the Unicode specification. */ - FINAL_QUOTE_PUNCTUATION(Character.FINAL_QUOTE_PUNCTUATION.toInt(), "Pf"); + FINAL_QUOTE_PUNCTUATION; + + /** + * Two-letter code of this general category in the Unicode specification. + */ + public val code: String /** * Returns `true` if [char] character belongs to this category. */ - public operator fun contains(char: Char): Boolean = Character.getType(char) == this.value - - - public companion object { - private val categoryMap by lazy { CharCategory.values().associateBy { it.value } } - - public fun valueOf(category: Int): CharCategory = categoryMap[category] ?: throw IllegalArgumentException("Category #$category is not defined.") - } + public operator fun contains(char: Char): Boolean } diff --git a/libraries/stdlib/test/text/CharTest.kt b/libraries/stdlib/test/text/CharTest.kt index d3c4cfe9765..1b054cc097a 100644 --- a/libraries/stdlib/test/text/CharTest.kt +++ b/libraries/stdlib/test/text/CharTest.kt @@ -7,6 +7,8 @@ package test.text import kotlin.test.Test import kotlin.test.assertEquals +import kotlin.test.assertFalse +import kotlin.test.assertTrue import kotlin.test.assertFails class CharTest { @@ -146,4 +148,157 @@ class CharTest { testFails(100, radix = 36) testFails(100, radix = 110) } + + private fun charToCategory() = mapOf( + '\u0378' to "Cn", + 'A' to "Lu", // \u0041 + 'a' to "Ll", // \u0061 + 'Dž' to "Lt", // \u01C5 + 'ʰ' to "Lm", // \u02B0 + 'ƻ' to "Lo", // \u01BB + '\u0300' to "Mn", + '\u0489' to "Me", + '\u0903' to "Mc", + '0' to "Nd", // \u0030 + 'Ⅰ' to "Nl", // \u2160 + '²' to "No", // \u00B2 + ' ' to "Zs", // \u0020 + '\u2028' to "Zl", + '\u2029' to "Zp", + '\u0018' to "Cc", + '\u00AD' to "Cf", + '\uE000' to "Co", + '\uD800' to "Cs", + '\u002D' to "Pd", + '(' to "Ps", // \u0028 + ')' to "Pe", // \u0029 + '_' to "Pc", // \u005F + '!' to "Po", // \u0021 + '+' to "Sm", // \u002B + '$' to "Sc", // \u0024 + '^' to "Sk", // \u005E + '©' to "So", // \u00A9 + '«' to "Pi", // \u00AB + '»' to "Pf" // \u00BB + ) + + @Test + fun charCategory() { + for ((char, categoryCode) in charToCategory()) { + assertEquals(categoryCode, char.category.code, "char code: ${char.toInt().toString(radix = 16)}") + } + } + + @Test + fun charCategoryUnassigned() { + val unassignedChar = '\u0378' + assertFalse(unassignedChar.isDefined()) + assertEquals(CharCategory.UNASSIGNED, unassignedChar.category) + assertEquals("Cn", CharCategory.UNASSIGNED.code) + } + + @Test + fun charCategoryUppercaseLetter() { + val latinCapitalLetterA = 'A' // \u0041 + assertTrue(latinCapitalLetterA.isLetterOrDigit()) + assertTrue(latinCapitalLetterA.isLetter()) + assertTrue(latinCapitalLetterA.isUpperCase()) + assertEquals(CharCategory.UPPERCASE_LETTER, latinCapitalLetterA.category) + assertEquals("Lu", CharCategory.UPPERCASE_LETTER.code) + } + + @Test + fun charCategoryLowercaseLetter() { + val latinSmallLetterA = 'a' // \u0061 + assertTrue(latinSmallLetterA.isLetterOrDigit()) + assertTrue(latinSmallLetterA.isLetter()) + assertTrue(latinSmallLetterA.isLowerCase()) + assertEquals(CharCategory.LOWERCASE_LETTER, latinSmallLetterA.category) + assertEquals("Ll", CharCategory.LOWERCASE_LETTER.code) + } + + @Test + fun charCategoryTitlecaseLetter() { + val latinCapitalLetterDz = 'Dž' // \u01C5 + assertTrue(latinCapitalLetterDz.isLetterOrDigit()) + assertTrue(latinCapitalLetterDz.isLetter()) + assertTrue(latinCapitalLetterDz.isTitleCase()) + assertEquals(CharCategory.TITLECASE_LETTER, latinCapitalLetterDz.category) + assertEquals("Lt", CharCategory.TITLECASE_LETTER.code) + } + + @Test + fun charCategoryModifierLetter() { + val modifierLetterSmallH = 'ʰ' // \u02B0 + assertTrue(modifierLetterSmallH.isLetterOrDigit()) + assertTrue(modifierLetterSmallH.isLetter()) + assertEquals(CharCategory.MODIFIER_LETTER, modifierLetterSmallH.category) + assertEquals("Lm", CharCategory.MODIFIER_LETTER.code) + } + + @Test + fun charCategoryOtherLetter() { + val twoWithStroke = 'ƻ' // \u01BB + assertTrue(twoWithStroke.isLetterOrDigit()) + assertTrue(twoWithStroke.isLetter()) + assertEquals(CharCategory.OTHER_LETTER, twoWithStroke.category) + assertEquals("Lo", CharCategory.OTHER_LETTER.code) + } + + @Test + fun charCategoryDecimalDigitNumber() { + val digitZero = '0' // \u0030 + assertTrue(digitZero.isLetterOrDigit()) + assertTrue(digitZero.isDigit()) + assertEquals(CharCategory.DECIMAL_DIGIT_NUMBER, digitZero.category) + assertEquals("Nd", CharCategory.DECIMAL_DIGIT_NUMBER.code) + } + + @Test + fun charCategoryLetterNumber() { + val romanNumberOne = 'Ⅰ' // \u2160 + assertFalse(romanNumberOne.isDigit()) + assertEquals(CharCategory.LETTER_NUMBER, romanNumberOne.category) + assertEquals("Nl", CharCategory.LETTER_NUMBER.code) + } + + @Test + fun charCategoryOtherNumber() { + val superscriptTwo = '²' // \u00B2 + assertFalse(superscriptTwo.isDigit()) + assertEquals(CharCategory.OTHER_NUMBER, superscriptTwo.category) + assertEquals("No", CharCategory.OTHER_NUMBER.code) + } + + @Test + fun charCategorySpaceSeparator() { + val superscriptTwo = ' ' // \u0020 + assertTrue(superscriptTwo.isWhitespace()) + assertEquals(CharCategory.SPACE_SEPARATOR, superscriptTwo.category) + assertEquals("Zs", CharCategory.SPACE_SEPARATOR.code) + } + + @Test + fun charCategoryLineSeparator() { + val lineSeparator = '\u2028' + assertTrue(lineSeparator.isWhitespace()) + assertEquals(CharCategory.LINE_SEPARATOR, lineSeparator.category) + assertEquals("Zl", CharCategory.LINE_SEPARATOR.code) + } + + @Test + fun charCategoryParagraphSeparator() { + val paragraphSeparator = '\u2029' + assertTrue(paragraphSeparator.isWhitespace()) + assertEquals(CharCategory.PARAGRAPH_SEPARATOR, paragraphSeparator.category) + assertEquals("Zp", CharCategory.PARAGRAPH_SEPARATOR.code) + } + + @Test + fun charCategoryControl() { + val controlCancel = '\u0018' + assertTrue(controlCancel.isISOControl()) + assertEquals(CharCategory.CONTROL, controlCancel.category) + assertEquals("Cc", CharCategory.CONTROL.code) + } } diff --git a/libraries/stdlib/wasm/src/kotlin/Text.kt b/libraries/stdlib/wasm/src/kotlin/Text.kt index 4d0c8fcc931..ff024aa5d81 100644 --- a/libraries/stdlib/wasm/src/kotlin/Text.kt +++ b/libraries/stdlib/wasm/src/kotlin/Text.kt @@ -63,7 +63,6 @@ actual enum class RegexOption { // From char.kt -actual fun Char.isWhitespace(): Boolean = TODO("Wasm stdlib: Text") actual fun Char.isHighSurrogate(): Boolean = TODO("Wasm stdlib: Text") actual fun Char.isLowSurrogate(): Boolean = TODO("Wasm stdlib: Text") @@ -131,6 +130,92 @@ public actual fun Char.uppercaseChar(): Char = TODO("Wasm stdlib: Text") @ExperimentalStdlibApi public actual fun Char.uppercase(): String = TODO("Wasm stdlib: Text") + +/** + * Returns the Unicode general category of this character. + */ +public actual val Char.category: CharCategory get() = TODO("Wasm stdlib: Text") + +/** + * Returns `true` if this character (Unicode code point) is defined in Unicode. + * + * A character is considered to be defined in Unicode if its [category] is not [CharCategory.UNASSIGNED]. + */ +public actual fun Char.isDefined(): Boolean = TODO("Wasm stdlib: Text") + +/** + * Returns `true` if this character is a letter. + * + * A character is considered to be a letter if its [category] is [CharCategory.UPPERCASE_LETTER], + * [CharCategory.LOWERCASE_LETTER], [CharCategory.TITLECASE_LETTER], [CharCategory.MODIFIER_LETTER], or [CharCategory.OTHER_LETTER]. + * + * @sample samples.text.Chars.isLetter + */ +public actual fun Char.isLetter(): Boolean = TODO("Wasm stdlib: Text") + +/** + * Returns `true` if this character is a letter or digit. + * + * @see isLetter + * @see isDigit + * + * @sample samples.text.Chars.isLetterOrDigit + */ +public actual fun Char.isLetterOrDigit(): Boolean = TODO("Wasm stdlib: Text") + +/** + * Returns `true` if this character is a digit. + * + * A character is considered to be a digit if its [category] is [CharCategory.DECIMAL_DIGIT_NUMBER]. + * + * @sample samples.text.Chars.isDigit + */ +public actual fun Char.isDigit(): Boolean = TODO("Wasm stdlib: Text") + +/** + * Returns `true` if this character is an upper case letter. + * + * A character is considered to be an upper case letter if its [category] is [CharCategory.UPPERCASE_LETTER]. + * + * @sample samples.text.Chars.isUpperCase + */ +public actual fun Char.isUpperCase(): Boolean = TODO("Wasm stdlib: Text") + +/** + * Returns `true` if this character is a lower case letter. + * + * A character is considered to be a lower case letter if its [category] is [CharCategory.LOWERCASE_LETTER]. + * + * @sample samples.text.Chars.isLowerCase + */ +public actual fun Char.isLowerCase(): Boolean = TODO("Wasm stdlib: Text") + +/** + * Returns `true` if this character is a title case letter. + * + * A character is considered to be a title case letter if its [category] is [CharCategory.TITLECASE_LETTER]. + * + * @sample samples.text.Chars.isTitleCase + */ +public actual fun Char.isTitleCase(): Boolean = TODO("Wasm stdlib: Text") + +/** + * Returns `true` if this character is an ISO control character. + * + * A character is considered to be an ISO control character if its [category] is [CharCategory.CONTROL]. + * + * @sample samples.text.Chars.isISOControl + */ +public actual fun Char.isISOControl(): Boolean = TODO("Wasm stdlib: Text") + +/** + * Determines whether a character is whitespace according to the Unicode standard. + * Returns `true` if the character is whitespace. + * + * @sample samples.text.Chars.isWhitespace + */ +public actual fun Char.isWhitespace(): Boolean = TODO("Wasm stdlib: Text") + // From string.kt diff --git a/libraries/stdlib/wasm/src/kotlin/text/CharCategory.kt b/libraries/stdlib/wasm/src/kotlin/text/CharCategory.kt new file mode 100644 index 00000000000..5655ceb6db6 --- /dev/null +++ b/libraries/stdlib/wasm/src/kotlin/text/CharCategory.kt @@ -0,0 +1,171 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.text + +/** + * Represents the character general category in the Unicode specification. + */ +public actual enum class CharCategory { + /** + * General category "Cn" in the Unicode specification. + */ + UNASSIGNED, + + /** + * General category "Lu" in the Unicode specification. + */ + UPPERCASE_LETTER, + + /** + * General category "Ll" in the Unicode specification. + */ + LOWERCASE_LETTER, + + /** + * General category "Lt" in the Unicode specification. + */ + TITLECASE_LETTER, + + /** + * General category "Lm" in the Unicode specification. + */ + MODIFIER_LETTER, + + /** + * General category "Lo" in the Unicode specification. + */ + OTHER_LETTER, + + /** + * General category "Mn" in the Unicode specification. + */ + NON_SPACING_MARK, + + /** + * General category "Me" in the Unicode specification. + */ + ENCLOSING_MARK, + + /** + * General category "Mc" in the Unicode specification. + */ + COMBINING_SPACING_MARK, + + /** + * General category "Nd" in the Unicode specification. + */ + DECIMAL_DIGIT_NUMBER, + + /** + * General category "Nl" in the Unicode specification. + */ + LETTER_NUMBER, + + /** + * General category "No" in the Unicode specification. + */ + OTHER_NUMBER, + + /** + * General category "Zs" in the Unicode specification. + */ + SPACE_SEPARATOR, + + /** + * General category "Zl" in the Unicode specification. + */ + LINE_SEPARATOR, + + /** + * General category "Zp" in the Unicode specification. + */ + PARAGRAPH_SEPARATOR, + + /** + * General category "Cc" in the Unicode specification. + */ + CONTROL, + + /** + * General category "Cf" in the Unicode specification. + */ + FORMAT, + + /** + * General category "Co" in the Unicode specification. + */ + PRIVATE_USE, + + /** + * General category "Cs" in the Unicode specification. + */ + SURROGATE, + + /** + * General category "Pd" in the Unicode specification. + */ + DASH_PUNCTUATION, + + /** + * General category "Ps" in the Unicode specification. + */ + START_PUNCTUATION, + + /** + * General category "Pe" in the Unicode specification. + */ + END_PUNCTUATION, + + /** + * General category "Pc" in the Unicode specification. + */ + CONNECTOR_PUNCTUATION, + + /** + * General category "Po" in the Unicode specification. + */ + OTHER_PUNCTUATION, + + /** + * General category "Sm" in the Unicode specification. + */ + MATH_SYMBOL, + + /** + * General category "Sc" in the Unicode specification. + */ + CURRENCY_SYMBOL, + + /** + * General category "Sk" in the Unicode specification. + */ + MODIFIER_SYMBOL, + + /** + * General category "So" in the Unicode specification. + */ + OTHER_SYMBOL, + + /** + * General category "Pi" in the Unicode specification. + */ + INITIAL_QUOTE_PUNCTUATION, + + /** + * General category "Pf" in the Unicode specification. + */ + FINAL_QUOTE_PUNCTUATION; + + /** + * Two-letter code of this general category in the Unicode specification. + */ + public actual val code: String get() = TODO("Wasm stdlib: Text") + + /** + * Returns `true` if [char] character belongs to this category. + */ + public actual operator fun contains(char: Char): Boolean = TODO("Wasm stdlib: Text") +} diff --git a/libraries/tools/kotlin-stdlib-gen/build.gradle b/libraries/tools/kotlin-stdlib-gen/build.gradle index d1f953ec885..f18b77051aa 100644 --- a/libraries/tools/kotlin-stdlib-gen/build.gradle +++ b/libraries/tools/kotlin-stdlib-gen/build.gradle @@ -34,4 +34,11 @@ task run(type: JavaExec) { classpath sourceSets.main.runtimeClasspath args = ["${rootDir}"] systemProperty 'line.separator', '\n' +} + +task generateUnicodeData(type: JavaExec) { + group 'application' + main 'generators.unicode.GenerateUnicodeDataKt' + classpath sourceSets.main.runtimeClasspath + args = ["${rootDir}"] } \ No newline at end of file diff --git a/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/GenerateUnicodeData.kt b/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/GenerateUnicodeData.kt new file mode 100644 index 00000000000..41f057d784c --- /dev/null +++ b/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/GenerateUnicodeData.kt @@ -0,0 +1,99 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package generators.unicode + +import generators.unicode.ranges.CharCategoryTestGenerator +import generators.unicode.ranges.RangesGenerator +import templates.COPYRIGHT_NOTICE +import templates.KotlinTarget +import templates.readCopyrightNoticeFromProfile +import java.io.File +import java.net.URL +import kotlin.system.exitProcess + + +// Go to https://www.unicode.org/versions/latest/ to find out the latest public version of the Unicode Character Database files. +private const val unicodeDataUrl = "https://www.unicode.org/Public/13.0.0/ucd/UnicodeData.txt" + +/** + * This program generates sources related to UnicodeData.txt. + * There are two ways to run the program. + * 1. Pass the root directory of the project to generate sources for js and js-ir. + * _CharCategoryTest.kt and supporting files are also generated to test the generated sources. + * The generated test is meant to be run after updating Unicode version and should not be merged to master. + * 2. Pass the name of the target to generate sources for, and the directory to generate sources in. + * No tests are generated. + */ +fun main(args: Array) { + + val unicodeDataLines = URL(unicodeDataUrl).openStream().reader().readLines() + + val generators = mutableListOf() + + fun addRangesGenerators(generatedDir: File, target: KotlinTarget) { + val categoryRangesGenerator = RangesGenerator.forCharCategory(generatedDir.resolve("_CharCategories.kt"), target) + val digitRangesGenerator = RangesGenerator.forDigit(generatedDir.resolve("_DigitChars.kt"), target) + val letterRangesGenerator = RangesGenerator.forLetter(generatedDir.resolve("_LetterChars.kt"), target) + val whitespaceRangesGenerator = RangesGenerator.forWhitespace(generatedDir.resolve("_WhitespaceChars.kt")) + generators.add(categoryRangesGenerator) + generators.add(digitRangesGenerator) + generators.add(letterRangesGenerator) + generators.add(whitespaceRangesGenerator) + } + + when (args.size) { + 1 -> { + val baseDir = File(args.first()) + + val categoryTestFile = baseDir.resolve("libraries/stdlib/js/test/text/unicodeData/_CharCategoryTest.kt") + val categoryTestGenerator = CharCategoryTestGenerator(categoryTestFile) + generators.add(categoryTestGenerator) + + val jsGeneratedDir = baseDir.resolve("libraries/stdlib/js/src/generated/") + addRangesGenerators(jsGeneratedDir, KotlinTarget.JS) + + val jsIrGeneratedDir = baseDir.resolve("libraries/stdlib/js-ir/src/generated/") + addRangesGenerators(jsIrGeneratedDir, KotlinTarget.JS_IR) + + // For debugging. To see the file content + val unicodeDataFile = baseDir.resolve("libraries/tools/kotlin-stdlib-gen/src/generators/unicode/UnicodeData.txt") + unicodeDataFile.writeText(unicodeDataLines.joinToString(separator = "\n")) + } + 2 -> { + val (targetName, targetDir) = args + + val target = KotlinTarget.values.singleOrNull { it.name.equals(targetName, ignoreCase = true) } + ?: error("Invalid target: $targetName") + + addRangesGenerators(File(targetDir), target) + } + else -> { + println( + """Parameters: + - generates UnicodeData.txt sources for js and js-ir targets using paths derived from specified base path + - generates UnicodeData.txt sources for the specified target in the specified target directory +""" + ) + exitProcess(1) + } + } + + COPYRIGHT_NOTICE = + readCopyrightNoticeFromProfile { Thread.currentThread().contextClassLoader.getResourceAsStream("apache.xml").reader() } + + unicodeDataLines.forEach { line -> + val parts = line.split(";") + if (parts[0].length <= 4) { + generators.forEach { it.appendChar(parts[0], parts[1], parts[2]) } + } + } + generators.forEach { it.close() } +} + +internal interface UnicodeDataGenerator { + fun appendChar(char: String, name: String, categoryCode: String) + fun close() +} diff --git a/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/CharCategoryTestGenerator.kt b/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/CharCategoryTestGenerator.kt new file mode 100644 index 00000000000..67a3ef246d7 --- /dev/null +++ b/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/CharCategoryTestGenerator.kt @@ -0,0 +1,173 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package generators.unicode.ranges + +import generators.unicode.UnicodeDataGenerator +import generators.unicode.ranges.writers.writeHeader +import java.io.File +import java.io.FileWriter + +internal class CharCategoryTestGenerator(private val outputFile: File) : UnicodeDataGenerator { + private var arrayIndex = 0 + private var arraySize = 0 + private var writer: FileWriter? = null + + init { + outputFile.parentFile.mkdirs() + } + + override fun appendChar(char: String, name: String, categoryCode: String) { + if (arraySize == 0) { + writer?.appendLine(")") + writer?.close() + + generateUnicodeDataHeader(arrayIndex) + } + + val isStart = name.endsWith(", First>") + + writer?.appendLine(" CharProperties(char = '\\u$char', isStartOfARange = $isStart, categoryCode = \"$categoryCode\"),") + + arraySize++ + if (arraySize == 2048) { + arraySize = 0 + arrayIndex++ + } + } + + override fun close() { + writer?.appendLine(")") + writer?.close() + + generateFlattenUnicodeData() + generateCharProperties() + generateCharCategoryTest() + } + + private fun generateFlattenUnicodeData() { + val file = outputFile.resolveSibling("_UnicodeDataFlatten.kt") + generateFileHeader(file) + + writer?.appendLine("internal val unicodeData = arrayOf>(") + for (index in 0..arrayIndex) { + writer?.appendLine(" unicodeData$index,") + } + writer?.appendLine(").flatten()") + + writer?.close() + } + + private fun generateCharProperties() { + val file = outputFile.resolveSibling("_CharProperties.kt") + generateFileHeader(file) + + writer?.appendLine("data class CharProperties(val char: Char, val isStartOfARange: Boolean, val categoryCode: String)") + writer?.close() + } + + private fun generateCharCategoryTest() { + generateFileHeader(outputFile) + + writer?.appendLine( + """ +import kotlin.test.* + +class CharCategoryTest { + @Test + fun category() { + val charProperties = hashMapOf() + + for (properties in unicodeData) { + charProperties[properties.char] = properties + } + + var properties: CharProperties? = null + + for (char in Char.MIN_VALUE..Char.MAX_VALUE) { + if (charProperties.containsKey(char)) { + properties = charProperties.getValue(char) + } else if (properties?.isStartOfARange != true) { + properties = null + } + + val charCode = char.toInt().toString(radix = 16).padStart(length = 4, padChar = '0') + val expectedCategoryCode = properties?.categoryCode ?: CharCategory.UNASSIGNED.code + + fun test(expected: T, actual: T, name: String) { + assertEquals(expected, actual, "Char:[${"$"}char] with code:[${"$"}charCode] in Unicode has ${"$"}name = ${"$"}expected, but in Kotlin ${"$"}name = ${"$"}actual") + } + + test(expectedCategoryCode, char.category.code, "category") + + val expectedIsDigit = isDigit(expectedCategoryCode) + test(expectedIsDigit, char.isDigit(), "isDigit()") + + val expectedIsLetter = isLetter(expectedCategoryCode) + test(expectedIsLetter, char.isLetter(), "isLetter()") + + val expectedIsLetterOrDigit = expectedIsLetter || expectedIsDigit + test(expectedIsLetterOrDigit, char.isLetterOrDigit(), "isLetterOrDigit()") + + val expectedIsLowerCase = isLowerCase(expectedCategoryCode) + test(expectedIsLowerCase, char.isLowerCase(), "isLowerCase()") + + val expectedIsUpperCase = isUpperCase(expectedCategoryCode) + test(expectedIsUpperCase, char.isUpperCase(), "isUpperCase()") + + val expectedIsWhitespace = isWhitespace(char, expectedCategoryCode) + test(expectedIsWhitespace, char.isWhitespace(), "isWhitespace()") + } + } + + private fun isDigit(categoryCode: String): Boolean { + return categoryCode == CharCategory.DECIMAL_DIGIT_NUMBER.code + } + + private fun isLetter(categoryCode: String): Boolean { + return categoryCode in listOf( + CharCategory.UPPERCASE_LETTER, + CharCategory.LOWERCASE_LETTER, + CharCategory.TITLECASE_LETTER, + CharCategory.MODIFIER_LETTER, + CharCategory.OTHER_LETTER + ).map { it.code } + } + + private fun isLowerCase(categoryCode: String): Boolean { + return categoryCode == CharCategory.LOWERCASE_LETTER.code + } + + private fun isUpperCase(categoryCode: String): Boolean { + return categoryCode == CharCategory.UPPERCASE_LETTER.code + } + + private fun isWhitespace(char: Char, categoryCode: String): Boolean { + return categoryCode in listOf( + CharCategory.SPACE_SEPARATOR.code, + CharCategory.LINE_SEPARATOR.code, + CharCategory.PARAGRAPH_SEPARATOR.code + ) || char in '\u0009'..'\u000D' || char in '\u001C'..'\u001F' + } +} + """.trimIndent() + ) + + writer?.close() + } + + private fun generateUnicodeDataHeader(arrayIndex: Int) { + val file = outputFile.resolveSibling("_UnicodeData$arrayIndex.kt") + generateFileHeader(file) + + writer?.appendLine("internal val unicodeData$arrayIndex = arrayOf(") + } + + private fun generateFileHeader(file: File) { + writer = FileWriter(file) + writer?.writeHeader(file, "test.text.unicodeData") + writer?.appendLine() + } +} diff --git a/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/RangesGenerator.kt b/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/RangesGenerator.kt new file mode 100644 index 00000000000..b3dcb5a62d0 --- /dev/null +++ b/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/RangesGenerator.kt @@ -0,0 +1,72 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package generators.unicode.ranges + +import generators.requireExistingDir +import generators.unicode.UnicodeDataGenerator +import generators.unicode.ranges.builders.* +import generators.unicode.ranges.writers.* +import templates.KotlinTarget +import templates.Platform +import java.io.File +import java.io.FileWriter + +internal class RangesGenerator private constructor( + private val outputFile: File, + private val rangesBuilder: RangesBuilder, + private val rangesWriter: RangesWriter, +) : UnicodeDataGenerator { + + init { + outputFile.parentFile.requireExistingDir() + } + + override fun appendChar(char: String, name: String, categoryCode: String) { + rangesBuilder.append(char, name, categoryCode) + } + + override fun close() { + val (rangeStart, rangeEnd, rangeCategory) = rangesBuilder.build() + + FileWriter(outputFile).use { writer -> + writer.writeHeader(outputFile, "kotlin.text") + writer.appendLine() + writer.appendLine("// ${rangeStart.size} ranges totally") + + rangesWriter.write(rangeStart, rangeEnd, rangeCategory, writer) + } + } + + companion object { + fun forCharCategory(outputFile: File, target: KotlinTarget): RangesGenerator { + val rangesBuilder = CharCategoryRangesBuilder() + val rangesWriter = RangesWritingStrategy.of(target, "Category").let { + if (target.platform == Platform.JS) VarLenBase64CategoryRangesWriter(it) else CategoryRangesWriter(it) + } + return RangesGenerator(outputFile, rangesBuilder, rangesWriter) + } + + fun forLetter(outputFile: File, target: KotlinTarget): RangesGenerator { + val rangesBuilder = LetterRangesBuilder() + val rangesWriter = RangesWritingStrategy.of(target, "Letter").let { + if (target.platform == Platform.JS) VarLenBase64LetterRangesWriter(it) else LetterRangesWriter(it) + } + return RangesGenerator(outputFile, rangesBuilder, rangesWriter) + } + + fun forDigit(outputFile: File, target: KotlinTarget): RangesGenerator { + val rangesBuilder = DigitRangesBuilder() + val rangesWriter = DigitRangesWriter(RangesWritingStrategy.of(target, "Digit")) + return RangesGenerator(outputFile, rangesBuilder, rangesWriter) + } + + fun forWhitespace(outputFile: File): RangesGenerator { + val rangesBuilder = WhitespaceRangesBuilder() + val rangesWriter = WhitespaceRangesWriter() + return RangesGenerator(outputFile, rangesBuilder, rangesWriter) + } + } +} diff --git a/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/RangesWritingStrategy.kt b/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/RangesWritingStrategy.kt new file mode 100644 index 00000000000..e0020361c2a --- /dev/null +++ b/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/RangesWritingStrategy.kt @@ -0,0 +1,56 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package generators.unicode.ranges + +import templates.KotlinTarget +import templates.Platform +import java.io.FileWriter + +internal sealed class RangesWritingStrategy { + abstract val indentation: String + abstract val rangesAnnotation: String + abstract val rangesVisibilityModifier: String + abstract fun beforeWritingRanges(writer: FileWriter) + abstract fun afterWritingRanges(writer: FileWriter) + abstract fun rangeRef(name: String): String + + companion object { + fun of(target: KotlinTarget, wrapperName: String): RangesWritingStrategy { + return when (target.platform) { + Platform.JS -> JsRangesWritingStrategy(wrapperName) + else -> NativeRangesWritingStrategy + } + } + } +} + +internal object NativeRangesWritingStrategy : RangesWritingStrategy() { + override val indentation: String get() = "" + override val rangesAnnotation: String get() = "@SharedImmutable\n" + override val rangesVisibilityModifier: String get() = "private" + override fun beforeWritingRanges(writer: FileWriter) {} + override fun afterWritingRanges(writer: FileWriter) {} + override fun rangeRef(name: String): String = name +} + +// see KT-42461, KT-40482 +internal class JsRangesWritingStrategy( + private val wrapperName: String +) : RangesWritingStrategy() { + override val indentation: String get() = " ".repeat(4) + override val rangesAnnotation: String get() = "" + override val rangesVisibilityModifier: String get() = "internal" + + override fun beforeWritingRanges(writer: FileWriter) { + writer.appendLine("private object $wrapperName {") + } + + override fun afterWritingRanges(writer: FileWriter) { + writer.appendLine("}") + } + + override fun rangeRef(name: String): String = "$wrapperName.$name" +} \ No newline at end of file diff --git a/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/builders/CharCategoryRangesBuilder.kt b/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/builders/CharCategoryRangesBuilder.kt new file mode 100644 index 00000000000..3cc89b0b2da --- /dev/null +++ b/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/builders/CharCategoryRangesBuilder.kt @@ -0,0 +1,47 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package generators.unicode.ranges.builders + +import generators.unicode.ranges.patterns.PeriodicRangePattern +import generators.unicode.ranges.patterns.RangePattern + +internal class CharCategoryRangesBuilder : RangesBuilder() { + + override fun categoryId(categoryCode: String): String { + return categoryCode + } + + override fun shouldSkip(categoryId: String): Boolean { + return false + } + + override val makeOnePeriodCategory: (Array) -> Int + get() = ::periodPatternCategory + + override fun evolveLastRange(lastRange: RangePattern, charCode: Int, categoryId: String): RangePattern? { + require(lastRange is PeriodicRangePattern) + return when (lastRange.sequenceLength) { + 1 -> PeriodicRangePattern.from(lastRange, charCode, categoryId, sequenceLength = 2, isPeriodic = true, unassignedCategoryId, ::periodPatternCategory) + ?: PeriodicRangePattern.from(lastRange, charCode, categoryId, sequenceLength = 3, isPeriodic = true, unassignedCategoryId, ::periodPatternCategory) + 2 -> PeriodicRangePattern.from(lastRange, charCode, categoryId, sequenceLength = 3, isPeriodic = true, unassignedCategoryId, ::periodPatternCategory) + else -> null + } + } +} + +// 17 and 31 category values are not reserved. Use 17 to replace UNASSIGNED value (0) to be able to encode range pattern categories. +internal const val UNASSIGNED_CATEGORY_VALUE_REPLACEMENT = 17 +private val categoryCodeToValue = CharCategory.values().associateBy({ it.code }, { if (it.value == 0) UNASSIGNED_CATEGORY_VALUE_REPLACEMENT else it.value }) + +private fun periodPatternCategory(categoryIds: Array): Int { + // Each category value is <= 30, thus 5 bits is enough to represent it. + var pattern = 0 + for (index in categoryIds.indices) { + val value = categoryCodeToValue[categoryIds[index]]!! + pattern = pattern or (value shl (5 * index)) + } + return pattern +} \ No newline at end of file diff --git a/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/builders/DigitRangesBuilder.kt b/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/builders/DigitRangesBuilder.kt new file mode 100644 index 00000000000..ae7f7d30e9d --- /dev/null +++ b/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/builders/DigitRangesBuilder.kt @@ -0,0 +1,25 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package generators.unicode.ranges.builders + +import generators.unicode.ranges.patterns.RangePattern + +internal class DigitRangesBuilder : RangesBuilder() { + override fun categoryId(categoryCode: String): String { + return categoryCode + } + + override fun shouldSkip(categoryId: String): Boolean { + return categoryId != CharCategory.DECIMAL_DIGIT_NUMBER.code + } + + override val makeOnePeriodCategory: (Array) -> Int + get() = { 0 } + + override fun evolveLastRange(lastRange: RangePattern, charCode: Int, categoryId: String): RangePattern? { + return null + } +} \ No newline at end of file diff --git a/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/builders/LetterPatternBuilder.kt b/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/builders/LetterPatternBuilder.kt new file mode 100644 index 00000000000..72d8ff1c144 --- /dev/null +++ b/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/builders/LetterPatternBuilder.kt @@ -0,0 +1,89 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package generators.unicode.ranges.builders + +import generators.unicode.ranges.patterns.PeriodicRangePattern +import generators.unicode.ranges.patterns.RangePattern +import generators.unicode.ranges.patterns.GapRangePattern + +internal class LetterRangesBuilder : RangesBuilder() { + + override fun categoryId(categoryCode: String): String = when (categoryCode) { + CharCategory.LOWERCASE_LETTER.code -> categoryCode + CharCategory.UPPERCASE_LETTER.code -> categoryCode + in letterCategoryCodes -> "OL" // other letter + else -> "NL" // not a letter + } + + override fun shouldSkip(categoryId: String): Boolean { + return categoryId == "NL" + } + + override val makeOnePeriodCategory: (Array) -> Int + get() = ::periodPatternCategory + + override fun evolveLastRange(lastRange: RangePattern, charCode: Int, categoryId: String): RangePattern? { + return when (lastRange) { + is PeriodicRangePattern -> when (lastRange.sequenceLength) { + 1 -> + PeriodicRangePattern.from(lastRange, charCode, categoryId, sequenceLength = 2, isPeriodic = true, unassignedCategoryId, ::periodPatternCategory) + ?: GapRangePattern.from(lastRange, charCode, categoryId, unassignedCategoryId, ::gapPatternCategory) + ?: PeriodicRangePattern.from(lastRange, charCode, categoryId, sequenceLength = 15, isPeriodic = false, unassignedCategoryId, ::periodPatternCategory) + 2 -> + GapRangePattern.from(lastRange, charCode, categoryId, unassignedCategoryId, ::gapPatternCategory) + ?: PeriodicRangePattern.from(lastRange, charCode, categoryId, sequenceLength = 15, isPeriodic = false, unassignedCategoryId, ::periodPatternCategory) + else -> null + } + is GapRangePattern -> + PeriodicRangePattern.from(lastRange, charCode, categoryId, sequenceLength = 15, isPeriodic = false, unassignedCategoryId, ::periodPatternCategory) + else -> + error("Unreachable") + } + } +} + +private val letterCategoryCodes = listOf( + CharCategory.UPPERCASE_LETTER.code, + CharCategory.LOWERCASE_LETTER.code, + CharCategory.TITLECASE_LETTER.code, + CharCategory.MODIFIER_LETTER.code, + CharCategory.OTHER_LETTER.code +) + +private fun bitmask(categoryId: String) = when (categoryId) { + CharCategory.LOWERCASE_LETTER.code -> 0b01 + CharCategory.UPPERCASE_LETTER.code -> 0b10 + "OL" -> 0b11 + "NL" -> 0b00 + "" -> 0b00 + else -> error("Unknown categoryID: $categoryId") +} + +private fun periodPatternCategory(categoryIds: Array): Int { + var pattern = 0 + for (index in categoryIds.indices) { + val value = bitmask(categoryIds[index]) + pattern = pattern or (value shl (2 * index)) + } + pattern = pattern or (1 shl (2 * categoryIds.size)) + check(pattern and 0x3 != 0) + return pattern +} + +private fun gapPatternCategory(start: Int, end: Int, gaps: List): Int { + var pattern = 0 + var shift = 2 + for (i in gaps.indices) { + val gap = gaps[i] + val charsBeforeGap = gap.start - if (i == 0) start else gaps[i - 1].let { it.start + it.length } + pattern += charsBeforeGap shl shift + shift += GapRangePattern.CHARS_BITS + pattern += gap.length shl shift + shift += GapRangePattern.GAP_BITS + } + check(pattern and 0x3 == 0) + return pattern +} diff --git a/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/builders/RangesBuilder.kt b/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/builders/RangesBuilder.kt new file mode 100644 index 00000000000..330b70b77a2 --- /dev/null +++ b/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/builders/RangesBuilder.kt @@ -0,0 +1,192 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package generators.unicode.ranges.builders + +import generators.unicode.ranges.patterns.PeriodicRangePattern +import generators.unicode.ranges.patterns.RangePattern +import generators.unicode.ranges.patterns.rangeLength + +/** + * The base class of character ranges builders. + */ +internal abstract class RangesBuilder { + private val ranges = mutableListOf() + private var lastAppendedCharCode = -1 + + /** + * Appends a line from the UnicodeData.txt file. + */ + fun append(char: String, name: String, categoryCode: String) { + val charCode = char.toInt(radix = 16) + val categoryId = categoryId(categoryCode) + + when { + name.endsWith(", First>") -> rangeFirst(charCode, categoryId) + name.endsWith(", Last>") -> rangeLast(charCode, categoryId) + else -> append(charCode, categoryId) + } + + lastAppendedCharCode = charCode + } + + /** + * Optimizes the number of ranges and returns them. + * + * Returns a [Triple] containing lists of range starts, ends and categories in that particular order. + */ + fun build(): Triple, List, List> { + for (code in lastAppendedCharCode + 1..0xffff) { + appendSingleChar(code, unassignedCategoryId) + } + + var index = ranges.lastIndex + while (index > 0) { + val previous = ranges[index - 1] + val previousEnd = previous.rangeEnd() + val previousEndCategory = previous.categoryIdOf(previousEnd) + val current = ranges[index] + if (current.prepend(previousEnd, previousEndCategory)) { + val newPrevious = removeLast(previous) + if (newPrevious != null) { + ranges[index - 1] = newPrevious + } else { + ranges.removeAt(index - 1) + index-- + } + } else { + index-- + } + } + +// if (this is LetterRangesBuilder) { +// println(ranges.joinToString(separator = "\n")) +// } + +// if (this is CharCategoryRangesBuilder) { +// println(ranges.subList(fromIndex = 0, toIndex = 10).joinToString(separator = "\n")) +// } + + return Triple(ranges.map { it.rangeStart() }, ranges.map { it.rangeEnd() }, ranges.map { it.category() }) + } + + /** + * Appends the [charCode] as the start of a range of chars with the specified [categoryId]. + */ + private fun rangeFirst(charCode: Int, categoryId: String) { + append(charCode, categoryId) + } + + /** + * Appends the [charCode] as the end of a range of chars with the specified [categoryId]. + * Chars between last appended char and the [charCode] are considered to have the specified [categoryId]. + */ + private fun rangeLast(charCode: Int, categoryId: String) { + if (!shouldSkip(categoryId)) { + check(ranges.last().rangeEnd() == lastAppendedCharCode) + check(ranges.last().categoryIdOf(lastAppendedCharCode) == categoryId) + } + + for (code in lastAppendedCharCode + 1..charCode) { + appendSingleChar(code, categoryId) + } + } + + /** + * Appends the [charCode] with the specified [categoryId]. + * Chars between last appended char and the [charCode] are considered to be unassigned. + */ + private fun append(charCode: Int, categoryId: String) { + for (code in lastAppendedCharCode + 1 until charCode) { + appendSingleChar(code, unassignedCategoryId) + } + appendSingleChar(charCode, categoryId) + } + + /** + * Appends the [charCode] with the specified [categoryId] to the last range, or a new range containing the [charCode] is created. + * The last range can be transformed to another range type to accommodate the [charCode]. + */ + private fun appendSingleChar(charCode: Int, categoryId: String) { + if (shouldSkip(categoryId)) return + + if (ranges.isEmpty()) { + ranges.add(createRange(charCode, categoryId)) + return + } + + val lastRange = ranges.last() + + if (!lastRange.append(charCode, categoryId)) { + val newLastRange = evolveLastRange(lastRange, charCode, categoryId) + if (newLastRange != null) { + ranges[ranges.lastIndex] = newLastRange + } else { + ranges.add(createRange(charCode, categoryId)) + } + } + } + + /** + * Category id used for unassigned chars. + */ + protected val unassignedCategoryId: String + get() = categoryId(CharCategory.UNASSIGNED.code) + + + /** + * Creates the simplest range containing the single [charCode]. + */ + private fun createRange(charCode: Int, categoryId: String): RangePattern { + return PeriodicRangePattern.from(charCode, categoryId, sequenceLength = 1, isPeriodic = true, unassignedCategoryId, makeOnePeriodCategory) + } + + /** + * Removes the last char in the specified [range]. + * Returns the simplest pattern that accommodated the remaining chars in the [range], + * or `null` if the [range] contained a single char. + */ + private fun removeLast(range: RangePattern): RangePattern? { + if (range.rangeLength() == 1) { + return null + } + + val rangeStart = range.rangeStart() + var result = createRange(rangeStart, range.categoryIdOf(rangeStart)) + for (code in rangeStart + 1 until range.rangeEnd()) { + val categoryId = range.categoryIdOf(code) + if (!shouldSkip(categoryId)) { + result = if (result.append(code, categoryId)) result else evolveLastRange(result, code, categoryId)!! + } + } + return result + } + + /** + * The id to use for the [categoryCode] - the Unicode general category code. + */ + protected abstract fun categoryId(categoryCode: String): String + + /** + * Returns true if this range builder skips chars with the specified [categoryId]. + */ + protected abstract fun shouldSkip(categoryId: String): Boolean + + /** + * The function to use to transform periodic ranges with period equal to 1 to an Int representation. + */ + protected abstract val makeOnePeriodCategory: (Array) -> Int + + /** + * Appends the [charCode] with the specified [categoryId] to the [lastRange] and returns the resulting range, + * or returns `null` if [charCode] can't be appended to the [lastRange]. + * The [lastRange] can be transformed to another range type to accommodate the [charCode]. + */ + protected abstract fun evolveLastRange( + lastRange: RangePattern, + charCode: Int, + categoryId: String + ): RangePattern? +} \ No newline at end of file diff --git a/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/builders/WhitespaceRangesBuilder.kt b/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/builders/WhitespaceRangesBuilder.kt new file mode 100644 index 00000000000..f296186489a --- /dev/null +++ b/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/builders/WhitespaceRangesBuilder.kt @@ -0,0 +1,43 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package generators.unicode.ranges.builders + +import generators.unicode.ranges.patterns.RangePattern + +internal class WhitespaceRangesBuilder : RangesBuilder() { + + init { + // Cc CONTROL spaces + append("0009", "", WS) + append("000D", "", WS) + append("001C", "", WS) + append("001F", "", WS) + } + + override fun categoryId(categoryCode: String): String { + return if (categoryCode == WS || categoryCode in whitespaceCategories) WS else NOT_WS + } + + override fun shouldSkip(categoryId: String): Boolean { + return categoryId == NOT_WS + } + + override val makeOnePeriodCategory: (Array) -> Int + get() = { 0 } + + override fun evolveLastRange(lastRange: RangePattern, charCode: Int, categoryId: String): RangePattern? { + return null + } +} + +private const val WS = "WS" +private const val NOT_WS = "NOT_WS" + +private val whitespaceCategories = listOf( + CharCategory.SPACE_SEPARATOR.code, + CharCategory.LINE_SEPARATOR.code, + CharCategory.PARAGRAPH_SEPARATOR.code +) \ No newline at end of file diff --git a/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/patterns/GapRangePattern.kt b/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/patterns/GapRangePattern.kt new file mode 100644 index 00000000000..5bb592ef2fc --- /dev/null +++ b/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/patterns/GapRangePattern.kt @@ -0,0 +1,138 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package generators.unicode.ranges.patterns + +import generators.unicode.ranges.writers.hex + +/** + * A range of consequent chars that starts with a letter and ends with a letter, and contains multiple ranges of consequent not-letter chars. + * + * All letter chars in this range have the same category id. + * + * @param charCode the start of this range + * @param categoryId the category id of the char with the specified [charCode] + * @param unassignedCategoryId the categoryId of the unassigned chars. + * Chars that are not appended or prepended are considered to be unassigned + * @param makeCategory the function used to transform this range to an Int representation that is returned from the [category] function. + */ +internal class GapRangePattern private constructor( + charCode: Int, + private val categoryId: String, + private val unassignedCategoryId: String, + private val makeCategory: (start: Int, end: Int, gaps: List) -> Int +) : RangePattern { + private val start: Int = charCode + private var end: Int = charCode + private val gaps = mutableListOf() + + init { + require(categoryId == "OL") + } + + override fun append(charCode: Int, categoryId: String): Boolean { + require(charCode > end) + + if (categoryId == unassignedCategoryId) { + return true + } + + if (categoryId != this.categoryId) { + return false + } + + // lll_gap_lll_X_l + if (end == charCode - 1) { + // _X_ is empty -> append the letter + end = charCode + return true + } + + val newGap = Gap(start = end + 1, length = charCode - end - 1) + val charsBeforeNewGap = newGap.start - if (gaps.isEmpty()) start else gaps.last().let { it.start + it.length } + val bits = (gaps.size + 1) * (CHARS_BITS + GAP_BITS) + + if (isValid(charsBeforeNewGap, newGap.length) && bits <= TOTAL_BITS) { + gaps.add(newGap) + end = charCode + return true + } + + return false + } + + override fun prepend(charCode: Int, categoryId: String): Boolean { + assert(charCode < start) + return false + } + + override fun rangeStart(): Int { + return start + } + + override fun rangeEnd(): Int { + return end + } + + override fun category(): Int { + return makeCategory(start, end, gaps) + } + + override fun categoryIdOf(charCode: Int): String { + require(charCode in start..end) + for (gap in gaps) { + if (charCode < gap.start) { + return categoryId + } + if (charCode < gap.start + gap.length) { + return unassignedCategoryId + } + } + return categoryId + } + + override fun toString(): String { + return "GapPattern{" + + "start=" + start.hex() + + ", end=" + end.hex() + + ", length=" + rangeLength() + + ", gaps=" + gaps + + ", categoryId=" + categoryId + + "}" + } + + companion object { + internal const val CHARS_BITS = 7 + internal const val GAP_BITS = 7 + private const val TOTAL_BITS = 29 + + internal data class Gap(val start: Int, val length: Int) + + fun from( + range: RangePattern, + charCode: Int, + categoryId: String, + unassignedCategoryId: String, + makeCategory: (start: Int, end: Int, gaps: List) -> Int + ): RangePattern? { + val start = range.rangeStart() + val startCategoryId = range.categoryIdOf(start) + + check(startCategoryId != unassignedCategoryId) + + if (startCategoryId != categoryId || categoryId != "OL") return null + + val gapRange = GapRangePattern(start, startCategoryId, unassignedCategoryId, makeCategory) + if (gapRange.append(start + 1, range.rangeEnd(), range::categoryIdOf, charCode, categoryId)) { + return gapRange + } + return null + } + + private fun isValid(charsBeforeGap: Int, gapLength: Int): Boolean { + return charsBeforeGap < (1 shl CHARS_BITS) && gapLength < (1 shl GAP_BITS) + } + } +} diff --git a/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/patterns/PeriodicRangePattern.kt b/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/patterns/PeriodicRangePattern.kt new file mode 100644 index 00000000000..0e9eca94e22 --- /dev/null +++ b/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/patterns/PeriodicRangePattern.kt @@ -0,0 +1,195 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package generators.unicode.ranges.patterns + +import generators.unicode.ranges.writers.hex + +/** + * A range of consequent chars. + * + * The chars in the range may have periodic categories, e.g., [Lu, Ll, Lu, Ll, ...]. + * + * @param charCode the start of this range + * @param categoryId the category id of the char with the specified [charCode] + * @param sequenceLength the maximum length this range can have. + * If [isPeriodic] is true than this range can be longer with: + * for every `charCode >= start + sequenceLength` categoryIdOf(charCode) is equal to categoryIdOf(charCode - sequenceLength) + * @param isPeriodic true if this range is a periodic range with period [sequenceLength] + * @param unassignedCategoryId the categoryId of the unassigned chars. + * Chars that are not appended or prepended are considered to be unassigned + * @param makeCategory the function used to transform this range to an Int representation that is returned from the [category] function. + * [makeCategory] is called with an array having its size equal to `minOf(sequenceLength, rangeLength())`. + */ +internal class PeriodicRangePattern private constructor( + charCode: Int, + categoryId: String, + val sequenceLength: Int, + isPeriodic: Boolean, + unassignedCategoryId: String, + private val makeCategory: (Array) -> Int +) : RangePattern { + private var start: Int = charCode + private var end: Int = charCode + private val bag: Bag = Bag(sequenceLength, isPeriodic, unassignedCategoryId) + + init { + bag.fill(charCode, categoryId) + } + + override fun append(charCode: Int, categoryId: String): Boolean { + require(charCode > end) + if (!bag.fill(end + 1, charCode - 1, { bag.unassignedCategoryId }, charCode, categoryId)) { + return false + } + end = charCode + return true + } + + override fun prepend(charCode: Int, categoryId: String): Boolean { + require(charCode < start) + if (!bag.fill(charCode + 1, start - 1, { bag.unassignedCategoryId }, charCode, categoryId)) { + return false + } + start = charCode + return true + } + + override fun rangeStart(): Int { + return start + } + + override fun rangeEnd(): Int { + return end + } + + override fun category(): Int { + return makeCategory(orderedCategoryIds()) + } + + private fun orderedCategoryIds(): Array { + val size = minOf(sequenceLength, rangeLength()) + return Array(size) { categoryIdOf(start + it) } + } + + override fun categoryIdOf(charCode: Int): String { + if (charCode !in start..end) { + throw IllegalArgumentException("Char code ${charCode.hex()} is not in $this") + } + val categoryId = bag.categoryIdOf(charCode) + check(categoryId != null) + return categoryId + } + + override fun toString(): String { + return "PeriodicRangePattern{" + + "start=" + start.hex() + + ", end=" + end.hex() + + ", length=" + rangeLength() + + ", orderedCategoryIds=" + orderedCategoryIds().contentToString() + + ", bag=" + bag + + "}" + } + + companion object { + fun from( + range: RangePattern, + charCode: Int, + categoryId: String, + sequenceLength: Int, + isPeriodic: Boolean, + unassignedCategoryId: String, + makeCategory: (Array) -> Int + ): PeriodicRangePattern? { + require(charCode > range.rangeEnd()) + + val start = range.rangeStart() + val newRange = from(start, range.categoryIdOf(start), sequenceLength, isPeriodic, unassignedCategoryId, makeCategory) + if (newRange.append(start + 1, range.rangeEnd(), range::categoryIdOf, charCode, categoryId)) { + return newRange + } + return null + } + + fun from( + charCode: Int, + categoryId: String, + sequenceLength: Int, + isPeriodic: Boolean, + unassignedCategoryId: String, + makeCategory: (Array) -> Int + ): PeriodicRangePattern { + return PeriodicRangePattern(charCode, categoryId, sequenceLength, isPeriodic, unassignedCategoryId, makeCategory) + } + } +} + +/** + * A set of chars with their corresponding categories. + * + * Category Id of a char with code equal to `charCode` is placed at index `charCode % sequenceLength` of the [categoryIds]. + */ +private class Bag( + private val sequenceLength: Int, + private val isPeriodic: Boolean, + val unassignedCategoryId: String +) { + private val categoryIds = arrayOfNulls(sequenceLength) + + fun categoryIdOf(charCode: Int): String? { + return categoryIds[charCode % sequenceLength] + } + + /** + * Returns true if a range with the specified [rangeStart], [rangeEnd] and [categoryIdOf] was successfully added + * together with a char with the specified [charCode] and [categoryId]. + * + * The [charCode] must go immediately after the [rangeEnd] or before the [rangeStart]. + */ + fun fill(rangeStart: Int, rangeEnd: Int, categoryIdOf: (Int) -> String, charCode: Int, categoryId: String): Boolean { + require(charCode == rangeStart - 1 || charCode == rangeEnd + 1) + + val attempt = categoryIds.copyOf() + + for (ch in rangeStart..rangeEnd) { + if (!attempt.fill(ch, categoryIdOf(ch))) return false + } + if (!attempt.fill(charCode, categoryId)) return false + + attempt.copyInto(categoryIds) + return true + } + + /** + * Returns true if the [charCode] with the [categoryId] was successfully placed in [categoryIds]. + */ + fun fill(charCode: Int, categoryId: String): Boolean { + return categoryIds.fill(charCode, categoryId) + } + + /** + * Returns true if the [charCode] with the [categoryId] was successfully placed in this array. + * + * The [charCode] is placed at index `charCode % sequenceLength`. + */ + private fun Array.fill(charCode: Int, categoryId: String): Boolean { + val index = charCode % sequenceLength + val current = this[index] + if (current == null || (isPeriodic && current == categoryId)) { + this[index] = categoryId + return true + } + return false + } + + override fun toString(): String { + return "Bag{" + + "sequenceLength=" + sequenceLength + + ", isPeriodic=" + isPeriodic + + ", unassignedCategoryId=" + unassignedCategoryId + + ", categoryIds=" + categoryIds.contentToString() + + "}" + } +} diff --git a/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/patterns/RangePattern.kt b/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/patterns/RangePattern.kt new file mode 100644 index 00000000000..c006094d054 --- /dev/null +++ b/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/patterns/RangePattern.kt @@ -0,0 +1,61 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package generators.unicode.ranges.patterns + +/** + * A range of consequent chars that fit within a particular pattern. + */ +internal interface RangePattern { + /** + * Appends the [charCode] to this range pattern. + * Returns true if the [charCode] with the specified [categoryId] could be accommodated within this pattern. + * Returns false otherwise. + */ + fun append(charCode: Int, categoryId: String): Boolean + + /** + * Prepends the [charCode] to this range pattern. + * Returns true if the [charCode] with the specified [categoryId] could be accommodated within this pattern. + * Returns false otherwise. + */ + fun prepend(charCode: Int, categoryId: String): Boolean + + /** + * Char code of the first char in this range. + */ + fun rangeStart(): Int + + /** + * Char code of the last char in this range. + */ + fun rangeEnd(): Int + + /** + * An integer value that contains information about the category of each char in this range. + */ + fun category(): Int + + /** + * Returns category id of the char with the specified [charCode]. + * Throws an exception if the [charCode] is not in `rangeStart()..rangeEnd()`. + */ + fun categoryIdOf(charCode: Int): String +} + +internal fun RangePattern.rangeLength(): Int = rangeEnd() - rangeStart() + 1 + + +internal fun RangePattern.append(rangeStart: Int, rangeEnd: Int, categoryIdOf: (Int) -> String, charCode: Int, categoryId: String): Boolean { + for (code in rangeStart..rangeEnd) { + if (!append(code, categoryIdOf(code))) { + return false + } + } + if (!append(charCode, categoryId)) { + return false + } + return true +} diff --git a/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/writers/CategoryRangesWriter.kt b/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/writers/CategoryRangesWriter.kt new file mode 100644 index 00000000000..fcae45137cf --- /dev/null +++ b/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/writers/CategoryRangesWriter.kt @@ -0,0 +1,172 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package generators.unicode.ranges.writers + +import generators.unicode.ranges.RangesWritingStrategy +import generators.unicode.ranges.builders.UNASSIGNED_CATEGORY_VALUE_REPLACEMENT +import java.io.FileWriter + +internal open class CategoryRangesWriter(protected val strategy: RangesWritingStrategy) : RangesWriter { + + override fun write(rangeStart: List, rangeEnd: List, rangeCategory: List, writer: FileWriter) { + beforeWritingRanges(writer) + + writeRangeStart(rangeStart, writer) + writeRangeCategory(rangeCategory, writer) + writeInit(rangeStart, rangeEnd, rangeCategory, writer) + + afterWritingRanges(writer) + } + + protected open fun beforeWritingRanges(writer: FileWriter) { + strategy.beforeWritingRanges(writer) + } + + protected open fun afterWritingRanges(writer: FileWriter) { + strategy.afterWritingRanges(writer) + + writer.appendLine() + writer.appendLine(categoryValueFrom()) + writer.appendLine() + writer.appendLine(getCategoryValue()) + } + + protected open fun writeRangeStart(elements: List, writer: FileWriter) { + writer.writeIntArray("rangeStart", elements, strategy) + writer.appendLine() + } + + protected open fun writeRangeCategory(elements: List, writer: FileWriter) { + writer.writeIntArray("rangeCategory", elements, strategy) + writer.appendLine() + } + + protected open fun writeInit(rangeStart: List, rangeEnd: List, rangeCategory: List, writer: FileWriter) {} + + private fun categoryValueFrom(): String = """ + private fun categoryValueFrom(code: Int, ch: Int): Int { + return when { + code < 0x20 -> code + code < 0x400 -> if ((ch and 1) == 1) code shr 5 else code and 0x1f + else -> + when (ch % 3) { + 2 -> code shr 10 + 1 -> (code shr 5) and 0x1f + else -> code and 0x1f + } + } + } + """.trimIndent() + + private fun getCategoryValue(): String = """ + /** + * Returns the Unicode general category of this character as an Int. + */ + internal fun Char.getCategoryValue(): Int { + val ch = this.toInt() + + val index = ${indexOf("ch")} + val start = ${startAt("index")} + val code = ${categoryAt("index")} + val value = categoryValueFrom(code, ch - start) + + return if (value == $UNASSIGNED_CATEGORY_VALUE_REPLACEMENT) CharCategory.UNASSIGNED.value else value + } + """.trimIndent() + + protected open fun indexOf(charCode: String): String { + return "binarySearchRange(${strategy.rangeRef("rangeStart")}, $charCode)" + } + + protected open fun startAt(index: String): String { + return "${strategy.rangeRef("rangeStart")}[$index]" + } + + protected open fun categoryAt(index: String): String { + return "${strategy.rangeRef("rangeCategory")}[$index]" + } +} + +internal class VarLenBase64CategoryRangesWriter(strategy: RangesWritingStrategy) : CategoryRangesWriter(strategy) { + + override fun afterWritingRanges(writer: FileWriter) { + super.afterWritingRanges(writer) + writer.appendLine() + writer.appendLine(decodeVarLenBase64()) + } + + override fun writeInit(rangeStart: List, rangeEnd: List, rangeCategory: List, writer: FileWriter) { + val rangeLength = rangeStart.zipWithNext { a, b -> b - a } + val base64RangeLength = rangeLength.toVarLenBase64() + + val base64RangeCategory = rangeCategory.toVarLenBase64() + + writer.appendLine( + """ + val decodedRangeStart: IntArray + val decodedRangeCategory: IntArray + + init { + val toBase64 = "$TO_BASE64" + val fromBase64 = IntArray(128) + for (i in toBase64.indices) { + fromBase64[toBase64[i].toInt()] = i + } + + // rangeStartDiff.length = ${base64RangeLength.length} + val rangeStartDiff = "$base64RangeLength" + val diff = decodeVarLenBase64(rangeStartDiff, fromBase64, ${rangeLength.size}) + val start = IntArray(diff.size + 1) + for (i in diff.indices) { + start[i + 1] = start[i] + diff[i] + } + decodedRangeStart = start + + // rangeCategory.length = ${base64RangeCategory.length} + val rangeCategory = "$base64RangeCategory" + decodedRangeCategory = decodeVarLenBase64(rangeCategory, fromBase64, ${rangeCategory.size}) + } + """.replaceIndent(strategy.indentation) + ) + } + + override fun writeRangeStart(elements: List, writer: FileWriter) {} + + override fun writeRangeCategory(elements: List, writer: FileWriter) {} + + private fun decodeVarLenBase64() = """ + internal fun decodeVarLenBase64(base64: String, fromBase64: IntArray, resultLength: Int): IntArray { + val result = IntArray(resultLength) + var index = 0 + var int = 0 + var shift = 0 + for (char in base64) { + val sixBit = fromBase64[char.toInt()] + int = int or ((sixBit and 0x1f) shl shift) + if (sixBit < 0x20) { + result[index++] = int + int = 0 + shift = 0 + } else { + shift += 5 + } + } + return result + } + """.trimIndent() + + override fun indexOf(charCode: String): String { + return "binarySearchRange(${strategy.rangeRef("decodedRangeStart")}, $charCode)" + } + + override fun startAt(index: String): String { + return "${strategy.rangeRef("decodedRangeStart")}[$index]" + } + + override fun categoryAt(index: String): String { + return "${strategy.rangeRef("decodedRangeCategory")}[$index]" + } +} diff --git a/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/writers/DigitRangesWriter.kt b/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/writers/DigitRangesWriter.kt new file mode 100644 index 00000000000..38b5125eae5 --- /dev/null +++ b/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/writers/DigitRangesWriter.kt @@ -0,0 +1,60 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package generators.unicode.ranges.writers + +import generators.unicode.ranges.RangesWritingStrategy +import java.io.FileWriter + +internal class DigitRangesWriter(private val strategy: RangesWritingStrategy) : RangesWriter { + override fun write(rangeStart: List, rangeEnd: List, rangeCategory: List, writer: FileWriter) { + // digit ranges always have length equal to 10, so that the difference between the last char code in range and the first one is always 9. + // Therefore, no need to generate ranges end + check(rangeStart.indices.all { rangeEnd[it] - rangeStart[it] == 9 }) + + strategy.beforeWritingRanges(writer) + writer.writeIntArray("rangeStart", rangeStart, strategy) + strategy.afterWritingRanges(writer) + writer.appendLine() + writer.appendLine(binarySearchRange()) + writer.appendLine() + writer.appendLine(isDigitImpl()) + } + + private fun binarySearchRange(): String = """ + internal fun binarySearchRange(array: IntArray, needle: Int): Int { + var bottom = 0 + var top = array.size - 1 + var middle = -1 + var value = 0 + while (bottom <= top) { + middle = (bottom + top) / 2 + value = array[middle] + if (needle > value) + bottom = middle + 1 + else if (needle == value) + return middle + else + top = middle - 1 + } + return middle - (if (needle < value) 1 else 0) + } + """.trimIndent() + + private fun isDigitImpl(): String { + val rangeStart = strategy.rangeRef("rangeStart") + return """ + /** + * Returns `true` if this character is a digit. + */ + internal fun Char.isDigitImpl(): Boolean { + val ch = this.toInt() + val index = binarySearchRange($rangeStart, ch) + val high = $rangeStart[index] + 9 + return ch <= high + } + """.trimIndent() + } +} \ No newline at end of file diff --git a/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/writers/FileWriterUtils.kt b/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/writers/FileWriterUtils.kt new file mode 100644 index 00000000000..c8d321c6b0f --- /dev/null +++ b/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/writers/FileWriterUtils.kt @@ -0,0 +1,76 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package generators.unicode.ranges.writers + +import generators.unicode.ranges.RangesWritingStrategy +import templates.COPYRIGHT_NOTICE +import templates.autoGeneratedWarning +import java.io.File +import java.io.FileWriter + +internal fun FileWriter.writeHeader(file: File, pkg: String) { + println("Generating file: $file") + appendLine(COPYRIGHT_NOTICE) + appendLine("package $pkg") + appendLine() + appendLine(autoGeneratedWarning("GenerateUnicodeData.kt")) +} + +internal fun FileWriter.writeIntArray( + name: String, + elements: List, + strategy: RangesWritingStrategy +) { + fun appendWithIndentation(string: String) { + append(strategy.indentation + string) + } + + append(strategy.rangesAnnotation) + appendWithIndentation("${strategy.rangesVisibilityModifier} val $name = intArrayOf(") + for (i in elements.indices) { + if (i % 20 == 0) { + appendLine() + appendWithIndentation(" ") + } + append(elements[i].hex() + ", ") + } + appendLine() + appendWithIndentation(")") + appendLine() +} + +internal const val TO_BASE64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" + +internal fun List.toVarLenBase64(): String { + val base64 = flatMap { it.to6Bits() } + return base64.joinToString(separator = "") { TO_BASE64[it].toString() } +} + +private fun Int.to6Bits(): List { + require(this >= 0) + + val result = mutableListOf() + + var value = this + do { + var fiveBits = value and 0x1f + value = value shr 5 + if (value != 0) { + fiveBits = fiveBits or 0x20 + } + result.add(fiveBits) + } while (value != 0) + + return result +} + +internal fun Int.hex(): String { + val result = toString(radix = 16) + if (result.first() == '-') { + return "-0x" + result.substring(startIndex = 1).padStart(4, '0') + } + return "0x" + result.padStart(4, '0') +} \ No newline at end of file diff --git a/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/writers/LetterRangesWriter.kt b/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/writers/LetterRangesWriter.kt new file mode 100644 index 00000000000..9f38bbd4b01 --- /dev/null +++ b/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/writers/LetterRangesWriter.kt @@ -0,0 +1,210 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package generators.unicode.ranges.writers + +import generators.unicode.ranges.RangesWritingStrategy +import generators.unicode.ranges.patterns.GapRangePattern +import java.io.FileWriter + +internal open class LetterRangesWriter(protected val strategy: RangesWritingStrategy) : RangesWriter { + override fun write(rangeStart: List, rangeEnd: List, rangeCategory: List, writer: FileWriter) { + beforeWritingRanges(writer) + + writeRangeStart(rangeStart, writer) + writeRangeLength(rangeEnd.mapIndexed { i, e -> e - rangeStart[i] + 1 }, writer) + writeRangeCategory(rangeCategory, writer) + writeInit(rangeStart, rangeEnd, rangeCategory, writer) + + afterWritingRanges(writer) + } + + protected open fun beforeWritingRanges(writer: FileWriter) { + strategy.beforeWritingRanges(writer) + } + + protected open fun afterWritingRanges(writer: FileWriter) { + strategy.afterWritingRanges(writer) + writer.appendLine() + writer.appendLine(getLetterType()) + } + + protected open fun writeRangeStart(elements: List, writer: FileWriter) { + writer.writeIntArray("rangeStart", elements, strategy) + writer.appendLine() + } + + protected open fun writeRangeLength(elements: List, writer: FileWriter) { + writer.writeIntArray("rangeLength", elements, strategy) + writer.appendLine() + } + + protected open fun writeRangeCategory(elements: List, writer: FileWriter) { + writer.writeIntArray("rangeCategory", elements, strategy) + writer.appendLine() + } + + protected open fun writeInit(rangeStart: List, rangeEnd: List, rangeCategory: List, writer: FileWriter) {} + + private fun getLetterType(): String = """ + /** + * Returns `true` if this character is a letter. + */ + internal fun Char.isLetterImpl(): Boolean { + return getLetterType() != 0 + } + + /** + * Returns `true` if this character is a lower case letter. + */ + internal fun Char.isLowerCaseImpl(): Boolean { + return getLetterType() == 1 + } + + /** + * Returns `true` if this character is an upper case letter. + */ + internal fun Char.isUpperCaseImpl(): Boolean { + return getLetterType() == 2 + } + + /** + * Returns + * - `1` if the character is a lower case letter, + * - `2` if the character is an upper case letter, + * - `3` if the character is a letter but not a lower or upper case letter, + * - `0` otherwise. + */ + private fun Char.getLetterType(): Int { + val ch = this.toInt() + val index = ${indexOf("ch")} + + val rangeStart = ${startAt("index")} + val rangeEnd = rangeStart + ${lengthAt("index")} - 1 + val code = ${categoryAt("index")} + + if (ch > rangeEnd) { + return 0 + } + + val lastTwoBits = code and 0x3 + + if (lastTwoBits == 0) { // gap pattern + var shift = 2 + var threshold = rangeStart + for (i in 0..1) { + threshold += (code shr shift) and 0x${((1 shl GapRangePattern.CHARS_BITS) - 1).toString(16)} + if (threshold > ch) { + return 3 + } + shift += ${GapRangePattern.CHARS_BITS} + threshold += (code shr shift) and 0x${((1 shl GapRangePattern.GAP_BITS) - 1).toString(16)} + if (threshold > ch) { + return 0 + } + shift += ${GapRangePattern.GAP_BITS} + } + return 3 + } + + if (code <= 0x7) { + return lastTwoBits + } + + val distance = (ch - rangeStart) + val shift = if (code <= 0x1F) distance % 2 else distance + return (code shr (2 * shift)) and 0x3 + } + """.trimIndent() + + protected open fun indexOf(charCode: String): String { + return "binarySearchRange(${strategy.rangeRef("rangeStart")}, $charCode)" + } + + protected open fun startAt(index: String): String { + return "${strategy.rangeRef("rangeStart")}[$index]" + } + + protected open fun lengthAt(index: String): String { + return "${strategy.rangeRef("rangeLength")}[$index]" + } + + protected open fun categoryAt(index: String): String { + return "${strategy.rangeRef("rangeCategory")}[$index]" + } +} + +internal class VarLenBase64LetterRangesWriter(strategy: RangesWritingStrategy) : LetterRangesWriter(strategy) { + + override fun afterWritingRanges(writer: FileWriter) { + super.afterWritingRanges(writer) + writer.appendLine() + } + + override fun writeInit(rangeStart: List, rangeEnd: List, rangeCategory: List, writer: FileWriter) { + val rangeStartDiff = rangeStart.mapIndexed { i, e -> if (i == 0) e else e - rangeStart[i - 1] } + val rangeLength = rangeEnd.mapIndexed { i, e -> e - rangeStart[i] + 1 } + + val base64RangeStartDiff = rangeStartDiff.toVarLenBase64() + val base64RangeLength = rangeLength.toVarLenBase64() + val base64RangeCategory = rangeCategory.toVarLenBase64() + + writer.appendLine( + """ + val decodedRangeStart: IntArray + val decodedRangeLength: IntArray + val decodedRangeCategory: IntArray + + init { + val toBase64 = "$TO_BASE64" + val fromBase64 = IntArray(128) + for (i in toBase64.indices) { + fromBase64[toBase64[i].toInt()] = i + } + + // rangeStartDiff.length = ${base64RangeStartDiff.length} + val rangeStartDiff = "$base64RangeStartDiff" + val diff = decodeVarLenBase64(rangeStartDiff, fromBase64, ${rangeStartDiff.size}) + val start = IntArray(diff.size) + for (i in diff.indices) { + if (i == 0) start[i] = diff[i] + else start[i] = start[i - 1] + diff[i] + } + decodedRangeStart = start + + // rangeLength.length = ${base64RangeLength.length} + val rangeLength = "$base64RangeLength" + decodedRangeLength = decodeVarLenBase64(rangeLength, fromBase64, ${rangeLength.size}) + + // rangeCategory.length = ${base64RangeCategory.length} + val rangeCategory = "$base64RangeCategory" + decodedRangeCategory = decodeVarLenBase64(rangeCategory, fromBase64, ${rangeCategory.size}) + } + """.replaceIndent(strategy.indentation) + ) + } + + override fun writeRangeStart(elements: List, writer: FileWriter) {} + + override fun writeRangeLength(elements: List, writer: FileWriter) {} + + override fun writeRangeCategory(elements: List, writer: FileWriter) {} + + override fun indexOf(charCode: String): String { + return "binarySearchRange(${strategy.rangeRef("decodedRangeStart")}, $charCode)" + } + + override fun startAt(index: String): String { + return "${strategy.rangeRef("decodedRangeStart")}[$index]" + } + + override fun lengthAt(index: String): String { + return "${strategy.rangeRef("decodedRangeLength")}[$index]" + } + + override fun categoryAt(index: String): String { + return "${strategy.rangeRef("decodedRangeCategory")}[$index]" + } +} diff --git a/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/writers/RangesWriter.kt b/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/writers/RangesWriter.kt new file mode 100644 index 00000000000..9a8b0c98af5 --- /dev/null +++ b/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/writers/RangesWriter.kt @@ -0,0 +1,12 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package generators.unicode.ranges.writers + +import java.io.FileWriter + +interface RangesWriter { + fun write(rangeStart: List, rangeEnd: List, rangeCategory: List, writer: FileWriter) +} \ No newline at end of file diff --git a/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/writers/WhitespaceRangesWriter.kt b/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/writers/WhitespaceRangesWriter.kt new file mode 100644 index 00000000000..ff20d17e511 --- /dev/null +++ b/libraries/tools/kotlin-stdlib-gen/src/generators/unicode/ranges/writers/WhitespaceRangesWriter.kt @@ -0,0 +1,62 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package generators.unicode.ranges.writers + +import java.io.FileWriter + +internal class WhitespaceRangesWriter : RangesWriter { + override fun write(rangeStart: List, rangeEnd: List, rangeCategory: List, writer: FileWriter) { + writer.appendLine(isWhitespaceImpl(rangeStart, rangeEnd)) + } + + private fun isWhitespaceImpl(rangeStart: List, rangeEnd: List): String { + val checks = rangeChecks(rangeStart, rangeEnd, "ch") + return """ + /** + * Returns `true` if this character is a whitespace. + */ + internal fun Char.isWhitespaceImpl(): Boolean { + val ch = this.toInt() + return $checks + } + """.trimIndent() + } + + private fun rangeChecks(rangeStart: List, rangeEnd: List, ch: String): String { + val tab = " " + var tabCount = 5 + val builder = StringBuilder() + + for (i in rangeStart.indices) { + if (i != 0) { + builder.append(tab.repeat(tabCount)).append("|| ") + } + + val start = rangeStart[i] + val end = rangeEnd[i] + when (start) { + end -> { + if (start > 0x1000 && tabCount == 5) { + builder.appendLine("$ch > 0x1000 && (") + tabCount = 6 + builder.append(tab.repeat(tabCount)) + } + builder.appendLine("$ch == ${start.hex()}") + } + end - 1 -> { + builder.appendLine("$ch == ${start.hex()}") + builder.append(tab.repeat(tabCount)).append("|| ") + builder.appendLine("$ch == ${end.hex()}") + } + else -> { + builder.appendLine("$ch in ${start.hex()}..${end.hex()}") + } + } + } + + return builder.append(tab.repeat(5)).append(")").toString() + } +} \ No newline at end of file diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/dsl/Writers.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/dsl/Writers.kt index 2437a326e49..b7dff48f0df 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/dsl/Writers.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/dsl/Writers.kt @@ -11,8 +11,8 @@ import java.io.FileWriter import java.io.Reader import javax.xml.xpath.XPathFactory -val COMMON_AUTOGENERATED_WARNING: String = """// -// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt +fun autoGeneratedWarning(generator: String): String = """// +// NOTE: THIS FILE IS AUTO-GENERATED by the $generator // See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib //""" @@ -92,7 +92,7 @@ fun List.writeTo(file: File, targetedSource: TargetedSourceFile) } writer.append("package ${sourceFile.packageName ?: "kotlin"}\n\n") - writer.append("${COMMON_AUTOGENERATED_WARNING}\n\n") + writer.append("${autoGeneratedWarning("GenerateStandardLib.kt")}\n\n") if (target.platform == Platform.JS) { writer.appendln("import kotlin.js.*") if (sourceFile == SourceFile.Arrays) { From 836261ba6ee20f04eb09965424f8ad3d7811a7d2 Mon Sep 17 00:00:00 2001 From: Kristoffer Andersen Date: Mon, 11 Jan 2021 18:28:44 +0100 Subject: [PATCH 098/212] [Test] Ignore test infrastucture sources in debugging tests This solves no immediate deficiency, but is a to-do that arose as part of an ongoing effort to port the old, slightly too restrictive checkLocalVariableTable tests to the more "functional" debugger infrastructure. This just shaves a little bit of overhead off the test expectations and couples them less tightly to the specifics of the test infrastructure. --- .../suspend/completion/nonStaticStateMachine.kt | 1 - .../suspend/completion/staticStateMachine.kt | 1 - .../suspend/completion/staticStateMachineReceiver.kt | 1 - .../suspend/inlineLocalsStateMachineTransform.kt | 1 - .../localVariables/suspend/localsStateMachineTransform.kt | 1 - .../debug/localVariables/suspend/underscoreNames.kt | 1 - .../stepping/suspendFunWithSuspendLambdaParameter.kt | 1 - .../kotlin/codegen/debugInformation/AbstractDebugTest.kt | 4 ++++ .../codegen/debugInformation/AbstractLocalVariableTest.kt | 2 ++ .../codegen/debugInformation/AbstractSteppingTest.kt | 8 +++++--- 10 files changed, 11 insertions(+), 10 deletions(-) diff --git a/compiler/testData/debug/localVariables/suspend/completion/nonStaticStateMachine.kt b/compiler/testData/debug/localVariables/suspend/completion/nonStaticStateMachine.kt index 73ea5bdbd3c..8046fac136a 100644 --- a/compiler/testData/debug/localVariables/suspend/completion/nonStaticStateMachine.kt +++ b/compiler/testData/debug/localVariables/suspend/completion/nonStaticStateMachine.kt @@ -21,7 +21,6 @@ suspend fun box() { // test.kt:4 : // test.kt:14 box: $completion:kotlin.coroutines.Continuation=helpers.ResultContinuation // test.kt:6 foo1: -// CoroutineUtil.kt:28 getContext: // LOCAL VARIABLES JVM // test.kt:-1 : diff --git a/compiler/testData/debug/localVariables/suspend/completion/staticStateMachine.kt b/compiler/testData/debug/localVariables/suspend/completion/staticStateMachine.kt index 3f126c8a530..40d7c3024f7 100644 --- a/compiler/testData/debug/localVariables/suspend/completion/staticStateMachine.kt +++ b/compiler/testData/debug/localVariables/suspend/completion/staticStateMachine.kt @@ -17,7 +17,6 @@ suspend fun box() { // LOCAL VARIABLES // test.kt:12 box: $completion:kotlin.coroutines.Continuation=helpers.ResultContinuation // test.kt:5 foo1: -// CoroutineUtil.kt:28 getContext: // LOCAL VARIABLES JVM // test.kt:-1 : diff --git a/compiler/testData/debug/localVariables/suspend/completion/staticStateMachineReceiver.kt b/compiler/testData/debug/localVariables/suspend/completion/staticStateMachineReceiver.kt index 78dcbc8ed67..45a5a3bcfa2 100644 --- a/compiler/testData/debug/localVariables/suspend/completion/staticStateMachineReceiver.kt +++ b/compiler/testData/debug/localVariables/suspend/completion/staticStateMachineReceiver.kt @@ -21,7 +21,6 @@ suspend fun box() { // test.kt:4 : // test.kt:14 box: $completion:kotlin.coroutines.Continuation=helpers.ResultContinuation // test.kt:7 foo1: -// CoroutineUtil.kt:28 getContext: // LOCAL VARIABLES JVM // test.kt:-1 : diff --git a/compiler/testData/debug/localVariables/suspend/inlineLocalsStateMachineTransform.kt b/compiler/testData/debug/localVariables/suspend/inlineLocalsStateMachineTransform.kt index 602172aa480..eeb92a97a7f 100644 --- a/compiler/testData/debug/localVariables/suspend/inlineLocalsStateMachineTransform.kt +++ b/compiler/testData/debug/localVariables/suspend/inlineLocalsStateMachineTransform.kt @@ -20,7 +20,6 @@ suspend fun box() { // LOCAL VARIABLES // test.kt:10 box: -// CoroutineUtil.kt:28 getContext: // LOCAL VARIABLES JVM_IR // test.kt:-1 : $completion:kotlin.coroutines.Continuation=helpers.ResultContinuation diff --git a/compiler/testData/debug/localVariables/suspend/localsStateMachineTransform.kt b/compiler/testData/debug/localVariables/suspend/localsStateMachineTransform.kt index 0ae1b1c2f09..a68f0adf6a5 100644 --- a/compiler/testData/debug/localVariables/suspend/localsStateMachineTransform.kt +++ b/compiler/testData/debug/localVariables/suspend/localsStateMachineTransform.kt @@ -22,7 +22,6 @@ suspend fun box() { // LOCAL VARIABLES // test.kt:7 box: -// CoroutineUtil.kt:28 getContext: // test.kt:-1 : $completion:kotlin.coroutines.Continuation=helpers.ResultContinuation // test.kt:7 box: // test.kt:9 box: $continuation:kotlin.coroutines.Continuation=TestKt$box$1, $result:java.lang.Object=null diff --git a/compiler/testData/debug/localVariables/suspend/underscoreNames.kt b/compiler/testData/debug/localVariables/suspend/underscoreNames.kt index 1fc7379a13e..5f1f788120a 100644 --- a/compiler/testData/debug/localVariables/suspend/underscoreNames.kt +++ b/compiler/testData/debug/localVariables/suspend/underscoreNames.kt @@ -21,7 +21,6 @@ suspend fun box() = foo(A()) { (x_param, _, y_param) -> // test.kt:4 : // test.kt:12 box: $completion:kotlin.coroutines.Continuation=helpers.ResultContinuation // test.kt:10 foo: a:A=A, block:kotlin.jvm.functions.Function2=TestKt$box$2, $completion:kotlin.coroutines.Continuation=helpers.ResultContinuation -// CoroutineUtil.kt:28 getContext: // LOCAL VARIABLES JVM // test.kt:-1 : diff --git a/compiler/testData/debug/stepping/suspendFunWithSuspendLambdaParameter.kt b/compiler/testData/debug/stepping/suspendFunWithSuspendLambdaParameter.kt index e0cd02adac2..b6f346e9256 100644 --- a/compiler/testData/debug/stepping/suspendFunWithSuspendLambdaParameter.kt +++ b/compiler/testData/debug/stepping/suspendFunWithSuspendLambdaParameter.kt @@ -13,7 +13,6 @@ suspend fun box() { // LINENUMBERS // test.kt:8 box // test.kt:4 foo -// CoroutineUtil.kt:28 getContext // test.kt:-1 // test.kt:-1 create // test.kt:-1 invoke diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/debugInformation/AbstractDebugTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/debugInformation/AbstractDebugTest.kt index 360fc31124b..6d596b0dcfe 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/debugInformation/AbstractDebugTest.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/debugInformation/AbstractDebugTest.kt @@ -110,6 +110,10 @@ abstract class AbstractDebugTest : CodegenTestCase() { ?: File(javaBin, "java").also { assert(it.exists()) } } + val Location.isInDebugTestInfrastructure: Boolean + get() { + return this.sourcePath().startsWith("helpers" + File.separatorChar) + } } @Before diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/debugInformation/AbstractLocalVariableTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/debugInformation/AbstractLocalVariableTest.kt index fb8c3cc4fb2..f94d6a4087f 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/debugInformation/AbstractLocalVariableTest.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/debugInformation/AbstractLocalVariableTest.kt @@ -81,7 +81,9 @@ abstract class AbstractLocalVariableTest : AbstractDebugTest() { val locatableEvent = event as LocatableEvent waitUntil { locatableEvent.thread().isSuspended } val location = locatableEvent.location() + if (location.isInDebugTestInfrastructure) return if (location.method().isSynthetic) return + val frame = locatableEvent.thread().frame(0) val visibleVars = try { frame.visibleVariables().map { variable -> toRecord(frame, variable) } diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/debugInformation/AbstractSteppingTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/debugInformation/AbstractSteppingTest.kt index a140b5d4458..de73810938a 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/debugInformation/AbstractSteppingTest.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/debugInformation/AbstractSteppingTest.kt @@ -60,9 +60,11 @@ abstract class AbstractSteppingTest : AbstractDebugTest() { val actualLineNumbers = compressRunsWithoutLinenumber(loggedItems as List, LocatableEvent::location) .filter { val location = it.location() - // Ignore synthetic code with no line number information - // unless force step into behavior is requested. - forceStepInto || !location.method().isSynthetic + // Ignore: + // - synthetic code with no line number information + // unless force step into behavior is requested. + // - helper code from the test infrastructure + (forceStepInto || !location.method().isSynthetic) && !location.isInDebugTestInfrastructure } .map { "// ${it.location().formatAsExpectation()}" } val actualLineNumbersIterator = actualLineNumbers.iterator() From 5098eb84af0428e4a0e50ed58d267dea492dae99 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Tue, 12 Jan 2021 08:54:48 +0300 Subject: [PATCH 099/212] Switch IS_PRE_RELEASE flag to true #KT-44284 Fixed --- .../src/org/jetbrains/kotlin/config/KotlinCompilerVersion.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/compiler.version/src/org/jetbrains/kotlin/config/KotlinCompilerVersion.java b/compiler/compiler.version/src/org/jetbrains/kotlin/config/KotlinCompilerVersion.java index d4277393ea9..17e53820f0d 100644 --- a/compiler/compiler.version/src/org/jetbrains/kotlin/config/KotlinCompilerVersion.java +++ b/compiler/compiler.version/src/org/jetbrains/kotlin/config/KotlinCompilerVersion.java @@ -19,7 +19,7 @@ public class KotlinCompilerVersion { // Binaries produced by this compiler with that language version (or any future language version) are going to be marked // as "pre-release" and will not be loaded by release versions of the compiler. // Change this value before and after every major release - private static final boolean IS_PRE_RELEASE = false; + private static final boolean IS_PRE_RELEASE = true; public static final String TEST_IS_PRE_RELEASE_SYSTEM_PROPERTY = "kotlin.test.is.pre.release"; From d7cfd9c188cc5d6f71ac175eb2c220e3622bee38 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Tue, 12 Jan 2021 08:56:13 +0300 Subject: [PATCH 100/212] Switch latest stable version to 1.5 --- .../org/jetbrains/kotlin/config/LanguageVersionSettings.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt b/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt index 04fcbd8d981..47c8028d712 100644 --- a/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt +++ b/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt @@ -317,13 +317,13 @@ enum class LanguageVersion(val major: Int, val minor: Int) : DescriptionAware { str.split(".", "-").let { if (it.size >= 2) fromVersionString("${it[0]}.${it[1]}") else null } @JvmField - val OLDEST_DEPRECATED = KOTLIN_1_2 + val OLDEST_DEPRECATED = KOTLIN_1_3 @JvmField - val FIRST_SUPPORTED = KOTLIN_1_3 + val FIRST_SUPPORTED = KOTLIN_1_4 @JvmField - val LATEST_STABLE = KOTLIN_1_4 + val LATEST_STABLE = KOTLIN_1_5 } } From f14bd87ecc2bd4039fef8e662c369f00819b2156 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Wed, 13 Jan 2021 10:45:38 +0300 Subject: [PATCH 101/212] [Test] Update testdata of diagnostic tests during to change language to 1.5 Mostly this commit contains changes of descriptor dump of sealed classes tests according to changed visibility of sealed class constructor --- .../FirOldFrontendDiagnosticsTestGenerated.java | 12 ------------ .../tests/checkArguments/SpreadVarargs.kt | 12 ++++++------ .../tests/dataClasses/sealedDataClass.txt | 3 ++- .../foldRecursiveTypesToStarProjection.txt | 9 +++++---- .../tests/inference/nothingType/kt32388.txt | 3 ++- .../inlineClasses/inlineClassDeclarationCheck.txt | 3 ++- .../diagnostics/tests/javac/inners/Nested.txt | 5 +++-- .../tests/modifiers/IllegalModifiers.txt | 3 ++- .../tests/multimodule/redundantElseInWhen.txt | 2 +- .../extendExpectedClassWithAbstractMember.txt | 3 ++- .../tests/multiplatform/sealedTypeAlias.txt | 2 +- .../multiplatform/sealedTypeAliasTopLevel.txt | 2 +- .../namedArguments/mixedNamedPosition/varargs.kt | 8 ++++---- .../diagnostics/tests/sealed/DerivedTopLevel.kt | 4 ++-- .../diagnostics/tests/sealed/DerivedTopLevel.txt | 3 ++- .../diagnostics/tests/sealed/DoubleInner.txt | 3 ++- .../diagnostics/tests/sealed/ExhaustiveOnRoot.txt | 5 +++-- .../diagnostics/tests/sealed/ExhaustiveOnTree.txt | 11 ++++++----- .../tests/sealed/ExhaustiveOnTriangleStar.txt | 5 +++-- .../diagnostics/tests/sealed/ExhaustiveWhen.txt | 3 ++- .../tests/sealed/ExhaustiveWhenDoubleInner.txt | 3 ++- .../tests/sealed/ExhaustiveWhenMultipleInner.txt | 3 ++- .../tests/sealed/ExhaustiveWhenNegated.txt | 3 ++- .../tests/sealed/ExhaustiveWhenNegatedTwice.txt | 3 ++- .../tests/sealed/ExhaustiveWhenOnNestedSealed.txt | 5 +++-- .../tests/sealed/ExhaustiveWhenOnNullable.txt | 3 ++- .../sealed/ExhaustiveWhenWithAdditionalMember.txt | 3 ++- .../tests/sealed/ExhaustiveWhenWithElse.txt | 3 ++- .../testData/diagnostics/tests/sealed/Local.txt | 3 ++- .../diagnostics/tests/sealed/NestedSealed.txt | 7 ++++--- .../diagnostics/tests/sealed/NeverConstructed.txt | 3 ++- .../tests/sealed/NeverDerivedFromNested.kt | 4 ++-- .../tests/sealed/NeverDerivedFromNested.txt | 3 ++- .../diagnostics/tests/sealed/NeverFinal.txt | 3 ++- .../tests/sealed/NeverInterface.fir.kt | 3 --- .../diagnostics/tests/sealed/NeverInterface.kt | 3 --- .../diagnostics/tests/sealed/NeverInterface.txt | 7 ------- .../diagnostics/tests/sealed/NeverOpen.txt | 3 ++- .../tests/sealed/NonExhaustiveWhen.txt | 3 ++- .../tests/sealed/NonExhaustiveWhenNegated.txt | 3 ++- .../NonExhaustiveWhenWithAdditionalCase.txt | 3 ++- .../tests/sealed/NonExhaustiveWhenWithAnyCase.txt | 3 ++- .../tests/sealed/NonPrivateConstructor.txt | 3 ++- .../diagnostics/tests/sealed/NotFinal.txt | 3 ++- .../diagnostics/tests/sealed/OperationWhen.txt | 3 ++- .../tests/sealed/RedundantAbstract.txt | 3 ++- .../diagnostics/tests/sealed/TreeWhen.txt | 3 ++- .../tests/sealed/TreeWhenFunctional.txt | 3 ++- .../tests/sealed/TreeWhenFunctionalNoIs.txt | 3 ++- .../tests/sealed/WhenOnEmptySealed.txt | 3 ++- .../diagnostics/tests/sealed/WithInterface.txt | 3 ++- .../tests/smartCasts/fakeSmartCastOnEquality.txt | 3 ++- .../diagnostics/tests/smartCasts/openInSealed.txt | 3 ++- .../noTopLevelSealedInheritance.fir.kt | 5 ----- .../noTopLevelSealedInheritance.kt | 5 ----- .../noTopLevelSealedInheritance.txt | 15 --------------- .../diagnostics/tests/tailRecOnVirtualMember.txt | 3 ++- .../tests/tailRecOnVirtualMemberError.txt | 3 ++- .../typealias/typeAliasConstructorWrongClass.kt | 4 ++-- .../typealias/typeAliasConstructorWrongClass.txt | 3 ++- .../basicValueClassDeclarationDisabled.fir.kt | 1 + .../basicValueClassDeclarationDisabled.kt | 5 +++-- .../valueClasses/valueClassDeclarationCheck.txt | 3 ++- .../when/NonExhaustiveWarningForSealedClass.txt | 3 ++- .../diagnostics/tests/when/RedundantElse.txt | 3 ++- .../diagnostics/tests/when/TopLevelSealed.txt | 3 ++- .../withSubjectVariable/smartcastToSealed.txt | 3 ++- .../allCompatibility/specialization.txt | 3 ++- .../inference/performance/kt41644.txt | 5 +++-- .../inference/performance/kt42195.txt | 3 ++- .../test/runners/DiagnosticTestGenerated.java | 12 ------------ 71 files changed, 143 insertions(+), 150 deletions(-) delete mode 100644 compiler/testData/diagnostics/tests/sealed/NeverInterface.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/sealed/NeverInterface.kt delete mode 100644 compiler/testData/diagnostics/tests/sealed/NeverInterface.txt delete mode 100644 compiler/testData/diagnostics/tests/sourceCompatibility/noTopLevelSealedInheritance.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/sourceCompatibility/noTopLevelSealedInheritance.kt delete mode 100644 compiler/testData/diagnostics/tests/sourceCompatibility/noTopLevelSealedInheritance.txt diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java index 152049a8f56..5749ee5d155 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java @@ -24415,12 +24415,6 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti runTest("compiler/testData/diagnostics/tests/sealed/NeverFinal.kt"); } - @Test - @TestMetadata("NeverInterface.kt") - public void testNeverInterface() throws Exception { - runTest("compiler/testData/diagnostics/tests/sealed/NeverInterface.kt"); - } - @Test @TestMetadata("NeverObject.kt") public void testNeverObject() throws Exception { @@ -27255,12 +27249,6 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti runTest("compiler/testData/diagnostics/tests/sourceCompatibility/noMultiplatformProjects.kt"); } - @Test - @TestMetadata("noTopLevelSealedInheritance.kt") - public void testNoTopLevelSealedInheritance() throws Exception { - runTest("compiler/testData/diagnostics/tests/sourceCompatibility/noTopLevelSealedInheritance.kt"); - } - @Nested @TestMetadata("compiler/testData/diagnostics/tests/sourceCompatibility/apiVersion") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/testData/diagnostics/tests/checkArguments/SpreadVarargs.kt b/compiler/testData/diagnostics/tests/checkArguments/SpreadVarargs.kt index 926cddf106e..1193a21ebac 100644 --- a/compiler/testData/diagnostics/tests/checkArguments/SpreadVarargs.kt +++ b/compiler/testData/diagnostics/tests/checkArguments/SpreadVarargs.kt @@ -25,9 +25,9 @@ fun main() { join(1, "4", *a) join(1, "4", *a, *a, "3") join(1, "4", *a, *b, "3") - join(a = a, x = 1) - join(a = b, x = 1) - join(a = a, x = 1) + join(a = a, x = 1) + join(a = b, x = 1) + join(a = a, x = 1) joinG(1, "2") joinG(*1, "2") @@ -40,7 +40,7 @@ fun main() { joinG(1, "4", *a, "3") joinG(1, "4", *a) joinG(1, "4", *a, *a, "3") - joinG(a = a, x = 1) + joinG(a = a, x = 1) joinG(1, "2") joinG(*1, "2") @@ -53,7 +53,7 @@ fun main() { joinG(1, "4", *a, "3") joinG(1, "4", *a) joinG(1, "4", *a, *a, "3") - joinG(a = a, x = 1) + joinG(a = a, x = 1) val x1 = joinT(1, "2") checkSubtype(x1) @@ -69,7 +69,7 @@ fun main() { checkSubtype(x9) val x10 = joinT(1, "4", *a, *a, "3") checkSubtype(x10) - val x11 = joinT(a = a, x = 1) + val x11 = joinT(a = a, x = 1) checkSubtype(x11) val x12 = joinT(x = 1, a = a) checkSubtype(x12) diff --git a/compiler/testData/diagnostics/tests/dataClasses/sealedDataClass.txt b/compiler/testData/diagnostics/tests/dataClasses/sealedDataClass.txt index 5a1f87b58de..843867f4337 100644 --- a/compiler/testData/diagnostics/tests/dataClasses/sealedDataClass.txt +++ b/compiler/testData/diagnostics/tests/dataClasses/sealedDataClass.txt @@ -1,7 +1,7 @@ package public sealed data class My { - private constructor My(/*0*/ x: kotlin.Int) + internal constructor My(/*0*/ x: kotlin.Int) public final val x: kotlin.Int public final operator /*synthesized*/ fun component1(): kotlin.Int public final /*synthesized*/ fun copy(/*0*/ x: kotlin.Int = ...): My @@ -29,3 +29,4 @@ public sealed data class My { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } } + diff --git a/compiler/testData/diagnostics/tests/generics/starProjections/foldRecursiveTypesToStarProjection.txt b/compiler/testData/diagnostics/tests/generics/starProjections/foldRecursiveTypesToStarProjection.txt index a3462779ed6..9e03553cdbf 100644 --- a/compiler/testData/diagnostics/tests/generics/starProjections/foldRecursiveTypesToStarProjection.txt +++ b/compiler/testData/diagnostics/tests/generics/starProjections/foldRecursiveTypesToStarProjection.txt @@ -77,30 +77,31 @@ public object KT32183 { } public sealed class ProjectJob { - private constructor ProjectJob() + internal constructor ProjectJob() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String public sealed class Process, /*1*/ R : KT32183.ProjectJob.ProcessResources> : KT32183.ProjectJob { - private constructor Process, /*1*/ R : KT32183.ProjectJob.ProcessResources>() + internal constructor Process, /*1*/ R : KT32183.ProjectJob.ProcessResources>() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } public sealed class ProcessExecutable> { - private constructor ProcessExecutable>() + internal constructor ProcessExecutable>() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } public sealed class ProcessResources> { - private constructor ProcessResources>() + internal constructor ProcessResources>() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } } } + diff --git a/compiler/testData/diagnostics/tests/inference/nothingType/kt32388.txt b/compiler/testData/diagnostics/tests/inference/nothingType/kt32388.txt index 790a1da91cd..77f67644feb 100644 --- a/compiler/testData/diagnostics/tests/inference/nothingType/kt32388.txt +++ b/compiler/testData/diagnostics/tests/inference/nothingType/kt32388.txt @@ -4,7 +4,7 @@ public fun Either.recover(/*0*/ f: (A) -> B): Either A.right(): Either public sealed class Either { - private constructor Either() + internal constructor Either() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String @@ -25,3 +25,4 @@ public sealed class Either { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } } + diff --git a/compiler/testData/diagnostics/tests/inlineClasses/inlineClassDeclarationCheck.txt b/compiler/testData/diagnostics/tests/inlineClasses/inlineClassDeclarationCheck.txt index 0933b86cc72..d5932702482 100644 --- a/compiler/testData/diagnostics/tests/inlineClasses/inlineClassDeclarationCheck.txt +++ b/compiler/testData/diagnostics/tests/inlineClasses/inlineClassDeclarationCheck.txt @@ -174,7 +174,7 @@ public abstract inline class D2 { } public sealed inline class D3 { - private constructor D3(/*0*/ x: kotlin.Int) + internal constructor D3(/*0*/ x: kotlin.Int) public final val x: kotlin.Int public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int @@ -190,3 +190,4 @@ public final data inline class D4 { public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String } + diff --git a/compiler/testData/diagnostics/tests/javac/inners/Nested.txt b/compiler/testData/diagnostics/tests/javac/inners/Nested.txt index 53795353575..9b8503cf487 100644 --- a/compiler/testData/diagnostics/tests/javac/inners/Nested.txt +++ b/compiler/testData/diagnostics/tests/javac/inners/Nested.txt @@ -21,13 +21,13 @@ package p { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String public sealed class Sealed1 { - private constructor Sealed1() + internal constructor Sealed1() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String public sealed class Sealed2 { - private constructor Sealed2() + internal constructor Sealed2() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String @@ -35,3 +35,4 @@ package p { } } } + diff --git a/compiler/testData/diagnostics/tests/modifiers/IllegalModifiers.txt b/compiler/testData/diagnostics/tests/modifiers/IllegalModifiers.txt index 7c5153ea00c..18f8bd789ee 100644 --- a/compiler/testData/diagnostics/tests/modifiers/IllegalModifiers.txt +++ b/compiler/testData/diagnostics/tests/modifiers/IllegalModifiers.txt @@ -155,7 +155,7 @@ package illegal_modifiers { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String public sealed inner class Inner { - private constructor Inner() + internal constructor Inner() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String @@ -176,3 +176,4 @@ package illegal_modifiers { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } } + diff --git a/compiler/testData/diagnostics/tests/multimodule/redundantElseInWhen.txt b/compiler/testData/diagnostics/tests/multimodule/redundantElseInWhen.txt index f15679a2cab..4fab4c6ad6e 100644 --- a/compiler/testData/diagnostics/tests/multimodule/redundantElseInWhen.txt +++ b/compiler/testData/diagnostics/tests/multimodule/redundantElseInWhen.txt @@ -30,7 +30,7 @@ package test { } public sealed class S { - private constructor S() + internal constructor S() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String diff --git a/compiler/testData/diagnostics/tests/multiplatform/headerClass/extendExpectedClassWithAbstractMember.txt b/compiler/testData/diagnostics/tests/multiplatform/headerClass/extendExpectedClassWithAbstractMember.txt index b476ae9b950..8e6a3c4f8e7 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/headerClass/extendExpectedClassWithAbstractMember.txt +++ b/compiler/testData/diagnostics/tests/multiplatform/headerClass/extendExpectedClassWithAbstractMember.txt @@ -70,7 +70,7 @@ public expect interface BaseE { } public sealed class BaseEImpl : BaseE { - private constructor BaseEImpl() + internal constructor BaseEImpl() public final fun bar(): kotlin.Unit public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public abstract expect override /*1*/ /*fake_override*/ fun foo(): kotlin.Unit @@ -140,3 +140,4 @@ public final class DerivedC2 : BaseCImpl { public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } + diff --git a/compiler/testData/diagnostics/tests/multiplatform/sealedTypeAlias.txt b/compiler/testData/diagnostics/tests/multiplatform/sealedTypeAlias.txt index 74e8c79ce25..36e27006142 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/sealedTypeAlias.txt +++ b/compiler/testData/diagnostics/tests/multiplatform/sealedTypeAlias.txt @@ -23,7 +23,7 @@ public sealed expect class Presence { package public sealed class P { - private constructor P() + internal constructor P() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String diff --git a/compiler/testData/diagnostics/tests/multiplatform/sealedTypeAliasTopLevel.txt b/compiler/testData/diagnostics/tests/multiplatform/sealedTypeAliasTopLevel.txt index 8a518d78c8c..16eaf0abd1a 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/sealedTypeAliasTopLevel.txt +++ b/compiler/testData/diagnostics/tests/multiplatform/sealedTypeAliasTopLevel.txt @@ -37,7 +37,7 @@ public actual object Online : P { } public sealed class P { - private constructor P() + internal constructor P() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String diff --git a/compiler/testData/diagnostics/tests/namedArguments/mixedNamedPosition/varargs.kt b/compiler/testData/diagnostics/tests/namedArguments/mixedNamedPosition/varargs.kt index 18e4c5d763f..8e171bdd5c0 100644 --- a/compiler/testData/diagnostics/tests/namedArguments/mixedNamedPosition/varargs.kt +++ b/compiler/testData/diagnostics/tests/namedArguments/mixedNamedPosition/varargs.kt @@ -29,12 +29,12 @@ fun foo4( fun main() { foo1(1, 2, p2 = "3", 4.0) - foo1(p1 = intArrayOf(1, 2), "3", p3 = 4.0) + foo1(p1 = intArrayOf(1, 2), "3", p3 = 4.0) foo1(p2 = "3", 4.0) foo2(p1 = 1, "2", "3", p3 = 4.0) - foo2(1, p2 = arrayOf("2", "3"), 4.0) + foo2(1, p2 = arrayOf("2", "3"), 4.0) foo2(1, p3 = 3.0) foo3(p1 = 1, "2", 3.0, 4.0) @@ -52,6 +52,6 @@ fun main() { foo2(1, p3 = 2.0, *arrayOf("3", "4")) foo2(1, p3 = 2.0, p2 = arrayOf("3", "4")) - foo3(1, p3 = doubleArrayOf(2.0, 3.0), "4") - foo3(1, p3 = doubleArrayOf(2.0, 3.0), p2 = "4") + foo3(1, p3 = doubleArrayOf(2.0, 3.0), "4") + foo3(1, p3 = doubleArrayOf(2.0, 3.0), p2 = "4") } diff --git a/compiler/testData/diagnostics/tests/sealed/DerivedTopLevel.kt b/compiler/testData/diagnostics/tests/sealed/DerivedTopLevel.kt index f7a662f468b..2600c6bd87a 100644 --- a/compiler/testData/diagnostics/tests/sealed/DerivedTopLevel.kt +++ b/compiler/testData/diagnostics/tests/sealed/DerivedTopLevel.kt @@ -1,10 +1,10 @@ sealed class Base class Derived: Base() { - class Derived2: Base() + class Derived2: Base() } fun test() { - class Local: Base() + class Local: Base() } diff --git a/compiler/testData/diagnostics/tests/sealed/DerivedTopLevel.txt b/compiler/testData/diagnostics/tests/sealed/DerivedTopLevel.txt index 8c7dbf3d5aa..7f1ab161a05 100644 --- a/compiler/testData/diagnostics/tests/sealed/DerivedTopLevel.txt +++ b/compiler/testData/diagnostics/tests/sealed/DerivedTopLevel.txt @@ -3,7 +3,7 @@ package public fun test(): kotlin.Unit public sealed class Base { - private constructor Base() + internal constructor Base() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String @@ -22,3 +22,4 @@ public final class Derived : Base { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } } + diff --git a/compiler/testData/diagnostics/tests/sealed/DoubleInner.txt b/compiler/testData/diagnostics/tests/sealed/DoubleInner.txt index 67b084f0918..050d26bc834 100644 --- a/compiler/testData/diagnostics/tests/sealed/DoubleInner.txt +++ b/compiler/testData/diagnostics/tests/sealed/DoubleInner.txt @@ -1,7 +1,7 @@ package public sealed class Sealed { - private constructor Sealed(/*0*/ x: kotlin.Int) + internal constructor Sealed(/*0*/ x: kotlin.Int) public final val x: kotlin.Int public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int @@ -50,3 +50,4 @@ public sealed class Sealed { } } } + diff --git a/compiler/testData/diagnostics/tests/sealed/ExhaustiveOnRoot.txt b/compiler/testData/diagnostics/tests/sealed/ExhaustiveOnRoot.txt index 48902800437..425b7c75ed6 100644 --- a/compiler/testData/diagnostics/tests/sealed/ExhaustiveOnRoot.txt +++ b/compiler/testData/diagnostics/tests/sealed/ExhaustiveOnRoot.txt @@ -5,7 +5,7 @@ public fun test2(/*0*/ x: Stmt): kotlin.String public fun test3(/*0*/ x: Expr): kotlin.String public sealed class Expr : Stmt { - private constructor Expr() + internal constructor Expr() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String @@ -26,8 +26,9 @@ public final class ForStmt : Stmt { } public sealed class Stmt { - private constructor Stmt() + internal constructor Stmt() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } + diff --git a/compiler/testData/diagnostics/tests/sealed/ExhaustiveOnTree.txt b/compiler/testData/diagnostics/tests/sealed/ExhaustiveOnTree.txt index afa4a4d3207..2559c794d81 100644 --- a/compiler/testData/diagnostics/tests/sealed/ExhaustiveOnTree.txt +++ b/compiler/testData/diagnostics/tests/sealed/ExhaustiveOnTree.txt @@ -1,7 +1,7 @@ package public sealed class Base { - private constructor Base() + internal constructor Base() public final fun bar(): kotlin.Int public final fun baz(): kotlin.Int public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean @@ -11,7 +11,7 @@ public sealed class Base { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String public sealed class A : Base { - private constructor A() + internal constructor A() public final override /*1*/ /*fake_override*/ fun bar(): kotlin.Int public final override /*1*/ /*fake_override*/ fun baz(): kotlin.Int public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean @@ -32,7 +32,7 @@ public sealed class Base { } public sealed class A2 : Base.A { - private constructor A2() + internal constructor A2() public final override /*1*/ /*fake_override*/ fun bar(): kotlin.Int public final override /*1*/ /*fake_override*/ fun baz(): kotlin.Int public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean @@ -44,7 +44,7 @@ public sealed class Base { } public sealed class B : Base { - private constructor B() + internal constructor B() public final override /*1*/ /*fake_override*/ fun bar(): kotlin.Int public final override /*1*/ /*fake_override*/ fun baz(): kotlin.Int public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean @@ -54,7 +54,7 @@ public sealed class Base { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String public sealed class B1 : Base.B { - private constructor B1() + internal constructor B1() public final override /*1*/ /*fake_override*/ fun bar(): kotlin.Int public final override /*1*/ /*fake_override*/ fun baz(): kotlin.Int public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean @@ -76,3 +76,4 @@ public sealed class Base { } } } + diff --git a/compiler/testData/diagnostics/tests/sealed/ExhaustiveOnTriangleStar.txt b/compiler/testData/diagnostics/tests/sealed/ExhaustiveOnTriangleStar.txt index d093f4f9b27..ed10fcf8de7 100644 --- a/compiler/testData/diagnostics/tests/sealed/ExhaustiveOnTriangleStar.txt +++ b/compiler/testData/diagnostics/tests/sealed/ExhaustiveOnTriangleStar.txt @@ -5,14 +5,14 @@ public fun test2(/*0*/ a: A): kotlin.Any public fun test3(/*0*/ a: A): kotlin.Any public sealed class A { - private constructor A() + internal constructor A() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } public sealed class B : A { - private constructor B() + internal constructor B() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String @@ -31,3 +31,4 @@ public final class D : B { public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } + diff --git a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhen.txt b/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhen.txt index 22dbcb824c9..6052d5fbd87 100644 --- a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhen.txt +++ b/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhen.txt @@ -3,7 +3,7 @@ package public fun foo(/*0*/ s: Sealed): kotlin.Int public sealed class Sealed { - private constructor Sealed(/*0*/ x: kotlin.Int) + internal constructor Sealed(/*0*/ x: kotlin.Int) public final val x: kotlin.Int public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int @@ -44,3 +44,4 @@ public sealed class Sealed { } } } + diff --git a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenDoubleInner.txt b/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenDoubleInner.txt index 148441cbfd3..cd86b738170 100644 --- a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenDoubleInner.txt +++ b/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenDoubleInner.txt @@ -3,7 +3,7 @@ package public fun foo(/*0*/ s: Sealed): kotlin.Int public sealed class Sealed { - private constructor Sealed() + internal constructor Sealed() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String @@ -43,3 +43,4 @@ public sealed class Sealed { } } } + diff --git a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenMultipleInner.txt b/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenMultipleInner.txt index fa09d1fe85b..353be8f9350 100644 --- a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenMultipleInner.txt +++ b/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenMultipleInner.txt @@ -6,7 +6,7 @@ public fun fooWithElse(/*0*/ s: Sealed): kotlin.Int public fun fooWithoutElse(/*0*/ s: Sealed): kotlin.Int public sealed class Sealed { - private constructor Sealed() + internal constructor Sealed() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String @@ -67,3 +67,4 @@ public sealed class Sealed { } } } + diff --git a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenNegated.txt b/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenNegated.txt index 22dbcb824c9..6052d5fbd87 100644 --- a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenNegated.txt +++ b/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenNegated.txt @@ -3,7 +3,7 @@ package public fun foo(/*0*/ s: Sealed): kotlin.Int public sealed class Sealed { - private constructor Sealed(/*0*/ x: kotlin.Int) + internal constructor Sealed(/*0*/ x: kotlin.Int) public final val x: kotlin.Int public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int @@ -44,3 +44,4 @@ public sealed class Sealed { } } } + diff --git a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenNegatedTwice.txt b/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenNegatedTwice.txt index 7d59920c4e0..9822f3cd0f9 100644 --- a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenNegatedTwice.txt +++ b/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenNegatedTwice.txt @@ -3,7 +3,7 @@ package public fun foo(/*0*/ s: Sealed): kotlin.Int public sealed class Sealed { - private constructor Sealed(/*0*/ x: kotlin.Int) + internal constructor Sealed(/*0*/ x: kotlin.Int) public final val x: kotlin.Int public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int @@ -52,3 +52,4 @@ public sealed class Sealed { } } } + diff --git a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenOnNestedSealed.txt b/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenOnNestedSealed.txt index a917d1e29c1..b352827f224 100644 --- a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenOnNestedSealed.txt +++ b/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenOnNestedSealed.txt @@ -3,7 +3,7 @@ package public fun foo(/*0*/ s: Sealed, /*1*/ nf: Sealed.NonFirst): kotlin.Int public sealed class Sealed { - private constructor Sealed() + internal constructor Sealed() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String @@ -16,7 +16,7 @@ public sealed class Sealed { } public sealed class NonFirst { - private constructor NonFirst() + internal constructor NonFirst() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String @@ -43,3 +43,4 @@ public sealed class Sealed { } } } + diff --git a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenOnNullable.txt b/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenOnNullable.txt index a87f45ed06f..3e989e300bb 100644 --- a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenOnNullable.txt +++ b/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenOnNullable.txt @@ -3,7 +3,7 @@ package public fun foo(/*0*/ s: Sealed?): kotlin.Int public sealed class Sealed { - private constructor Sealed(/*0*/ x: kotlin.Int) + internal constructor Sealed(/*0*/ x: kotlin.Int) public final val x: kotlin.Int public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int @@ -44,3 +44,4 @@ public sealed class Sealed { } } } + diff --git a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenWithAdditionalMember.txt b/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenWithAdditionalMember.txt index b8887b3f613..5abe4e1702c 100644 --- a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenWithAdditionalMember.txt +++ b/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenWithAdditionalMember.txt @@ -3,7 +3,7 @@ package public fun foo(/*0*/ s: Sealed): kotlin.Int public sealed class Sealed { - private constructor Sealed(/*0*/ x: kotlin.Int) + internal constructor Sealed(/*0*/ x: kotlin.Int) public final val x: kotlin.Int public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int @@ -56,3 +56,4 @@ public sealed class Sealed { public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String } } + diff --git a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenWithElse.txt b/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenWithElse.txt index 22dbcb824c9..6052d5fbd87 100644 --- a/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenWithElse.txt +++ b/compiler/testData/diagnostics/tests/sealed/ExhaustiveWhenWithElse.txt @@ -3,7 +3,7 @@ package public fun foo(/*0*/ s: Sealed): kotlin.Int public sealed class Sealed { - private constructor Sealed(/*0*/ x: kotlin.Int) + internal constructor Sealed(/*0*/ x: kotlin.Int) public final val x: kotlin.Int public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int @@ -44,3 +44,4 @@ public sealed class Sealed { } } } + diff --git a/compiler/testData/diagnostics/tests/sealed/Local.txt b/compiler/testData/diagnostics/tests/sealed/Local.txt index 3eb8bb9345e..bbb25c8a302 100644 --- a/compiler/testData/diagnostics/tests/sealed/Local.txt +++ b/compiler/testData/diagnostics/tests/sealed/Local.txt @@ -1,7 +1,7 @@ package public sealed class Sealed { - private constructor Sealed() + internal constructor Sealed() public final val p: Sealed public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int @@ -42,3 +42,4 @@ public sealed class Sealed { } } } + diff --git a/compiler/testData/diagnostics/tests/sealed/NestedSealed.txt b/compiler/testData/diagnostics/tests/sealed/NestedSealed.txt index 5860a568d5f..10a7db9e368 100644 --- a/compiler/testData/diagnostics/tests/sealed/NestedSealed.txt +++ b/compiler/testData/diagnostics/tests/sealed/NestedSealed.txt @@ -5,13 +5,13 @@ public fun foo(/*0*/ b: Base): kotlin.Int public fun gav(/*0*/ b: Base?): kotlin.Int public sealed class Base { - private constructor Base() + internal constructor Base() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String public sealed class A : Base { - private constructor A() + internal constructor A() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String @@ -32,7 +32,7 @@ public sealed class Base { } public sealed class B : Base { - private constructor B() + internal constructor B() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String @@ -52,3 +52,4 @@ public sealed class Base { } } } + diff --git a/compiler/testData/diagnostics/tests/sealed/NeverConstructed.txt b/compiler/testData/diagnostics/tests/sealed/NeverConstructed.txt index 3c9d5cefd04..f210e874257 100644 --- a/compiler/testData/diagnostics/tests/sealed/NeverConstructed.txt +++ b/compiler/testData/diagnostics/tests/sealed/NeverConstructed.txt @@ -1,9 +1,10 @@ package public sealed class Base { - private constructor Base() + internal constructor Base() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public final fun foo(): Base public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } + diff --git a/compiler/testData/diagnostics/tests/sealed/NeverDerivedFromNested.kt b/compiler/testData/diagnostics/tests/sealed/NeverDerivedFromNested.kt index f3a378e55a3..b7342a1c323 100644 --- a/compiler/testData/diagnostics/tests/sealed/NeverDerivedFromNested.kt +++ b/compiler/testData/diagnostics/tests/sealed/NeverDerivedFromNested.kt @@ -2,8 +2,8 @@ class A { sealed class Base } -class Derived : A.Base() +class Derived : A.Base() fun test() { - class DerivedLocal : A.Base() + class DerivedLocal : A.Base() } diff --git a/compiler/testData/diagnostics/tests/sealed/NeverDerivedFromNested.txt b/compiler/testData/diagnostics/tests/sealed/NeverDerivedFromNested.txt index 06081addd8b..faaa729b10a 100644 --- a/compiler/testData/diagnostics/tests/sealed/NeverDerivedFromNested.txt +++ b/compiler/testData/diagnostics/tests/sealed/NeverDerivedFromNested.txt @@ -9,7 +9,7 @@ public final class A { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String public sealed class Base { - private constructor Base() + internal constructor Base() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String @@ -22,3 +22,4 @@ public final class Derived : A.Base { public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } + diff --git a/compiler/testData/diagnostics/tests/sealed/NeverFinal.txt b/compiler/testData/diagnostics/tests/sealed/NeverFinal.txt index bb9b3fc8d1c..4f963ec4c07 100644 --- a/compiler/testData/diagnostics/tests/sealed/NeverFinal.txt +++ b/compiler/testData/diagnostics/tests/sealed/NeverFinal.txt @@ -1,8 +1,9 @@ package public sealed class Base { - private constructor Base() + internal constructor Base() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } + diff --git a/compiler/testData/diagnostics/tests/sealed/NeverInterface.fir.kt b/compiler/testData/diagnostics/tests/sealed/NeverInterface.fir.kt deleted file mode 100644 index d70b4d3f01b..00000000000 --- a/compiler/testData/diagnostics/tests/sealed/NeverInterface.fir.kt +++ /dev/null @@ -1,3 +0,0 @@ -sealed interface Base { - -} diff --git a/compiler/testData/diagnostics/tests/sealed/NeverInterface.kt b/compiler/testData/diagnostics/tests/sealed/NeverInterface.kt deleted file mode 100644 index b22a4a90a43..00000000000 --- a/compiler/testData/diagnostics/tests/sealed/NeverInterface.kt +++ /dev/null @@ -1,3 +0,0 @@ -sealed interface Base { - -} diff --git a/compiler/testData/diagnostics/tests/sealed/NeverInterface.txt b/compiler/testData/diagnostics/tests/sealed/NeverInterface.txt deleted file mode 100644 index f2ed48d03d4..00000000000 --- a/compiler/testData/diagnostics/tests/sealed/NeverInterface.txt +++ /dev/null @@ -1,7 +0,0 @@ -package - -public sealed interface Base { - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} diff --git a/compiler/testData/diagnostics/tests/sealed/NeverOpen.txt b/compiler/testData/diagnostics/tests/sealed/NeverOpen.txt index bb9b3fc8d1c..4f963ec4c07 100644 --- a/compiler/testData/diagnostics/tests/sealed/NeverOpen.txt +++ b/compiler/testData/diagnostics/tests/sealed/NeverOpen.txt @@ -1,8 +1,9 @@ package public sealed class Base { - private constructor Base() + internal constructor Base() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } + diff --git a/compiler/testData/diagnostics/tests/sealed/NonExhaustiveWhen.txt b/compiler/testData/diagnostics/tests/sealed/NonExhaustiveWhen.txt index 22dbcb824c9..6052d5fbd87 100644 --- a/compiler/testData/diagnostics/tests/sealed/NonExhaustiveWhen.txt +++ b/compiler/testData/diagnostics/tests/sealed/NonExhaustiveWhen.txt @@ -3,7 +3,7 @@ package public fun foo(/*0*/ s: Sealed): kotlin.Int public sealed class Sealed { - private constructor Sealed(/*0*/ x: kotlin.Int) + internal constructor Sealed(/*0*/ x: kotlin.Int) public final val x: kotlin.Int public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int @@ -44,3 +44,4 @@ public sealed class Sealed { } } } + diff --git a/compiler/testData/diagnostics/tests/sealed/NonExhaustiveWhenNegated.txt b/compiler/testData/diagnostics/tests/sealed/NonExhaustiveWhenNegated.txt index 22dbcb824c9..6052d5fbd87 100644 --- a/compiler/testData/diagnostics/tests/sealed/NonExhaustiveWhenNegated.txt +++ b/compiler/testData/diagnostics/tests/sealed/NonExhaustiveWhenNegated.txt @@ -3,7 +3,7 @@ package public fun foo(/*0*/ s: Sealed): kotlin.Int public sealed class Sealed { - private constructor Sealed(/*0*/ x: kotlin.Int) + internal constructor Sealed(/*0*/ x: kotlin.Int) public final val x: kotlin.Int public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int @@ -44,3 +44,4 @@ public sealed class Sealed { } } } + diff --git a/compiler/testData/diagnostics/tests/sealed/NonExhaustiveWhenWithAdditionalCase.txt b/compiler/testData/diagnostics/tests/sealed/NonExhaustiveWhenWithAdditionalCase.txt index 3b3b7d2df39..33444b8be1b 100644 --- a/compiler/testData/diagnostics/tests/sealed/NonExhaustiveWhenWithAdditionalCase.txt +++ b/compiler/testData/diagnostics/tests/sealed/NonExhaustiveWhenWithAdditionalCase.txt @@ -3,7 +3,7 @@ package public fun foo(/*0*/ s: Sealed): kotlin.Int public sealed class Sealed { - private constructor Sealed(/*0*/ x: kotlin.Int) + internal constructor Sealed(/*0*/ x: kotlin.Int) public final val x: kotlin.Int public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int @@ -61,3 +61,4 @@ public sealed class Sealed { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } } + diff --git a/compiler/testData/diagnostics/tests/sealed/NonExhaustiveWhenWithAnyCase.txt b/compiler/testData/diagnostics/tests/sealed/NonExhaustiveWhenWithAnyCase.txt index 9a98e4af50f..fa27bc4811d 100644 --- a/compiler/testData/diagnostics/tests/sealed/NonExhaustiveWhenWithAnyCase.txt +++ b/compiler/testData/diagnostics/tests/sealed/NonExhaustiveWhenWithAnyCase.txt @@ -3,7 +3,7 @@ package public fun foo(/*0*/ s: Sealed): kotlin.Int public sealed class Sealed { - private constructor Sealed() + internal constructor Sealed() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String @@ -36,3 +36,4 @@ public sealed class Sealed { } } } + diff --git a/compiler/testData/diagnostics/tests/sealed/NonPrivateConstructor.txt b/compiler/testData/diagnostics/tests/sealed/NonPrivateConstructor.txt index 0a27f00ee97..18a46c7808f 100644 --- a/compiler/testData/diagnostics/tests/sealed/NonPrivateConstructor.txt +++ b/compiler/testData/diagnostics/tests/sealed/NonPrivateConstructor.txt @@ -3,7 +3,7 @@ package public sealed class Sealed { public constructor Sealed() protected constructor Sealed(/*0*/ x: kotlin.Int) - private constructor Sealed(/*0*/ y: kotlin.Int, /*1*/ z: kotlin.Int) + internal constructor Sealed(/*0*/ y: kotlin.Int, /*1*/ z: kotlin.Int) public final val x: kotlin.Int public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int @@ -17,3 +17,4 @@ public sealed class Sealed { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } } + diff --git a/compiler/testData/diagnostics/tests/sealed/NotFinal.txt b/compiler/testData/diagnostics/tests/sealed/NotFinal.txt index 3d5953b9dfc..23ce8ce7f29 100644 --- a/compiler/testData/diagnostics/tests/sealed/NotFinal.txt +++ b/compiler/testData/diagnostics/tests/sealed/NotFinal.txt @@ -3,7 +3,7 @@ package public fun doit(/*0*/ arg: T): T public sealed class Foo { - private constructor Foo() + internal constructor Foo() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String @@ -22,3 +22,4 @@ public sealed class Foo { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } } + diff --git a/compiler/testData/diagnostics/tests/sealed/OperationWhen.txt b/compiler/testData/diagnostics/tests/sealed/OperationWhen.txt index 3505739dea2..cebdb6ea323 100644 --- a/compiler/testData/diagnostics/tests/sealed/OperationWhen.txt +++ b/compiler/testData/diagnostics/tests/sealed/OperationWhen.txt @@ -3,7 +3,7 @@ package public fun priority(/*0*/ op: Operation): kotlin.Int public sealed class Operation { - private constructor Operation(/*0*/ left: kotlin.Int, /*1*/ right: kotlin.Int) + internal constructor Operation(/*0*/ left: kotlin.Int, /*1*/ right: kotlin.Int) public final val left: kotlin.Int public final val right: kotlin.Int public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean @@ -51,3 +51,4 @@ public sealed class Operation { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } } + diff --git a/compiler/testData/diagnostics/tests/sealed/RedundantAbstract.txt b/compiler/testData/diagnostics/tests/sealed/RedundantAbstract.txt index bb9b3fc8d1c..4f963ec4c07 100644 --- a/compiler/testData/diagnostics/tests/sealed/RedundantAbstract.txt +++ b/compiler/testData/diagnostics/tests/sealed/RedundantAbstract.txt @@ -1,8 +1,9 @@ package public sealed class Base { - private constructor Base() + internal constructor Base() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } + diff --git a/compiler/testData/diagnostics/tests/sealed/TreeWhen.txt b/compiler/testData/diagnostics/tests/sealed/TreeWhen.txt index bc46a439415..0b16ddc38f4 100644 --- a/compiler/testData/diagnostics/tests/sealed/TreeWhen.txt +++ b/compiler/testData/diagnostics/tests/sealed/TreeWhen.txt @@ -1,7 +1,7 @@ package public sealed class Tree { - private constructor Tree() + internal constructor Tree() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public final fun max(): kotlin.Int @@ -34,3 +34,4 @@ public sealed class Tree { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } } + diff --git a/compiler/testData/diagnostics/tests/sealed/TreeWhenFunctional.txt b/compiler/testData/diagnostics/tests/sealed/TreeWhenFunctional.txt index bc46a439415..0b16ddc38f4 100644 --- a/compiler/testData/diagnostics/tests/sealed/TreeWhenFunctional.txt +++ b/compiler/testData/diagnostics/tests/sealed/TreeWhenFunctional.txt @@ -1,7 +1,7 @@ package public sealed class Tree { - private constructor Tree() + internal constructor Tree() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public final fun max(): kotlin.Int @@ -34,3 +34,4 @@ public sealed class Tree { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } } + diff --git a/compiler/testData/diagnostics/tests/sealed/TreeWhenFunctionalNoIs.txt b/compiler/testData/diagnostics/tests/sealed/TreeWhenFunctionalNoIs.txt index 8a1ace58713..64955fd0483 100644 --- a/compiler/testData/diagnostics/tests/sealed/TreeWhenFunctionalNoIs.txt +++ b/compiler/testData/diagnostics/tests/sealed/TreeWhenFunctionalNoIs.txt @@ -1,7 +1,7 @@ package public sealed class Tree { - private constructor Tree() + internal constructor Tree() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public final fun max(): kotlin.Int @@ -42,3 +42,4 @@ public sealed class Tree { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } } + diff --git a/compiler/testData/diagnostics/tests/sealed/WhenOnEmptySealed.txt b/compiler/testData/diagnostics/tests/sealed/WhenOnEmptySealed.txt index 87745e29ea5..50319d715ed 100644 --- a/compiler/testData/diagnostics/tests/sealed/WhenOnEmptySealed.txt +++ b/compiler/testData/diagnostics/tests/sealed/WhenOnEmptySealed.txt @@ -3,8 +3,9 @@ package public fun foo(/*0*/ s: Sealed): kotlin.Int public sealed class Sealed { - private constructor Sealed() + internal constructor Sealed() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } + diff --git a/compiler/testData/diagnostics/tests/sealed/WithInterface.txt b/compiler/testData/diagnostics/tests/sealed/WithInterface.txt index 755910f4b4e..62bb5d50b1f 100644 --- a/compiler/testData/diagnostics/tests/sealed/WithInterface.txt +++ b/compiler/testData/diagnostics/tests/sealed/WithInterface.txt @@ -9,7 +9,7 @@ public interface Child : Parent { } public sealed class Page : Parent { - private constructor Page() + internal constructor Page() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String @@ -34,3 +34,4 @@ public interface Parent { public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } + diff --git a/compiler/testData/diagnostics/tests/smartCasts/fakeSmartCastOnEquality.txt b/compiler/testData/diagnostics/tests/smartCasts/fakeSmartCastOnEquality.txt index 898674e8430..37cc7ceaaf3 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/fakeSmartCastOnEquality.txt +++ b/compiler/testData/diagnostics/tests/smartCasts/fakeSmartCastOnEquality.txt @@ -65,7 +65,7 @@ public open class OpenClass2 { } public sealed class Sealed { - private constructor Sealed() + internal constructor Sealed() public final fun check(/*0*/ arg: Sealed.Sealed1): kotlin.Unit public open override /*1*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int @@ -88,3 +88,4 @@ public sealed class Sealed { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } } + diff --git a/compiler/testData/diagnostics/tests/smartCasts/openInSealed.txt b/compiler/testData/diagnostics/tests/smartCasts/openInSealed.txt index ec78d0d7a29..050f6bbc035 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/openInSealed.txt +++ b/compiler/testData/diagnostics/tests/smartCasts/openInSealed.txt @@ -1,9 +1,10 @@ package public sealed class My { - private constructor My(/*0*/ x: kotlin.Int?) + internal constructor My(/*0*/ x: kotlin.Int?) public open val x: kotlin.Int? public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } + diff --git a/compiler/testData/diagnostics/tests/sourceCompatibility/noTopLevelSealedInheritance.fir.kt b/compiler/testData/diagnostics/tests/sourceCompatibility/noTopLevelSealedInheritance.fir.kt deleted file mode 100644 index 1e1cc9ad267..00000000000 --- a/compiler/testData/diagnostics/tests/sourceCompatibility/noTopLevelSealedInheritance.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -// !LANGUAGE: -TopLevelSealedInheritance - -sealed class Base - -class Derived : Base() diff --git a/compiler/testData/diagnostics/tests/sourceCompatibility/noTopLevelSealedInheritance.kt b/compiler/testData/diagnostics/tests/sourceCompatibility/noTopLevelSealedInheritance.kt deleted file mode 100644 index 6510deffede..00000000000 --- a/compiler/testData/diagnostics/tests/sourceCompatibility/noTopLevelSealedInheritance.kt +++ /dev/null @@ -1,5 +0,0 @@ -// !LANGUAGE: -TopLevelSealedInheritance - -sealed class Base - -class Derived : Base() diff --git a/compiler/testData/diagnostics/tests/sourceCompatibility/noTopLevelSealedInheritance.txt b/compiler/testData/diagnostics/tests/sourceCompatibility/noTopLevelSealedInheritance.txt deleted file mode 100644 index 6e259fee7a3..00000000000 --- a/compiler/testData/diagnostics/tests/sourceCompatibility/noTopLevelSealedInheritance.txt +++ /dev/null @@ -1,15 +0,0 @@ -package - -public sealed class Base { - private constructor Base() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} - -public final class Derived : Base { - public constructor Derived() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String -} diff --git a/compiler/testData/diagnostics/tests/tailRecOnVirtualMember.txt b/compiler/testData/diagnostics/tests/tailRecOnVirtualMember.txt index 9206c55d728..1860f2bcccb 100644 --- a/compiler/testData/diagnostics/tests/tailRecOnVirtualMember.txt +++ b/compiler/testData/diagnostics/tests/tailRecOnVirtualMember.txt @@ -51,7 +51,7 @@ public object D : A { } public sealed class E : A { - private constructor E() + internal constructor E() internal final override /*1*/ tailrec /*fake_override*/ fun baa(/*0*/ y: kotlin.Int): kotlin.Unit internal open override /*1*/ tailrec fun bar(/*0*/ y: kotlin.Int): kotlin.Unit protected open override /*1*/ tailrec fun baz(/*0*/ y: kotlin.Int): kotlin.Unit @@ -123,3 +123,4 @@ public final enum class G : kotlin.Enum { public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): G public final /*synthesized*/ fun values(): kotlin.Array } + diff --git a/compiler/testData/diagnostics/tests/tailRecOnVirtualMemberError.txt b/compiler/testData/diagnostics/tests/tailRecOnVirtualMemberError.txt index 9206c55d728..1860f2bcccb 100644 --- a/compiler/testData/diagnostics/tests/tailRecOnVirtualMemberError.txt +++ b/compiler/testData/diagnostics/tests/tailRecOnVirtualMemberError.txt @@ -51,7 +51,7 @@ public object D : A { } public sealed class E : A { - private constructor E() + internal constructor E() internal final override /*1*/ tailrec /*fake_override*/ fun baa(/*0*/ y: kotlin.Int): kotlin.Unit internal open override /*1*/ tailrec fun bar(/*0*/ y: kotlin.Int): kotlin.Unit protected open override /*1*/ tailrec fun baz(/*0*/ y: kotlin.Int): kotlin.Unit @@ -123,3 +123,4 @@ public final enum class G : kotlin.Enum { public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): G public final /*synthesized*/ fun values(): kotlin.Array } + diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorWrongClass.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorWrongClass.kt index cafaeda2aa2..e0ea89e6131 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorWrongClass.kt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorWrongClass.kt @@ -17,8 +17,8 @@ val test3a = EnumClass()Test4() -val test4a = SealedClass() +val test4 = Test4() +val test4a = SealedClass() class Outer { inner class Inner diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorWrongClass.txt b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorWrongClass.txt index 49ad3823820..766cd3606c4 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorWrongClass.txt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorWrongClass.txt @@ -66,7 +66,7 @@ public final class Outer { } public sealed class SealedClass { - private constructor SealedClass() + internal constructor SealedClass() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String @@ -76,3 +76,4 @@ public typealias Test2 = AnnotationClass public typealias Test3 = EnumClass public typealias Test4 = SealedClass public typealias Test5 = Outer.Inner + diff --git a/compiler/testData/diagnostics/tests/valueClasses/basicValueClassDeclarationDisabled.fir.kt b/compiler/testData/diagnostics/tests/valueClasses/basicValueClassDeclarationDisabled.fir.kt index 9a4bc272ef9..dd47c0f0768 100644 --- a/compiler/testData/diagnostics/tests/valueClasses/basicValueClassDeclarationDisabled.fir.kt +++ b/compiler/testData/diagnostics/tests/valueClasses/basicValueClassDeclarationDisabled.fir.kt @@ -1,4 +1,5 @@ // !SKIP_JAVAC +// !API_VERSION: 1.4 // !LANGUAGE: -InlineClasses // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/tests/valueClasses/basicValueClassDeclarationDisabled.kt b/compiler/testData/diagnostics/tests/valueClasses/basicValueClassDeclarationDisabled.kt index fc43d08330e..553616f7713 100644 --- a/compiler/testData/diagnostics/tests/valueClasses/basicValueClassDeclarationDisabled.kt +++ b/compiler/testData/diagnostics/tests/valueClasses/basicValueClassDeclarationDisabled.kt @@ -1,4 +1,5 @@ // !SKIP_JAVAC +// !API_VERSION: 1.4 // !LANGUAGE: -InlineClasses // !DIAGNOSTICS: -UNUSED_PARAMETER @@ -6,11 +7,11 @@ package kotlin.jvm annotation class JvmInline -value class Foo(val x: Int) +value class Foo(val x: Int) value annotation class InlineAnn value object InlineObject value enum class InlineEnum @JvmInline -value class NotVal(x: Int) +value class NotVal(x: Int) diff --git a/compiler/testData/diagnostics/tests/valueClasses/valueClassDeclarationCheck.txt b/compiler/testData/diagnostics/tests/valueClasses/valueClassDeclarationCheck.txt index 61739d5e67b..432311e420f 100644 --- a/compiler/testData/diagnostics/tests/valueClasses/valueClassDeclarationCheck.txt +++ b/compiler/testData/diagnostics/tests/valueClasses/valueClassDeclarationCheck.txt @@ -152,7 +152,7 @@ package kotlin { } public sealed value class D3 { - private constructor D3(/*0*/ x: kotlin.Int) + internal constructor D3(/*0*/ x: kotlin.Int) public final val x: kotlin.Int public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int @@ -177,3 +177,4 @@ package kotlin { } } } + diff --git a/compiler/testData/diagnostics/tests/when/NonExhaustiveWarningForSealedClass.txt b/compiler/testData/diagnostics/tests/when/NonExhaustiveWarningForSealedClass.txt index 41884e0fcb4..7a7ce296cff 100644 --- a/compiler/testData/diagnostics/tests/when/NonExhaustiveWarningForSealedClass.txt +++ b/compiler/testData/diagnostics/tests/when/NonExhaustiveWarningForSealedClass.txt @@ -26,8 +26,9 @@ public object Last : S { } public sealed class S { - private constructor S() + internal constructor S() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } + diff --git a/compiler/testData/diagnostics/tests/when/RedundantElse.txt b/compiler/testData/diagnostics/tests/when/RedundantElse.txt index 263919657b6..70da44887fa 100644 --- a/compiler/testData/diagnostics/tests/when/RedundantElse.txt +++ b/compiler/testData/diagnostics/tests/when/RedundantElse.txt @@ -50,7 +50,7 @@ public final enum class MyEnum : kotlin.Enum { } public sealed class X { - private constructor X() + internal constructor X() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String @@ -69,3 +69,4 @@ public sealed class X { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } } + diff --git a/compiler/testData/diagnostics/tests/when/TopLevelSealed.txt b/compiler/testData/diagnostics/tests/when/TopLevelSealed.txt index 36836d7ba57..888bd637178 100644 --- a/compiler/testData/diagnostics/tests/when/TopLevelSealed.txt +++ b/compiler/testData/diagnostics/tests/when/TopLevelSealed.txt @@ -3,7 +3,7 @@ package public fun test(/*0*/ a: A): kotlin.Unit public sealed class A { - private constructor A() + internal constructor A() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String @@ -29,3 +29,4 @@ public final class D : A { public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } + diff --git a/compiler/testData/diagnostics/tests/when/withSubjectVariable/smartcastToSealed.txt b/compiler/testData/diagnostics/tests/when/withSubjectVariable/smartcastToSealed.txt index d38333c2d27..deebd0be736 100644 --- a/compiler/testData/diagnostics/tests/when/withSubjectVariable/smartcastToSealed.txt +++ b/compiler/testData/diagnostics/tests/when/withSubjectVariable/smartcastToSealed.txt @@ -4,7 +4,7 @@ public fun testSmartcastToSealedInSubjectInitializer1(/*0*/ x: kotlin.Any?): kot public fun testSmartcastToSealedInSubjectInitializer2(/*0*/ x: kotlin.Any?): kotlin.Unit public sealed class Either { - private constructor Either() + internal constructor Either() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String @@ -23,3 +23,4 @@ public final class Right : Either { public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } + diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/allCompatibility/specialization.txt b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/allCompatibility/specialization.txt index 24d71c99ca1..64beffedaa0 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/allCompatibility/specialization.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/jvmDefault/allCompatibility/specialization.txt @@ -120,7 +120,7 @@ private final class Outer { } public sealed class SealedSpecialized : Foo { - private constructor SealedSpecialized() + internal constructor SealedSpecialized() public open override /*1*/ /*fake_override*/ val kotlin.String.prop: kotlin.String public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int @@ -181,3 +181,4 @@ public open class UnspecializedFromDerived : FooDerived { public open override /*1*/ /*fake_override*/ fun test(/*0*/ p: kotlin.String): kotlin.String public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } + diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/performance/kt41644.txt b/compiler/testData/diagnostics/testsWithStdLib/inference/performance/kt41644.txt index 8fc7f0bc599..46c0ad5c342 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/performance/kt41644.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/performance/kt41644.txt @@ -3,13 +3,13 @@ package public fun , /*2*/ B, /*3*/ DB : DataType, /*4*/ C, /*5*/ DC : DataType, /*6*/ D, /*7*/ DD : DataType, /*8*/ E, /*9*/ DE : DataType, /*10*/ F, /*11*/ DF : DataType, /*12*/ G, /*13*/ DG : DataType, /*14*/ H, /*15*/ DH : DataType> either8(/*0*/ firstName: kotlin.String, /*1*/ firstType: DA, /*2*/ secondName: kotlin.String, /*3*/ secondType: DB, /*4*/ thirdName: kotlin.String, /*5*/ thirdType: DC, /*6*/ fourthName: kotlin.String, /*7*/ fourthType: DD, /*8*/ fifthName: kotlin.String, /*9*/ fifthType: DE, /*10*/ sixthName: kotlin.String, /*11*/ sixthType: DF, /*12*/ seventhName: kotlin.String, /*13*/ seventhType: DG, /*14*/ eighthName: kotlin.String, /*15*/ eighthType: DH): DataType.NotNull.Partial> public sealed class DataType { - private constructor DataType() + internal constructor DataType() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String public sealed class NotNull : DataType { - private constructor NotNull() + internal constructor NotNull() public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String @@ -50,3 +50,4 @@ public final class Tuple8, /*2*/ B, /*3*/ DB : D public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } + diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/performance/kt42195.txt b/compiler/testData/diagnostics/testsWithStdLib/inference/performance/kt42195.txt index 2655dbd7a0b..f6134461709 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/performance/kt42195.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/performance/kt42195.txt @@ -3,7 +3,7 @@ package public val tree: Tree.Inner public sealed class Tree { - private constructor Tree() + internal constructor Tree() public abstract val children: kotlin.collections.Map> public abstract val value: TCommon public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean @@ -37,3 +37,4 @@ public sealed class Tree Date: Wed, 13 Jan 2021 12:01:57 +0300 Subject: [PATCH 102/212] Introduce ApiVersion.KOTLIN_1_5 --- compiler/util/src/org/jetbrains/kotlin/config/ApiVersion.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compiler/util/src/org/jetbrains/kotlin/config/ApiVersion.kt b/compiler/util/src/org/jetbrains/kotlin/config/ApiVersion.kt index 6ebede19b11..d561b503d7b 100644 --- a/compiler/util/src/org/jetbrains/kotlin/config/ApiVersion.kt +++ b/compiler/util/src/org/jetbrains/kotlin/config/ApiVersion.kt @@ -55,6 +55,9 @@ class ApiVersion private constructor( @JvmField val KOTLIN_1_4 = createByLanguageVersion(LanguageVersion.KOTLIN_1_4) + @JvmField + val KOTLIN_1_5 = createByLanguageVersion(LanguageVersion.KOTLIN_1_5) + @JvmField val LATEST: ApiVersion = createByLanguageVersion(LanguageVersion.values().last()) From 5122e748c18a7416ce49abc0a5b5a8e44e428fe0 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Wed, 13 Jan 2021 13:53:39 +0300 Subject: [PATCH 103/212] Add workaround for KT-44316 --- .../src/kotlin/reflect/jvm/internal/KPropertyImpl.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/reflection.jvm/src/kotlin/reflect/jvm/internal/KPropertyImpl.kt b/core/reflection.jvm/src/kotlin/reflect/jvm/internal/KPropertyImpl.kt index 8d1525411ac..9c8590b6685 100644 --- a/core/reflection.jvm/src/kotlin/reflect/jvm/internal/KPropertyImpl.kt +++ b/core/reflection.jvm/src/kotlin/reflect/jvm/internal/KPropertyImpl.kt @@ -48,7 +48,7 @@ internal abstract class KPropertyImpl private constructor( override val isBound: Boolean get() = rawBoundReceiver != CallableReference.NO_RECEIVER - private val _javaField = ReflectProperties.lazy { + private val _javaField: ReflectProperties.LazyVal = ReflectProperties.lazy { val jvmSignature = RuntimeTypeMapper.mapPropertySignature(descriptor) when (jvmSignature) { is KotlinProperty -> { From 73e6d422242261dc24bacc7ba268a0cec8d1dcda Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Wed, 13 Jan 2021 14:35:44 +0300 Subject: [PATCH 104/212] [Test] Update CLI tests according to new default language version --- build.gradle.kts | 2 +- .../cli/js/irApiVersionUnsupported.out | 1 + .../cli/js/irLanguageVersionUnsupported.out | 1 + compiler/testData/cli/js/languageVersion.out | 1 + .../abiStabilityUnstableWithOldBackend.args | 4 - .../abiStabilityUnstableWithOldBackend.out | 2 - .../jvm/apiAndLanguageVersionsUnsupported.out | 2 +- compiler/testData/cli/jvm/apiVersion.args | 2 +- compiler/testData/cli/jvm/apiVersion.out | 101 ++++++++++++++++-- .../jvm/apiVersionAndSinceNewerKotlin.args | 2 +- .../cli/jvm/apiVersionAndSinceNewerKotlin.kt | 4 +- .../cli/jvm/apiVersionAndSinceNewerKotlin.out | 6 +- .../cli/jvm/apiVersionGreaterThanLanguage.out | 1 + .../testData/cli/jvm/apiVersionInvalid.out | 2 +- .../jvm/apiVersionLessThanLanguage.argfile | 2 +- .../cli/jvm/apiVersionLessThanLanguage.args | 4 +- .../cli/jvm/apiVersionLessThanLanguage.out | 101 ++++++++++++++++-- ...apiVersionLessThanLanguageUsingArgfile.out | 101 ++++++++++++++++-- .../cli/jvm/apiVersionUnsupported.out | 2 +- .../cli/jvm/argfileWithEscaping.argfile | 2 +- .../testData/cli/jvm/argfileWithEscaping.out | 101 ++++++++++++++++-- .../cli/jvm/classAndFileClassClash.out | 6 +- .../cli/jvm/classAndOtherFileClassClash.out | 6 +- .../testData/cli/jvm/classAndPartClash.out | 6 +- .../testData/cli/jvm/classAndTraitClash.args | 1 + .../cli/jvm/deprecatedApiVersion.args | 2 +- .../testData/cli/jvm/deprecatedApiVersion.out | 2 +- .../jvm/deprecatedLanguageUnsupportedApi.out | 2 +- .../cli/jvm/deprecatedLanguageVersion.args | 2 +- .../cli/jvm/deprecatedLanguageVersion.out | 2 +- .../jvm/fileClassAndMultifileClassClash.out | 7 +- .../cli/jvm/fileClassClashMultipleFiles.out | 6 +- .../internalArgDisableLanguageFeature.args | 4 +- .../jvm/internalArgDisableLanguageFeature.kt | 1 + .../jvm/internalArgDisableLanguageFeature.out | 10 +- .../jvm/internalArgEnableLanguageFeature.args | 4 +- .../jvm/internalArgEnableLanguageFeature.out | 2 +- .../internalArgNoWarningForEnablingBugfix.out | 1 + .../cli/jvm/irApiVersionUnsupported.args | 4 +- .../cli/jvm/irApiVersionUnsupported.out | 3 +- .../cli/jvm/irLanguageVersionUnsupported.args | 2 +- .../cli/jvm/irLanguageVersionUnsupported.out | 3 +- compiler/testData/cli/jvm/irSupported.out | 1 + .../testData/cli/jvm/jvmIrByDefault1_5.out | 1 - compiler/testData/cli/jvm/jvmRecordOk.out | 1 - .../testData/cli/jvm/jvmRecordWrongTarget.out | 1 - compiler/testData/cli/jvm/kt19628_12.args | 5 - compiler/testData/cli/jvm/kt19628_12.kt | 10 -- compiler/testData/cli/jvm/kt19628_12.out | 2 - compiler/testData/cli/jvm/kt19628_13.out | 1 + .../testData/cli/jvm/languageVersion.args | 2 +- compiler/testData/cli/jvm/languageVersion.out | 5 +- .../cli/jvm/languageVersionInvalid.out | 2 +- .../cli/jvm/languageVersionUnsupported.out | 2 +- .../jvm/mixingArgfilesAndUsualArgs.argfile | 2 +- .../cli/jvm/mixingArgfilesAndUsualArgs.out | 101 ++++++++++++++++-- .../testData/cli/jvm/progressiveModeOff.args | 2 +- .../testData/cli/jvm/progressiveModeOff.out | 12 +-- .../jvm/releaseCoroutinesApiVersion1.2.args | 7 -- .../cli/jvm/releaseCoroutinesApiVersion1.2.kt | 13 --- .../jvm/releaseCoroutinesApiVersion1.2.out | 20 ---- .../testData/cli/jvm/sanitized-name.clash.out | 6 +- compiler/testData/cli/jvm/signatureClash.out | 23 ++-- ...AreDisabledExplicitlyWithNewInference.args | 5 - ...sAreDisabledExplicitlyWithNewInference.out | 16 --- .../standaloneSamConversionsBaseline_1_3.out | 1 + ...ticAccessorForPropertiesSignatureClash.out | 60 +++-------- ...icAccessorPropertyAndFunSignatureClash.out | 34 +++--- .../jvm/syntheticAccessorSignatureClash.out | 56 +++++----- ...atWasExperimentalWithoutExplicitImport.out | 1 + ...mentalWithoutExplicitImportCommandLine.out | 1 + ...rationThatWasExperimentalWithoutMarker.out | 1 + .../cli/jvm/variableInWhenSubject.args | 4 +- .../cli/jvm/variableInWhenSubject.out | 2 +- .../kotlin/cli/CliTestGenerated.java | 20 ---- 75 files changed, 616 insertions(+), 324 deletions(-) delete mode 100644 compiler/testData/cli/jvm/abiStabilityUnstableWithOldBackend.args delete mode 100644 compiler/testData/cli/jvm/abiStabilityUnstableWithOldBackend.out create mode 100644 compiler/testData/cli/jvm/internalArgDisableLanguageFeature.kt delete mode 100644 compiler/testData/cli/jvm/kt19628_12.args delete mode 100644 compiler/testData/cli/jvm/kt19628_12.kt delete mode 100644 compiler/testData/cli/jvm/kt19628_12.out delete mode 100644 compiler/testData/cli/jvm/releaseCoroutinesApiVersion1.2.args delete mode 100644 compiler/testData/cli/jvm/releaseCoroutinesApiVersion1.2.kt delete mode 100644 compiler/testData/cli/jvm/releaseCoroutinesApiVersion1.2.out delete mode 100644 compiler/testData/cli/jvm/standaloneSamConversionsAreDisabledExplicitlyWithNewInference.args delete mode 100644 compiler/testData/cli/jvm/standaloneSamConversionsAreDisabledExplicitlyWithNewInference.out diff --git a/build.gradle.kts b/build.gradle.kts index 7deaf9ab474..ab24ecc1260 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -74,7 +74,7 @@ val kotlinVersion by extra( } ?: buildNumber ) -val kotlinLanguageVersion by extra("1.4") +val kotlinLanguageVersion by extra("1.5") allprojects { group = "org.jetbrains.kotlin" diff --git a/compiler/testData/cli/js/irApiVersionUnsupported.out b/compiler/testData/cli/js/irApiVersionUnsupported.out index b55e747994d..3d24845a16a 100644 --- a/compiler/testData/cli/js/irApiVersionUnsupported.out +++ b/compiler/testData/cli/js/irApiVersionUnsupported.out @@ -1,2 +1,3 @@ +warning: API version 1.3 is deprecated and its support will be removed in a future version of Kotlin error: IR backend cannot be used with language or API version below 1.4 COMPILATION_ERROR diff --git a/compiler/testData/cli/js/irLanguageVersionUnsupported.out b/compiler/testData/cli/js/irLanguageVersionUnsupported.out index b55e747994d..1aaec27e5df 100644 --- a/compiler/testData/cli/js/irLanguageVersionUnsupported.out +++ b/compiler/testData/cli/js/irLanguageVersionUnsupported.out @@ -1,2 +1,3 @@ +warning: language version 1.3 is deprecated and its support will be removed in a future version of Kotlin error: IR backend cannot be used with language or API version below 1.4 COMPILATION_ERROR diff --git a/compiler/testData/cli/js/languageVersion.out b/compiler/testData/cli/js/languageVersion.out index 11d240d323d..4414801d4cf 100644 --- a/compiler/testData/cli/js/languageVersion.out +++ b/compiler/testData/cli/js/languageVersion.out @@ -1,3 +1,4 @@ +warning: language version 1.3 is deprecated and its support will be removed in a future version of Kotlin compiler/testData/cli/js/languageVersion.kt:6:21: error: 'break' and 'continue' are not allowed in 'when' statements. Consider using labels to continue/break from the outer loop true -> break ^ diff --git a/compiler/testData/cli/jvm/abiStabilityUnstableWithOldBackend.args b/compiler/testData/cli/jvm/abiStabilityUnstableWithOldBackend.args deleted file mode 100644 index 3d0218fd1c3..00000000000 --- a/compiler/testData/cli/jvm/abiStabilityUnstableWithOldBackend.args +++ /dev/null @@ -1,4 +0,0 @@ -$TESTDATA_DIR$/simple.kt --d -$TEMP_DIR$ --Xabi-stability=unstable diff --git a/compiler/testData/cli/jvm/abiStabilityUnstableWithOldBackend.out b/compiler/testData/cli/jvm/abiStabilityUnstableWithOldBackend.out deleted file mode 100644 index 4383a3f6de4..00000000000 --- a/compiler/testData/cli/jvm/abiStabilityUnstableWithOldBackend.out +++ /dev/null @@ -1,2 +0,0 @@ -error: -Xabi-stability=unstable is not supported in the old JVM backend -COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/apiAndLanguageVersionsUnsupported.out b/compiler/testData/cli/jvm/apiAndLanguageVersionsUnsupported.out index 3865fd31ea8..58a0033b730 100644 --- a/compiler/testData/cli/jvm/apiAndLanguageVersionsUnsupported.out +++ b/compiler/testData/cli/jvm/apiAndLanguageVersionsUnsupported.out @@ -1,2 +1,2 @@ -error: language version 1.1 is no longer supported; please, use version 1.2 or greater. +error: language version 1.1 is no longer supported; please, use version 1.3 or greater. COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/apiVersion.args b/compiler/testData/cli/jvm/apiVersion.args index be2fe08ada2..404c9b50959 100644 --- a/compiler/testData/cli/jvm/apiVersion.args +++ b/compiler/testData/cli/jvm/apiVersion.args @@ -2,4 +2,4 @@ $TESTDATA_DIR$/apiVersion.kt -d $TEMP_DIR$ -api-version -1.2 +1.3 diff --git a/compiler/testData/cli/jvm/apiVersion.out b/compiler/testData/cli/jvm/apiVersion.out index dfbbdc6df42..6a8dab0a7c0 100644 --- a/compiler/testData/cli/jvm/apiVersion.out +++ b/compiler/testData/cli/jvm/apiVersion.out @@ -1,8 +1,95 @@ -warning: API version 1.2 is deprecated and its support will be removed in a future version of Kotlin -compiler/testData/cli/jvm/apiVersion.kt:11:20: error: the feature "function types with big arity" is only available since API version 1.3 -fun test(vararg x: Function30<*, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, Unit>) { - ^ -compiler/testData/cli/jvm/apiVersion.kt:12:9: error: the feature "function types with big arity" is only available since API version 1.3 - bar(::foo) +warning: API version 1.3 is deprecated and its support will be removed in a future version of Kotlin +compiler/testData/cli/jvm/apiVersion.kt:4:5: warning: parameter 'p00' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:13: warning: parameter 'p01' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:21: warning: parameter 'p02' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:29: warning: parameter 'p03' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:37: warning: parameter 'p04' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:45: warning: parameter 'p05' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:53: warning: parameter 'p06' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:61: warning: parameter 'p07' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:69: warning: parameter 'p08' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:77: warning: parameter 'p09' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:5: warning: parameter 'p10' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:13: warning: parameter 'p11' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:21: warning: parameter 'p12' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:29: warning: parameter 'p13' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:37: warning: parameter 'p14' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:45: warning: parameter 'p15' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:53: warning: parameter 'p16' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:61: warning: parameter 'p17' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:69: warning: parameter 'p18' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:77: warning: parameter 'p19' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:5: warning: parameter 'p20' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:13: warning: parameter 'p21' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:21: warning: parameter 'p22' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:29: warning: parameter 'p23' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:37: warning: parameter 'p24' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:45: warning: parameter 'p25' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:53: warning: parameter 'p26' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:61: warning: parameter 'p27' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:69: warning: parameter 'p28' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:77: warning: parameter 'p29' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:9:9: warning: parameter 'x' is never used +fun bar(x: Any) {} ^ -COMPILATION_ERROR +OK diff --git a/compiler/testData/cli/jvm/apiVersionAndSinceNewerKotlin.args b/compiler/testData/cli/jvm/apiVersionAndSinceNewerKotlin.args index 230810fe312..4ac04500264 100644 --- a/compiler/testData/cli/jvm/apiVersionAndSinceNewerKotlin.args +++ b/compiler/testData/cli/jvm/apiVersionAndSinceNewerKotlin.args @@ -2,4 +2,4 @@ $TESTDATA_DIR$/apiVersionAndSinceNewerKotlin.kt -d $TEMP_DIR$ -api-version -1.2 +1.3 diff --git a/compiler/testData/cli/jvm/apiVersionAndSinceNewerKotlin.kt b/compiler/testData/cli/jvm/apiVersionAndSinceNewerKotlin.kt index f5186d4e0f1..0154fa922ba 100644 --- a/compiler/testData/cli/jvm/apiVersionAndSinceNewerKotlin.kt +++ b/compiler/testData/cli/jvm/apiVersionAndSinceNewerKotlin.kt @@ -1,5 +1,5 @@ -@SinceKotlin("1.2") +@SinceKotlin("1.3") fun old() {} -@SinceKotlin("1.3") +@SinceKotlin("1.4") fun new() {} diff --git a/compiler/testData/cli/jvm/apiVersionAndSinceNewerKotlin.out b/compiler/testData/cli/jvm/apiVersionAndSinceNewerKotlin.out index 03b29a8f588..d4b8817fca4 100644 --- a/compiler/testData/cli/jvm/apiVersionAndSinceNewerKotlin.out +++ b/compiler/testData/cli/jvm/apiVersionAndSinceNewerKotlin.out @@ -1,5 +1,5 @@ -warning: API version 1.2 is deprecated and its support will be removed in a future version of Kotlin -compiler/testData/cli/jvm/apiVersionAndSinceNewerKotlin.kt:4:1: warning: the version is greater than the specified API version 1.2 -@SinceKotlin("1.3") +warning: API version 1.3 is deprecated and its support will be removed in a future version of Kotlin +compiler/testData/cli/jvm/apiVersionAndSinceNewerKotlin.kt:4:1: warning: the version is greater than the specified API version 1.3 +@SinceKotlin("1.4") ^ OK diff --git a/compiler/testData/cli/jvm/apiVersionGreaterThanLanguage.out b/compiler/testData/cli/jvm/apiVersionGreaterThanLanguage.out index a41ca754b6d..b75e3a994ea 100644 --- a/compiler/testData/cli/jvm/apiVersionGreaterThanLanguage.out +++ b/compiler/testData/cli/jvm/apiVersionGreaterThanLanguage.out @@ -1,2 +1,3 @@ error: -api-version (1.4) cannot be greater than -language-version (1.3) +warning: language version 1.3 is deprecated and its support will be removed in a future version of Kotlin COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/apiVersionInvalid.out b/compiler/testData/cli/jvm/apiVersionInvalid.out index cd148e4175f..78dcfeeec87 100644 --- a/compiler/testData/cli/jvm/apiVersionInvalid.out +++ b/compiler/testData/cli/jvm/apiVersionInvalid.out @@ -1,3 +1,3 @@ error: unknown API version: 239.42 -Supported API versions: 1.2 (DEPRECATED), 1.3, 1.4, 1.5 (EXPERIMENTAL), 1.6 (EXPERIMENTAL) +Supported API versions: 1.3 (DEPRECATED), 1.4, 1.5, 1.6 (EXPERIMENTAL) COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/apiVersionLessThanLanguage.argfile b/compiler/testData/cli/jvm/apiVersionLessThanLanguage.argfile index 93af1fd5987..4d4b695158b 100644 --- a/compiler/testData/cli/jvm/apiVersionLessThanLanguage.argfile +++ b/compiler/testData/cli/jvm/apiVersionLessThanLanguage.argfile @@ -1 +1 @@ -$TESTDATA_DIR$/apiVersion.kt -d $TEMP_DIR$ -api-version 1.2 -language-version 1.3 +$TESTDATA_DIR$/apiVersion.kt -d $TEMP_DIR$ -api-version 1.3 -language-version 1.4 diff --git a/compiler/testData/cli/jvm/apiVersionLessThanLanguage.args b/compiler/testData/cli/jvm/apiVersionLessThanLanguage.args index 29ebce58cea..af95ae6168f 100644 --- a/compiler/testData/cli/jvm/apiVersionLessThanLanguage.args +++ b/compiler/testData/cli/jvm/apiVersionLessThanLanguage.args @@ -2,6 +2,6 @@ $TESTDATA_DIR$/apiVersion.kt -d $TEMP_DIR$ -api-version -1.2 --language-version 1.3 +-language-version +1.4 diff --git a/compiler/testData/cli/jvm/apiVersionLessThanLanguage.out b/compiler/testData/cli/jvm/apiVersionLessThanLanguage.out index dfbbdc6df42..6a8dab0a7c0 100644 --- a/compiler/testData/cli/jvm/apiVersionLessThanLanguage.out +++ b/compiler/testData/cli/jvm/apiVersionLessThanLanguage.out @@ -1,8 +1,95 @@ -warning: API version 1.2 is deprecated and its support will be removed in a future version of Kotlin -compiler/testData/cli/jvm/apiVersion.kt:11:20: error: the feature "function types with big arity" is only available since API version 1.3 -fun test(vararg x: Function30<*, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, Unit>) { - ^ -compiler/testData/cli/jvm/apiVersion.kt:12:9: error: the feature "function types with big arity" is only available since API version 1.3 - bar(::foo) +warning: API version 1.3 is deprecated and its support will be removed in a future version of Kotlin +compiler/testData/cli/jvm/apiVersion.kt:4:5: warning: parameter 'p00' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:13: warning: parameter 'p01' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:21: warning: parameter 'p02' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:29: warning: parameter 'p03' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:37: warning: parameter 'p04' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:45: warning: parameter 'p05' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:53: warning: parameter 'p06' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:61: warning: parameter 'p07' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:69: warning: parameter 'p08' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:77: warning: parameter 'p09' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:5: warning: parameter 'p10' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:13: warning: parameter 'p11' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:21: warning: parameter 'p12' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:29: warning: parameter 'p13' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:37: warning: parameter 'p14' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:45: warning: parameter 'p15' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:53: warning: parameter 'p16' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:61: warning: parameter 'p17' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:69: warning: parameter 'p18' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:77: warning: parameter 'p19' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:5: warning: parameter 'p20' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:13: warning: parameter 'p21' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:21: warning: parameter 'p22' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:29: warning: parameter 'p23' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:37: warning: parameter 'p24' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:45: warning: parameter 'p25' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:53: warning: parameter 'p26' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:61: warning: parameter 'p27' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:69: warning: parameter 'p28' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:77: warning: parameter 'p29' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:9:9: warning: parameter 'x' is never used +fun bar(x: Any) {} ^ -COMPILATION_ERROR +OK diff --git a/compiler/testData/cli/jvm/apiVersionLessThanLanguageUsingArgfile.out b/compiler/testData/cli/jvm/apiVersionLessThanLanguageUsingArgfile.out index dfbbdc6df42..6a8dab0a7c0 100644 --- a/compiler/testData/cli/jvm/apiVersionLessThanLanguageUsingArgfile.out +++ b/compiler/testData/cli/jvm/apiVersionLessThanLanguageUsingArgfile.out @@ -1,8 +1,95 @@ -warning: API version 1.2 is deprecated and its support will be removed in a future version of Kotlin -compiler/testData/cli/jvm/apiVersion.kt:11:20: error: the feature "function types with big arity" is only available since API version 1.3 -fun test(vararg x: Function30<*, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, Unit>) { - ^ -compiler/testData/cli/jvm/apiVersion.kt:12:9: error: the feature "function types with big arity" is only available since API version 1.3 - bar(::foo) +warning: API version 1.3 is deprecated and its support will be removed in a future version of Kotlin +compiler/testData/cli/jvm/apiVersion.kt:4:5: warning: parameter 'p00' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:13: warning: parameter 'p01' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:21: warning: parameter 'p02' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:29: warning: parameter 'p03' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:37: warning: parameter 'p04' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:45: warning: parameter 'p05' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:53: warning: parameter 'p06' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:61: warning: parameter 'p07' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:69: warning: parameter 'p08' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:77: warning: parameter 'p09' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:5: warning: parameter 'p10' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:13: warning: parameter 'p11' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:21: warning: parameter 'p12' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:29: warning: parameter 'p13' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:37: warning: parameter 'p14' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:45: warning: parameter 'p15' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:53: warning: parameter 'p16' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:61: warning: parameter 'p17' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:69: warning: parameter 'p18' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:77: warning: parameter 'p19' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:5: warning: parameter 'p20' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:13: warning: parameter 'p21' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:21: warning: parameter 'p22' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:29: warning: parameter 'p23' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:37: warning: parameter 'p24' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:45: warning: parameter 'p25' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:53: warning: parameter 'p26' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:61: warning: parameter 'p27' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:69: warning: parameter 'p28' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:77: warning: parameter 'p29' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:9:9: warning: parameter 'x' is never used +fun bar(x: Any) {} ^ -COMPILATION_ERROR +OK diff --git a/compiler/testData/cli/jvm/apiVersionUnsupported.out b/compiler/testData/cli/jvm/apiVersionUnsupported.out index 3c2296a1edd..fefaea7f7bc 100644 --- a/compiler/testData/cli/jvm/apiVersionUnsupported.out +++ b/compiler/testData/cli/jvm/apiVersionUnsupported.out @@ -1,2 +1,2 @@ -error: API version 1.1 is no longer supported; please, use version 1.2 or greater. +error: API version 1.1 is no longer supported; please, use version 1.3 or greater. COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/argfileWithEscaping.argfile b/compiler/testData/cli/jvm/argfileWithEscaping.argfile index 4eca3c7fec4..5be4a50a0b8 100644 --- a/compiler/testData/cli/jvm/argfileWithEscaping.argfile +++ b/compiler/testData/cli/jvm/argfileWithEscaping.argfile @@ -2,4 +2,4 @@ -X'single \" quote " escaped \' sequence \\' $TESTDATA_DIR$/apiVersion.kt -d -$TEMP_DIR$ -api-version 1.2 -language-version 1.3 +$TEMP_DIR$ -api-version 1.3 -language-version 1.4 diff --git a/compiler/testData/cli/jvm/argfileWithEscaping.out b/compiler/testData/cli/jvm/argfileWithEscaping.out index 221c87d086c..22f55863f57 100644 --- a/compiler/testData/cli/jvm/argfileWithEscaping.out +++ b/compiler/testData/cli/jvm/argfileWithEscaping.out @@ -1,10 +1,97 @@ warning: flag is not supported by this version of the compiler: -Xdouble ' quote ' escaped " sequence / warning: flag is not supported by this version of the compiler: -Xsingle " quote " escaped ' sequence / -warning: API version 1.2 is deprecated and its support will be removed in a future version of Kotlin -compiler/testData/cli/jvm/apiVersion.kt:11:20: error: the feature "function types with big arity" is only available since API version 1.3 -fun test(vararg x: Function30<*, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, Unit>) { - ^ -compiler/testData/cli/jvm/apiVersion.kt:12:9: error: the feature "function types with big arity" is only available since API version 1.3 - bar(::foo) +warning: API version 1.3 is deprecated and its support will be removed in a future version of Kotlin +compiler/testData/cli/jvm/apiVersion.kt:4:5: warning: parameter 'p00' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:13: warning: parameter 'p01' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:21: warning: parameter 'p02' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:29: warning: parameter 'p03' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:37: warning: parameter 'p04' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:45: warning: parameter 'p05' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:53: warning: parameter 'p06' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:61: warning: parameter 'p07' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:69: warning: parameter 'p08' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:77: warning: parameter 'p09' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:5: warning: parameter 'p10' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:13: warning: parameter 'p11' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:21: warning: parameter 'p12' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:29: warning: parameter 'p13' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:37: warning: parameter 'p14' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:45: warning: parameter 'p15' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:53: warning: parameter 'p16' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:61: warning: parameter 'p17' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:69: warning: parameter 'p18' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:77: warning: parameter 'p19' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:5: warning: parameter 'p20' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:13: warning: parameter 'p21' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:21: warning: parameter 'p22' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:29: warning: parameter 'p23' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:37: warning: parameter 'p24' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:45: warning: parameter 'p25' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:53: warning: parameter 'p26' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:61: warning: parameter 'p27' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:69: warning: parameter 'p28' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:77: warning: parameter 'p29' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:9:9: warning: parameter 'x' is never used +fun bar(x: Any) {} ^ -COMPILATION_ERROR +OK diff --git a/compiler/testData/cli/jvm/classAndFileClassClash.out b/compiler/testData/cli/jvm/classAndFileClassClash.out index d4619b71659..987019e90b6 100644 --- a/compiler/testData/cli/jvm/classAndFileClassClash.out +++ b/compiler/testData/cli/jvm/classAndFileClassClash.out @@ -1,7 +1,7 @@ -compiler/testData/cli/jvm/classAndFileClassClash.kt:1:1: error: duplicate JVM class name 'test/Foo' generated from: package-fragment test, Foo +compiler/testData/cli/jvm/classAndFileClassClash.kt:1:1: error: duplicate JVM class name 'test/Foo' generated from: Foo, Foo @file:JvmName("Foo") ^ -compiler/testData/cli/jvm/classAndFileClassClash.kt:6:1: error: duplicate JVM class name 'test/Foo' generated from: package-fragment test, Foo +compiler/testData/cli/jvm/classAndFileClassClash.kt:6:1: error: duplicate JVM class name 'test/Foo' generated from: Foo, Foo class Foo {} ^ -COMPILATION_ERROR \ No newline at end of file +COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/classAndOtherFileClassClash.out b/compiler/testData/cli/jvm/classAndOtherFileClassClash.out index e232f41cfba..461d0e939f8 100644 --- a/compiler/testData/cli/jvm/classAndOtherFileClassClash.out +++ b/compiler/testData/cli/jvm/classAndOtherFileClassClash.out @@ -1,7 +1,7 @@ -compiler/testData/cli/jvm/classAndOtherFileClassClash1.kt:1:1: error: duplicate JVM class name 'test/Foo' generated from: Foo, package-fragment test +compiler/testData/cli/jvm/classAndOtherFileClassClash1.kt:1:1: error: duplicate JVM class name 'test/Foo' generated from: Foo, Foo @file:JvmName("Foo") ^ -compiler/testData/cli/jvm/classAndOtherFileClassClash2.kt:3:1: error: duplicate JVM class name 'test/Foo' generated from: Foo, package-fragment test +compiler/testData/cli/jvm/classAndOtherFileClassClash2.kt:3:1: error: duplicate JVM class name 'test/Foo' generated from: Foo, Foo class Foo ^ -COMPILATION_ERROR \ No newline at end of file +COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/classAndPartClash.out b/compiler/testData/cli/jvm/classAndPartClash.out index d1cfe7b2bad..059073ec43b 100644 --- a/compiler/testData/cli/jvm/classAndPartClash.out +++ b/compiler/testData/cli/jvm/classAndPartClash.out @@ -1,7 +1,7 @@ -compiler/testData/cli/jvm/classAndPartClash.kt:1:1: error: duplicate JVM class name 'test/ClassAndPartClashKt' generated from: package-fragment test, ClassAndPartClashKt +compiler/testData/cli/jvm/classAndPartClash.kt:1:1: error: duplicate JVM class name 'test/ClassAndPartClashKt' generated from: ClassAndPartClashKt, ClassAndPartClashKt package test ^ -compiler/testData/cli/jvm/classAndPartClash.kt:5:1: error: duplicate JVM class name 'test/ClassAndPartClashKt' generated from: package-fragment test, ClassAndPartClashKt +compiler/testData/cli/jvm/classAndPartClash.kt:5:1: error: duplicate JVM class name 'test/ClassAndPartClashKt' generated from: ClassAndPartClashKt, ClassAndPartClashKt class ClassAndPartClashKt ^ -COMPILATION_ERROR \ No newline at end of file +COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/classAndTraitClash.args b/compiler/testData/cli/jvm/classAndTraitClash.args index 725b9b150d7..a5a7cfcb7f4 100644 --- a/compiler/testData/cli/jvm/classAndTraitClash.args +++ b/compiler/testData/cli/jvm/classAndTraitClash.args @@ -1,3 +1,4 @@ $TESTDATA_DIR$/classAndTraitClash.kt -d $TEMP_DIR$ +-Xuse-old-backend diff --git a/compiler/testData/cli/jvm/deprecatedApiVersion.args b/compiler/testData/cli/jvm/deprecatedApiVersion.args index 69558a4e07d..3797012d319 100644 --- a/compiler/testData/cli/jvm/deprecatedApiVersion.args +++ b/compiler/testData/cli/jvm/deprecatedApiVersion.args @@ -2,4 +2,4 @@ $TESTDATA_DIR$/simple.kt -d $TEMP_DIR$ -api-version -1.2 +1.3 diff --git a/compiler/testData/cli/jvm/deprecatedApiVersion.out b/compiler/testData/cli/jvm/deprecatedApiVersion.out index 99993437fbd..f5a5aee1ea3 100644 --- a/compiler/testData/cli/jvm/deprecatedApiVersion.out +++ b/compiler/testData/cli/jvm/deprecatedApiVersion.out @@ -1,2 +1,2 @@ -warning: API version 1.2 is deprecated and its support will be removed in a future version of Kotlin +warning: API version 1.3 is deprecated and its support will be removed in a future version of Kotlin OK diff --git a/compiler/testData/cli/jvm/deprecatedLanguageUnsupportedApi.out b/compiler/testData/cli/jvm/deprecatedLanguageUnsupportedApi.out index 3c2296a1edd..8a2d8464d6e 100644 --- a/compiler/testData/cli/jvm/deprecatedLanguageUnsupportedApi.out +++ b/compiler/testData/cli/jvm/deprecatedLanguageUnsupportedApi.out @@ -1,2 +1,2 @@ -error: API version 1.1 is no longer supported; please, use version 1.2 or greater. +error: language version 1.2 is no longer supported; please, use version 1.3 or greater. COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/deprecatedLanguageVersion.args b/compiler/testData/cli/jvm/deprecatedLanguageVersion.args index d64e4c7b5cc..fa86087583c 100644 --- a/compiler/testData/cli/jvm/deprecatedLanguageVersion.args +++ b/compiler/testData/cli/jvm/deprecatedLanguageVersion.args @@ -2,4 +2,4 @@ $TESTDATA_DIR$/simple.kt -d $TEMP_DIR$ -language-version -1.2 +1.3 diff --git a/compiler/testData/cli/jvm/deprecatedLanguageVersion.out b/compiler/testData/cli/jvm/deprecatedLanguageVersion.out index 7d53695d487..ae74f0da431 100644 --- a/compiler/testData/cli/jvm/deprecatedLanguageVersion.out +++ b/compiler/testData/cli/jvm/deprecatedLanguageVersion.out @@ -1,2 +1,2 @@ -warning: language version 1.2 is deprecated and its support will be removed in a future version of Kotlin +warning: language version 1.3 is deprecated and its support will be removed in a future version of Kotlin OK diff --git a/compiler/testData/cli/jvm/fileClassAndMultifileClassClash.out b/compiler/testData/cli/jvm/fileClassAndMultifileClassClash.out index 20bc3ae1978..194828b65b5 100644 --- a/compiler/testData/cli/jvm/fileClassAndMultifileClassClash.out +++ b/compiler/testData/cli/jvm/fileClassAndMultifileClassClash.out @@ -1,7 +1,4 @@ -compiler/testData/cli/jvm/fileClassAndMultifileClassClash1.kt:1:1: error: duplicate JVM class name 'test/Util' generated from: package-fragment test, package-fragment test +compiler/testData/cli/jvm/fileClassAndMultifileClassClash1.kt:1:1: error: duplicate JVM class name 'test/Util' generated from: Util, Util @file:JvmName("Util") ^ -compiler/testData/cli/jvm/fileClassAndMultifileClassClash2.kt:1:1: error: duplicate JVM class name 'test/Util' generated from: package-fragment test, package-fragment test -@file:JvmName("Util") -^ -COMPILATION_ERROR \ No newline at end of file +COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/fileClassClashMultipleFiles.out b/compiler/testData/cli/jvm/fileClassClashMultipleFiles.out index 982ea3b5a52..4aa58d5e670 100644 --- a/compiler/testData/cli/jvm/fileClassClashMultipleFiles.out +++ b/compiler/testData/cli/jvm/fileClassClashMultipleFiles.out @@ -1,7 +1,7 @@ -compiler/testData/cli/jvm/fileClassClashMultipleFiles1.kt:1:1: error: duplicate JVM class name 'test/Util' generated from: package-fragment test, package-fragment test +compiler/testData/cli/jvm/fileClassClashMultipleFiles1.kt:1:1: error: duplicate JVM class name 'test/Util' generated from: Util, Util @file:JvmName("Util") ^ -compiler/testData/cli/jvm/fileClassClashMultipleFiles2.kt:1:1: error: duplicate JVM class name 'test/Util' generated from: package-fragment test, package-fragment test +compiler/testData/cli/jvm/fileClassClashMultipleFiles2.kt:1:1: error: duplicate JVM class name 'test/Util' generated from: Util, Util @file:JvmName("Util") ^ -COMPILATION_ERROR \ No newline at end of file +COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/internalArgDisableLanguageFeature.args b/compiler/testData/cli/jvm/internalArgDisableLanguageFeature.args index 55c6c5be4c4..5c91abf4594 100644 --- a/compiler/testData/cli/jvm/internalArgDisableLanguageFeature.args +++ b/compiler/testData/cli/jvm/internalArgDisableLanguageFeature.args @@ -1,4 +1,4 @@ -$TESTDATA_DIR$/legacySmartCastsAfterTry.kt +$TESTDATA_DIR$/internalArgDisableLanguageFeature.kt -d $TEMP_DIR$ --XXLanguage\:-SoundSmartCastsAfterTry \ No newline at end of file +-XXLanguage\:-SealedInterfaces diff --git a/compiler/testData/cli/jvm/internalArgDisableLanguageFeature.kt b/compiler/testData/cli/jvm/internalArgDisableLanguageFeature.kt new file mode 100644 index 00000000000..a5c74a3f568 --- /dev/null +++ b/compiler/testData/cli/jvm/internalArgDisableLanguageFeature.kt @@ -0,0 +1 @@ +sealed interface A diff --git a/compiler/testData/cli/jvm/internalArgDisableLanguageFeature.out b/compiler/testData/cli/jvm/internalArgDisableLanguageFeature.out index 91e4fcf215b..a3fd0e1c992 100644 --- a/compiler/testData/cli/jvm/internalArgDisableLanguageFeature.out +++ b/compiler/testData/cli/jvm/internalArgDisableLanguageFeature.out @@ -1,13 +1,13 @@ warning: ATTENTION! This build uses unsafe internal compiler arguments: --XXLanguage:-SoundSmartCastsAfterTry +-XXLanguage:-SealedInterfaces This mode is not recommended for production use, as no stability/compatibility guarantees are given on compiler or generated code. Use it at your own risk! -compiler/testData/cli/jvm/legacySmartCastsAfterTry.kt:2:25: warning: variable 'some' initializer is redundant - var some: String? = null - ^ -OK +compiler/testData/cli/jvm/internalArgDisableLanguageFeature.kt:1:1: error: modifier 'sealed' is not applicable to 'interface' +sealed interface A +^ +COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/internalArgEnableLanguageFeature.args b/compiler/testData/cli/jvm/internalArgEnableLanguageFeature.args index ca111f84f4e..822c33b4864 100644 --- a/compiler/testData/cli/jvm/internalArgEnableLanguageFeature.args +++ b/compiler/testData/cli/jvm/internalArgEnableLanguageFeature.args @@ -2,5 +2,5 @@ $TESTDATA_DIR$/variableInWhenSubject.kt -d $TEMP_DIR$ -language-version -1.2 --XXLanguage\:+VariableDeclarationInWhenSubject \ No newline at end of file +1.3 +-XXLanguage\:+VariableDeclarationInWhenSubject diff --git a/compiler/testData/cli/jvm/internalArgEnableLanguageFeature.out b/compiler/testData/cli/jvm/internalArgEnableLanguageFeature.out index 4fbe65494dc..f5e17f06e11 100644 --- a/compiler/testData/cli/jvm/internalArgEnableLanguageFeature.out +++ b/compiler/testData/cli/jvm/internalArgEnableLanguageFeature.out @@ -7,5 +7,5 @@ This mode is not recommended for production use, as no stability/compatibility guarantees are given on compiler or generated code. Use it at your own risk! -warning: language version 1.2 is deprecated and its support will be removed in a future version of Kotlin +warning: language version 1.3 is deprecated and its support will be removed in a future version of Kotlin OK diff --git a/compiler/testData/cli/jvm/internalArgNoWarningForEnablingBugfix.out b/compiler/testData/cli/jvm/internalArgNoWarningForEnablingBugfix.out index d86bac9de59..ae74f0da431 100644 --- a/compiler/testData/cli/jvm/internalArgNoWarningForEnablingBugfix.out +++ b/compiler/testData/cli/jvm/internalArgNoWarningForEnablingBugfix.out @@ -1 +1,2 @@ +warning: language version 1.3 is deprecated and its support will be removed in a future version of Kotlin OK diff --git a/compiler/testData/cli/jvm/irApiVersionUnsupported.args b/compiler/testData/cli/jvm/irApiVersionUnsupported.args index 07d5b8b2c85..ebfd56ee9dc 100644 --- a/compiler/testData/cli/jvm/irApiVersionUnsupported.args +++ b/compiler/testData/cli/jvm/irApiVersionUnsupported.args @@ -2,7 +2,7 @@ $TESTDATA_DIR$/simple.kt -d $TEMP_DIR$ -language-version -1.3 +1.4 -api-version -1.2 +1.3 -Xuse-ir diff --git a/compiler/testData/cli/jvm/irApiVersionUnsupported.out b/compiler/testData/cli/jvm/irApiVersionUnsupported.out index 50862059811..f5a5aee1ea3 100644 --- a/compiler/testData/cli/jvm/irApiVersionUnsupported.out +++ b/compiler/testData/cli/jvm/irApiVersionUnsupported.out @@ -1,3 +1,2 @@ -warning: API version 1.2 is deprecated and its support will be removed in a future version of Kotlin -warning: IR backend does not support language or API version lower than 1.3. This can lead to unexpected behavior or compilation failures +warning: API version 1.3 is deprecated and its support will be removed in a future version of Kotlin OK diff --git a/compiler/testData/cli/jvm/irLanguageVersionUnsupported.args b/compiler/testData/cli/jvm/irLanguageVersionUnsupported.args index 5fa29a50887..c23b1a7463c 100644 --- a/compiler/testData/cli/jvm/irLanguageVersionUnsupported.args +++ b/compiler/testData/cli/jvm/irLanguageVersionUnsupported.args @@ -2,5 +2,5 @@ $TESTDATA_DIR$/simple.kt -d $TEMP_DIR$ -language-version -1.2 +1.3 -Xuse-ir diff --git a/compiler/testData/cli/jvm/irLanguageVersionUnsupported.out b/compiler/testData/cli/jvm/irLanguageVersionUnsupported.out index 3f22a2135cc..ae74f0da431 100644 --- a/compiler/testData/cli/jvm/irLanguageVersionUnsupported.out +++ b/compiler/testData/cli/jvm/irLanguageVersionUnsupported.out @@ -1,3 +1,2 @@ -warning: language version 1.2 is deprecated and its support will be removed in a future version of Kotlin -warning: IR backend does not support language or API version lower than 1.3. This can lead to unexpected behavior or compilation failures +warning: language version 1.3 is deprecated and its support will be removed in a future version of Kotlin OK diff --git a/compiler/testData/cli/jvm/irSupported.out b/compiler/testData/cli/jvm/irSupported.out index d86bac9de59..ae74f0da431 100644 --- a/compiler/testData/cli/jvm/irSupported.out +++ b/compiler/testData/cli/jvm/irSupported.out @@ -1 +1,2 @@ +warning: language version 1.3 is deprecated and its support will be removed in a future version of Kotlin OK diff --git a/compiler/testData/cli/jvm/jvmIrByDefault1_5.out b/compiler/testData/cli/jvm/jvmIrByDefault1_5.out index 5be61f3d3c9..d86bac9de59 100644 --- a/compiler/testData/cli/jvm/jvmIrByDefault1_5.out +++ b/compiler/testData/cli/jvm/jvmIrByDefault1_5.out @@ -1,2 +1 @@ -warning: language version 1.5 is experimental, there are no backwards compatibility guarantees for new language and library features OK diff --git a/compiler/testData/cli/jvm/jvmRecordOk.out b/compiler/testData/cli/jvm/jvmRecordOk.out index 06702215887..2e80331b53b 100644 --- a/compiler/testData/cli/jvm/jvmRecordOk.out +++ b/compiler/testData/cli/jvm/jvmRecordOk.out @@ -7,6 +7,5 @@ This mode is not recommended for production use, as no stability/compatibility guarantees are given on compiler or generated code. Use it at your own risk! -warning: language version 1.5 is experimental, there are no backwards compatibility guarantees for new language and library features info: using preview Java language features OK diff --git a/compiler/testData/cli/jvm/jvmRecordWrongTarget.out b/compiler/testData/cli/jvm/jvmRecordWrongTarget.out index ecb2e575bc2..99fcd0eba3a 100644 --- a/compiler/testData/cli/jvm/jvmRecordWrongTarget.out +++ b/compiler/testData/cli/jvm/jvmRecordWrongTarget.out @@ -7,7 +7,6 @@ This mode is not recommended for production use, as no stability/compatibility guarantees are given on compiler or generated code. Use it at your own risk! -warning: language version 1.5 is experimental, there are no backwards compatibility guarantees for new language and library features compiler/testData/cli/jvm/jvmRecord.kt:1:1: error: using @JvmRecord is only allowed with -jvm-target 15 and -Xjvm-enable-preview flag enabled @JvmRecord ^ diff --git a/compiler/testData/cli/jvm/kt19628_12.args b/compiler/testData/cli/jvm/kt19628_12.args deleted file mode 100644 index cce5278e6ef..00000000000 --- a/compiler/testData/cli/jvm/kt19628_12.args +++ /dev/null @@ -1,5 +0,0 @@ -$TESTDATA_DIR$/kt19628_12.kt --language-version -1.2 --d -$TEMP_DIR$ \ No newline at end of file diff --git a/compiler/testData/cli/jvm/kt19628_12.kt b/compiler/testData/cli/jvm/kt19628_12.kt deleted file mode 100644 index 0c4067323b2..00000000000 --- a/compiler/testData/cli/jvm/kt19628_12.kt +++ /dev/null @@ -1,10 +0,0 @@ -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter - -@Suppress("ANNOTATION_TARGETS_NON_EXISTENT_ACCESSOR") -class Data( - @get:XmlJavaTypeAdapter(CollapsedStringAdapter::class) - var value: String? -) { - @get:XmlJavaTypeAdapter(CollapsedStringAdapter::class) - private val b: String = "" -} \ No newline at end of file diff --git a/compiler/testData/cli/jvm/kt19628_12.out b/compiler/testData/cli/jvm/kt19628_12.out deleted file mode 100644 index 7d53695d487..00000000000 --- a/compiler/testData/cli/jvm/kt19628_12.out +++ /dev/null @@ -1,2 +0,0 @@ -warning: language version 1.2 is deprecated and its support will be removed in a future version of Kotlin -OK diff --git a/compiler/testData/cli/jvm/kt19628_13.out b/compiler/testData/cli/jvm/kt19628_13.out index d12d4f0b31b..a42779fc389 100644 --- a/compiler/testData/cli/jvm/kt19628_13.out +++ b/compiler/testData/cli/jvm/kt19628_13.out @@ -1,3 +1,4 @@ +warning: language version 1.3 is deprecated and its support will be removed in a future version of Kotlin compiler/testData/cli/jvm/kt19628_13.kt:5:29: error: unresolved reference: CollapsedStringAdapter @get:XmlJavaTypeAdapter(CollapsedStringAdapter::class) ^ diff --git a/compiler/testData/cli/jvm/languageVersion.args b/compiler/testData/cli/jvm/languageVersion.args index 1d9b4e2ce42..fdffb1d1e7b 100644 --- a/compiler/testData/cli/jvm/languageVersion.args +++ b/compiler/testData/cli/jvm/languageVersion.args @@ -2,4 +2,4 @@ $TESTDATA_DIR$/languageVersion.kt -d $TEMP_DIR$ -language-version -1.3 +1.4 diff --git a/compiler/testData/cli/jvm/languageVersion.out b/compiler/testData/cli/jvm/languageVersion.out index f32b75ce232..d86bac9de59 100644 --- a/compiler/testData/cli/jvm/languageVersion.out +++ b/compiler/testData/cli/jvm/languageVersion.out @@ -1,4 +1 @@ -compiler/testData/cli/jvm/languageVersion.kt:6:21: error: 'break' and 'continue' are not allowed in 'when' statements. Consider using labels to continue/break from the outer loop - true -> break - ^ -COMPILATION_ERROR +OK diff --git a/compiler/testData/cli/jvm/languageVersionInvalid.out b/compiler/testData/cli/jvm/languageVersionInvalid.out index 27fe891bb92..1289e703ebf 100644 --- a/compiler/testData/cli/jvm/languageVersionInvalid.out +++ b/compiler/testData/cli/jvm/languageVersionInvalid.out @@ -1,3 +1,3 @@ error: unknown language version: 239.42 -Supported language versions: 1.2 (DEPRECATED), 1.3, 1.4, 1.5 (EXPERIMENTAL), 1.6 (EXPERIMENTAL) +Supported language versions: 1.3 (DEPRECATED), 1.4, 1.5, 1.6 (EXPERIMENTAL) COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/languageVersionUnsupported.out b/compiler/testData/cli/jvm/languageVersionUnsupported.out index 3865fd31ea8..58a0033b730 100644 --- a/compiler/testData/cli/jvm/languageVersionUnsupported.out +++ b/compiler/testData/cli/jvm/languageVersionUnsupported.out @@ -1,2 +1,2 @@ -error: language version 1.1 is no longer supported; please, use version 1.2 or greater. +error: language version 1.1 is no longer supported; please, use version 1.3 or greater. COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/mixingArgfilesAndUsualArgs.argfile b/compiler/testData/cli/jvm/mixingArgfilesAndUsualArgs.argfile index e83861dd435..9c5eaa817d6 100644 --- a/compiler/testData/cli/jvm/mixingArgfilesAndUsualArgs.argfile +++ b/compiler/testData/cli/jvm/mixingArgfilesAndUsualArgs.argfile @@ -1 +1 @@ -$TEMP_DIR$ -api-version 1.2 -language-version 1.3 \ No newline at end of file +$TEMP_DIR$ -api-version 1.3 -language-version 1.4 diff --git a/compiler/testData/cli/jvm/mixingArgfilesAndUsualArgs.out b/compiler/testData/cli/jvm/mixingArgfilesAndUsualArgs.out index dfbbdc6df42..6a8dab0a7c0 100644 --- a/compiler/testData/cli/jvm/mixingArgfilesAndUsualArgs.out +++ b/compiler/testData/cli/jvm/mixingArgfilesAndUsualArgs.out @@ -1,8 +1,95 @@ -warning: API version 1.2 is deprecated and its support will be removed in a future version of Kotlin -compiler/testData/cli/jvm/apiVersion.kt:11:20: error: the feature "function types with big arity" is only available since API version 1.3 -fun test(vararg x: Function30<*, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, Unit>) { - ^ -compiler/testData/cli/jvm/apiVersion.kt:12:9: error: the feature "function types with big arity" is only available since API version 1.3 - bar(::foo) +warning: API version 1.3 is deprecated and its support will be removed in a future version of Kotlin +compiler/testData/cli/jvm/apiVersion.kt:4:5: warning: parameter 'p00' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:13: warning: parameter 'p01' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:21: warning: parameter 'p02' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:29: warning: parameter 'p03' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:37: warning: parameter 'p04' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:45: warning: parameter 'p05' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:53: warning: parameter 'p06' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:61: warning: parameter 'p07' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:69: warning: parameter 'p08' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:4:77: warning: parameter 'p09' is never used + p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:5: warning: parameter 'p10' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:13: warning: parameter 'p11' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:21: warning: parameter 'p12' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:29: warning: parameter 'p13' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:37: warning: parameter 'p14' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:45: warning: parameter 'p15' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:53: warning: parameter 'p16' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:61: warning: parameter 'p17' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:69: warning: parameter 'p18' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:5:77: warning: parameter 'p19' is never used + p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:5: warning: parameter 'p20' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:13: warning: parameter 'p21' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:21: warning: parameter 'p22' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:29: warning: parameter 'p23' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:37: warning: parameter 'p24' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:45: warning: parameter 'p25' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:53: warning: parameter 'p26' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:61: warning: parameter 'p27' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:69: warning: parameter 'p28' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:6:77: warning: parameter 'p29' is never used + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + ^ +compiler/testData/cli/jvm/apiVersion.kt:9:9: warning: parameter 'x' is never used +fun bar(x: Any) {} ^ -COMPILATION_ERROR +OK diff --git a/compiler/testData/cli/jvm/progressiveModeOff.args b/compiler/testData/cli/jvm/progressiveModeOff.args index 1145a2f7d56..e7f51194cac 100644 --- a/compiler/testData/cli/jvm/progressiveModeOff.args +++ b/compiler/testData/cli/jvm/progressiveModeOff.args @@ -2,4 +2,4 @@ $TESTDATA_DIR$/progressive -d $TEMP_DIR$ -language-version -1.3 +1.4 diff --git a/compiler/testData/cli/jvm/progressiveModeOff.out b/compiler/testData/cli/jvm/progressiveModeOff.out index 9c4d8e5a9bf..e02fa0abd5a 100644 --- a/compiler/testData/cli/jvm/progressiveModeOff.out +++ b/compiler/testData/cli/jvm/progressiveModeOff.out @@ -1,13 +1,7 @@ -compiler/testData/cli/jvm/progressive/tailrecOnVirtualMember.kt:2:5: warning: a function is marked as tail-recursive but no tail calls are found +compiler/testData/cli/jvm/progressive/tailrecOnVirtualMember.kt:2:5: error: tailrec is not allowed on open members tailrec open fun foo(x: Int) {} ^ -compiler/testData/cli/jvm/progressive/tailrecOnVirtualMember.kt:2:5: warning: tailrec on open members is deprecated - tailrec open fun foo(x: Int) {} - ^ -compiler/testData/cli/jvm/progressive/typeParametersInAnonymousObjects.kt:2:9: warning: variable 'x' is never used - val x = object { } - ^ -compiler/testData/cli/jvm/progressive/typeParametersInAnonymousObjects.kt:2:19: warning: type parameters for anonymous objects are deprecated +compiler/testData/cli/jvm/progressive/typeParametersInAnonymousObjects.kt:2:19: error: type parameters are not allowed for objects val x = object { } ^ -OK +COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/releaseCoroutinesApiVersion1.2.args b/compiler/testData/cli/jvm/releaseCoroutinesApiVersion1.2.args deleted file mode 100644 index 9b2dc7ccd3c..00000000000 --- a/compiler/testData/cli/jvm/releaseCoroutinesApiVersion1.2.args +++ /dev/null @@ -1,7 +0,0 @@ -$TESTDATA_DIR$/releaseCoroutinesApiVersion1.2.kt --d -$TEMP_DIR$ --language-version -1.3 --api-version -1.2 diff --git a/compiler/testData/cli/jvm/releaseCoroutinesApiVersion1.2.kt b/compiler/testData/cli/jvm/releaseCoroutinesApiVersion1.2.kt deleted file mode 100644 index e875afbff05..00000000000 --- a/compiler/testData/cli/jvm/releaseCoroutinesApiVersion1.2.kt +++ /dev/null @@ -1,13 +0,0 @@ -suspend fun dummy() {} - -val c: suspend () -> Unit = {} - -fun builder(c: suspend () -> Unit) {} - -val d = suspend {} - -suspend fun check() { - dummy() - c() - builder {} -} \ No newline at end of file diff --git a/compiler/testData/cli/jvm/releaseCoroutinesApiVersion1.2.out b/compiler/testData/cli/jvm/releaseCoroutinesApiVersion1.2.out deleted file mode 100644 index a11a4f5a54e..00000000000 --- a/compiler/testData/cli/jvm/releaseCoroutinesApiVersion1.2.out +++ /dev/null @@ -1,20 +0,0 @@ -warning: API version 1.2 is deprecated and its support will be removed in a future version of Kotlin -compiler/testData/cli/jvm/releaseCoroutinesApiVersion1.2.kt:1:1: error: unsupported [cannot use release coroutines with api version less than 1.3] -suspend fun dummy() {} -^ -compiler/testData/cli/jvm/releaseCoroutinesApiVersion1.2.kt:3:8: error: unsupported [cannot use release coroutines with api version less than 1.3] -val c: suspend () -> Unit = {} - ^ -compiler/testData/cli/jvm/releaseCoroutinesApiVersion1.2.kt:5:16: error: unsupported [cannot use release coroutines with api version less than 1.3] -fun builder(c: suspend () -> Unit) {} - ^ -compiler/testData/cli/jvm/releaseCoroutinesApiVersion1.2.kt:7:9: error: unsupported [cannot use release coroutines with api version less than 1.3] -val d = suspend {} - ^ -compiler/testData/cli/jvm/releaseCoroutinesApiVersion1.2.kt:9:1: error: unsupported [cannot use release coroutines with api version less than 1.3] -suspend fun check() { -^ -compiler/testData/cli/jvm/releaseCoroutinesApiVersion1.2.kt:12:5: error: unsupported [cannot use release coroutines with api version less than 1.3] - builder {} - ^ -COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/sanitized-name.clash.out b/compiler/testData/cli/jvm/sanitized-name.clash.out index b1693fb0fa8..593928b006b 100644 --- a/compiler/testData/cli/jvm/sanitized-name.clash.out +++ b/compiler/testData/cli/jvm/sanitized-name.clash.out @@ -1,7 +1,7 @@ -compiler/testData/cli/jvm/sanitized-name.clash.kt:1:1: error: duplicate JVM class name 'Sanitized_name_clashKt' generated from: package-fragment, Sanitized_name_clashKt +compiler/testData/cli/jvm/sanitized-name.clash.kt:1:1: error: duplicate JVM class name 'Sanitized_name_clashKt' generated from: Sanitized_name_clashKt, Sanitized_name_clashKt class SanitizedNameClash ^ -compiler/testData/cli/jvm/sanitized-name.clash.kt:3:1: error: duplicate JVM class name 'Sanitized_name_clashKt' generated from: package-fragment, Sanitized_name_clashKt +compiler/testData/cli/jvm/sanitized-name.clash.kt:3:1: error: duplicate JVM class name 'Sanitized_name_clashKt' generated from: Sanitized_name_clashKt, Sanitized_name_clashKt class Sanitized_name_clashKt ^ -COMPILATION_ERROR \ No newline at end of file +COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/signatureClash.out b/compiler/testData/cli/jvm/signatureClash.out index 387b231a4f6..d0c97239c33 100644 --- a/compiler/testData/cli/jvm/signatureClash.out +++ b/compiler/testData/cli/jvm/signatureClash.out @@ -14,33 +14,28 @@ compiler/testData/cli/jvm/signatureClash.kt:9:5: error: platform declaration cla val a: Int = 1 ^ compiler/testData/cli/jvm/signatureClash.kt:12:1: error: platform declaration clash: The following declarations have the same JVM signature (getB()I): - fun (): Int defined in root package in file signatureClash.kt - fun getB(): Int defined in root package in file signatureClash.kt + fun (): Int defined in root package + fun getB(): Int defined in root package fun getB(): Int = 1 ^ compiler/testData/cli/jvm/signatureClash.kt:13:1: error: platform declaration clash: The following declarations have the same JVM signature (getB()I): - fun (): Int defined in root package in file signatureClash.kt - fun getB(): Int defined in root package in file signatureClash.kt + fun (): Int defined in root package + fun getB(): Int defined in root package val b: Int = 1 ^ -compiler/testData/cli/jvm/signatureClash.kt:19:7: error: platform declaration clash: The following declarations have the same JVM signature (getTr()I): +compiler/testData/cli/jvm/signatureClash.kt:20:5: error: accidental override: The following declarations have the same JVM signature (getTr()I): fun (): Int defined in SubTr - fun getTr(): Int defined in Tr -class SubTr : Tr { - ^ -compiler/testData/cli/jvm/signatureClash.kt:20:5: error: platform declaration clash: The following declarations have the same JVM signature (getTr()I): - fun (): Int defined in SubTr - fun getTr(): Int defined in Tr + fun getTr(): Int defined in SubTr val tr = 1 ^ compiler/testData/cli/jvm/signatureClash.kt:24:7: error: platform declaration clash: The following declarations have the same JVM signature (access$f(LC;)V): + fun `access$f`(`$this`: C): Unit defined in C fun `access$f`(c: C): Unit defined in C - fun f(): Unit defined in C class C { ^ compiler/testData/cli/jvm/signatureClash.kt:26:5: error: platform declaration clash: The following declarations have the same JVM signature (access$f(LC;)V): + fun `access$f`(`$this`: C): Unit defined in C fun `access$f`(c: C): Unit defined in C - fun f(): Unit defined in C fun `access$f`(c: C) {} ^ -COMPILATION_ERROR \ No newline at end of file +COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/standaloneSamConversionsAreDisabledExplicitlyWithNewInference.args b/compiler/testData/cli/jvm/standaloneSamConversionsAreDisabledExplicitlyWithNewInference.args deleted file mode 100644 index bead449c30c..00000000000 --- a/compiler/testData/cli/jvm/standaloneSamConversionsAreDisabledExplicitlyWithNewInference.args +++ /dev/null @@ -1,5 +0,0 @@ -$TESTDATA_DIR$/standaloneSamConversionsAreEnabledWithNewInference.kt --d -$TEMP_DIR$ --Xnew-inference --XXLanguage\:-SamConversionPerArgument diff --git a/compiler/testData/cli/jvm/standaloneSamConversionsAreDisabledExplicitlyWithNewInference.out b/compiler/testData/cli/jvm/standaloneSamConversionsAreDisabledExplicitlyWithNewInference.out deleted file mode 100644 index 8f5a386bea2..00000000000 --- a/compiler/testData/cli/jvm/standaloneSamConversionsAreDisabledExplicitlyWithNewInference.out +++ /dev/null @@ -1,16 +0,0 @@ -warning: ATTENTION! -This build uses unsafe internal compiler arguments: - --XXLanguage:-SamConversionPerArgument - -This mode is not recommended for production use, -as no stability/compatibility guarantees are given on -compiler or generated code. Use it at your own risk! - -compiler/testData/cli/jvm/standaloneSamConversionsAreEnabledWithNewInference.kt:9:25: error: type mismatch: inferred type is () -> Unit but Runnable was expected - ForceSam.compare(r, {}) - ^ -compiler/testData/cli/jvm/standaloneSamConversionsAreEnabledWithNewInference.kt:10:22: error: type mismatch: inferred type is () -> Unit but Runnable was expected - ForceSam.compare({}, r) - ^ -COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/standaloneSamConversionsBaseline_1_3.out b/compiler/testData/cli/jvm/standaloneSamConversionsBaseline_1_3.out index 421a361ef02..86f7ce9c672 100644 --- a/compiler/testData/cli/jvm/standaloneSamConversionsBaseline_1_3.out +++ b/compiler/testData/cli/jvm/standaloneSamConversionsBaseline_1_3.out @@ -1,3 +1,4 @@ +warning: language version 1.3 is deprecated and its support will be removed in a future version of Kotlin compiler/testData/cli/jvm/standaloneSamConversionsAreEnabledWithNewInference.kt:9:25: error: type mismatch: inferred type is () -> Unit but Runnable was expected ForceSam.compare(r, {}) ^ diff --git a/compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.out b/compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.out index 2bc224f9635..a060e2b4509 100644 --- a/compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.out +++ b/compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.out @@ -1,71 +1,41 @@ -compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.kt:1:7: error: platform declaration clash: The following declarations have the same JVM signature (access$getFoo$p(LA;)I): - fun (): Int defined in A - fun `access$getFoo$p`(a: A): Int defined in A -class A { - ^ -compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.kt:1:7: error: platform declaration clash: The following declarations have the same JVM signature (access$setFoo$p(LA;I)V): - fun (: Int): Unit defined in A - fun `access$setFoo$p`(a: A, d: Int): Unit defined in A -class A { - ^ compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.kt:1:7: error: platform declaration clash: The following declarations have the same JVM signature (access$getFoo$cp()I): - fun (): Int defined in A.Companion + fun `access$getFoo$cp`(): Int defined in A fun `access$getFoo$cp`(): Int defined in A class A { ^ +compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.kt:1:7: error: platform declaration clash: The following declarations have the same JVM signature (access$setFoo$p(LA;I)V): + fun `access$setFoo$p`(`$this`: A, ``: Int): Unit defined in A + fun `access$setFoo$p`(a: A, d: Int): Unit defined in A +class A { + ^ compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.kt:1:7: error: platform declaration clash: The following declarations have the same JVM signature (access$setFoo$cp(I)V): - fun (: Int): Unit defined in A.Companion + fun `access$setFoo$cp`(``: Int): Unit defined in A fun `access$setFoo$cp`(d: Int): Unit defined in A class A { ^ -compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.kt:1:7: error: platform declaration clash: The following declarations have the same JVM signature (access$getBar$lp(LA;)I): - fun (): Int defined in A - fun `access$getBar$lp`(a: A): Int defined in A +compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.kt:1:7: error: platform declaration clash: The following declarations have the same JVM signature (access$getFoo$p(LA;)I): + fun `access$getFoo$p`(`$this`: A): Int defined in A + fun `access$getFoo$p`(a: A): Int defined in A class A { ^ compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.kt:5:5: error: platform declaration clash: The following declarations have the same JVM signature (access$getFoo$p(LA;)I): - fun (): Int defined in A + fun `access$getFoo$p`(`$this`: A): Int defined in A fun `access$getFoo$p`(a: A): Int defined in A fun `access$getFoo$p`(a: A): Int = 1 ^ compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.kt:6:5: error: platform declaration clash: The following declarations have the same JVM signature (access$setFoo$p(LA;I)V): - fun (: Int): Unit defined in A + fun `access$setFoo$p`(`$this`: A, ``: Int): Unit defined in A fun `access$setFoo$p`(a: A, d: Int): Unit defined in A fun `access$setFoo$p`(a: A, d: Int) {} ^ compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.kt:9:5: error: platform declaration clash: The following declarations have the same JVM signature (access$getFoo$cp()I): - fun (): Int defined in A.Companion + fun `access$getFoo$cp`(): Int defined in A fun `access$getFoo$cp`(): Int defined in A fun `access$getFoo$cp`(): Int = 1 ^ compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.kt:10:5: error: platform declaration clash: The following declarations have the same JVM signature (access$setFoo$cp(I)V): - fun (: Int): Unit defined in A.Companion + fun `access$setFoo$cp`(``: Int): Unit defined in A fun `access$setFoo$cp`(d: Int): Unit defined in A fun `access$setFoo$cp`(d: Int) {} ^ -compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.kt:16:5: error: platform declaration clash: The following declarations have the same JVM signature (access$getBar$lp(LA;)I): - fun (): Int defined in A - fun `access$getBar$lp`(a: A): Int defined in A - fun `access$getBar$lp`(a: A): Int = 7 - ^ -compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.kt:18:15: error: platform declaration clash: The following declarations have the same JVM signature (access$getFoo$p(LA$Companion;)I): - fun (): Int defined in A.Companion - fun `access$getFoo$p`(p: A.Companion): Int defined in A.Companion - companion object { - ^ -compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.kt:18:15: error: platform declaration clash: The following declarations have the same JVM signature (access$setFoo$p(LA$Companion;I)V): - fun (: Int): Unit defined in A.Companion - fun `access$setFoo$p`(p: A.Companion, d: Int): Unit defined in A.Companion - companion object { - ^ -compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.kt:30:9: error: platform declaration clash: The following declarations have the same JVM signature (access$getFoo$p(LA$Companion;)I): - fun (): Int defined in A.Companion - fun `access$getFoo$p`(p: A.Companion): Int defined in A.Companion - fun `access$getFoo$p`(p: A.Companion): Int = 1 - ^ -compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.kt:31:9: error: platform declaration clash: The following declarations have the same JVM signature (access$setFoo$p(LA$Companion;I)V): - fun (: Int): Unit defined in A.Companion - fun `access$setFoo$p`(p: A.Companion, d: Int): Unit defined in A.Companion - fun `access$setFoo$p`(p: A.Companion, d: Int) {} - ^ -COMPILATION_ERROR \ No newline at end of file +COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/syntheticAccessorPropertyAndFunSignatureClash.out b/compiler/testData/cli/jvm/syntheticAccessorPropertyAndFunSignatureClash.out index b482184957d..1b132b195d9 100644 --- a/compiler/testData/cli/jvm/syntheticAccessorPropertyAndFunSignatureClash.out +++ b/compiler/testData/cli/jvm/syntheticAccessorPropertyAndFunSignatureClash.out @@ -1,41 +1,41 @@ -compiler/testData/cli/jvm/syntheticAccessorPropertyAndFunSignatureClash.kt:1:7: error: platform declaration clash: The following declarations have the same JVM signature (access$getFoo$p(LA;)I): - fun (): Int defined in A - fun `access$getFoo$p`(a: A): Int defined in A -class A { - ^ -compiler/testData/cli/jvm/syntheticAccessorPropertyAndFunSignatureClash.kt:1:7: error: platform declaration clash: The following declarations have the same JVM signature (access$setFoo$p(LA;I)V): - fun (: Int): Unit defined in A - fun `access$setFoo$p`(a: A, d: Int): Unit defined in A -class A { - ^ compiler/testData/cli/jvm/syntheticAccessorPropertyAndFunSignatureClash.kt:1:7: error: platform declaration clash: The following declarations have the same JVM signature (access$getFoo(LA;)I): + fun `access$getFoo`(`$this`: A): Int defined in A fun `access$getFoo`(a: A): Int defined in A - fun getFoo(): Int defined in A class A { ^ compiler/testData/cli/jvm/syntheticAccessorPropertyAndFunSignatureClash.kt:1:7: error: platform declaration clash: The following declarations have the same JVM signature (access$setFoo(LA;I)V): + fun `access$setFoo`(`$this`: A, i: Int): Unit defined in A fun `access$setFoo`(a: A, d: Int): Unit defined in A - fun setFoo(i: Int): Unit defined in A +class A { + ^ +compiler/testData/cli/jvm/syntheticAccessorPropertyAndFunSignatureClash.kt:1:7: error: platform declaration clash: The following declarations have the same JVM signature (access$setFoo$p(LA;I)V): + fun `access$setFoo$p`(`$this`: A, ``: Int): Unit defined in A + fun `access$setFoo$p`(a: A, d: Int): Unit defined in A +class A { + ^ +compiler/testData/cli/jvm/syntheticAccessorPropertyAndFunSignatureClash.kt:1:7: error: platform declaration clash: The following declarations have the same JVM signature (access$getFoo$p(LA;)I): + fun `access$getFoo$p`(`$this`: A): Int defined in A + fun `access$getFoo$p`(a: A): Int defined in A class A { ^ compiler/testData/cli/jvm/syntheticAccessorPropertyAndFunSignatureClash.kt:5:5: error: platform declaration clash: The following declarations have the same JVM signature (access$getFoo$p(LA;)I): - fun (): Int defined in A + fun `access$getFoo$p`(`$this`: A): Int defined in A fun `access$getFoo$p`(a: A): Int defined in A fun `access$getFoo$p`(a: A): Int = 1 ^ compiler/testData/cli/jvm/syntheticAccessorPropertyAndFunSignatureClash.kt:6:5: error: platform declaration clash: The following declarations have the same JVM signature (access$setFoo$p(LA;I)V): - fun (: Int): Unit defined in A + fun `access$setFoo$p`(`$this`: A, ``: Int): Unit defined in A fun `access$setFoo$p`(a: A, d: Int): Unit defined in A fun `access$setFoo$p`(a: A, d: Int) {} ^ compiler/testData/cli/jvm/syntheticAccessorPropertyAndFunSignatureClash.kt:11:5: error: platform declaration clash: The following declarations have the same JVM signature (access$getFoo(LA;)I): + fun `access$getFoo`(`$this`: A): Int defined in A fun `access$getFoo`(a: A): Int defined in A - fun getFoo(): Int defined in A fun `access$getFoo`(a: A): Int = 1 ^ compiler/testData/cli/jvm/syntheticAccessorPropertyAndFunSignatureClash.kt:12:5: error: platform declaration clash: The following declarations have the same JVM signature (access$setFoo(LA;I)V): + fun `access$setFoo`(`$this`: A, i: Int): Unit defined in A fun `access$setFoo`(a: A, d: Int): Unit defined in A - fun setFoo(i: Int): Unit defined in A fun `access$setFoo`(a: A, d: Int) {} ^ -COMPILATION_ERROR \ No newline at end of file +COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/syntheticAccessorSignatureClash.out b/compiler/testData/cli/jvm/syntheticAccessorSignatureClash.out index fd5abfa1ea4..c0adaf24f8b 100644 --- a/compiler/testData/cli/jvm/syntheticAccessorSignatureClash.out +++ b/compiler/testData/cli/jvm/syntheticAccessorSignatureClash.out @@ -1,31 +1,31 @@ -compiler/testData/cli/jvm/syntheticAccessorSignatureClash.kt:15:5: error: accidental override: The following declarations have the same JVM signature (access$foo(LDerived;)V): +compiler/testData/cli/jvm/syntheticAccessorSignatureClash.kt:14:7: error: accidental override: The following declarations have the same JVM signature (access$foo(LDerived;)V): fun `access$foo`(d: Derived): Unit defined in Derived - fun foo(): Unit defined in Derived - private fun foo() {} - ^ -compiler/testData/cli/jvm/syntheticAccessorSignatureClash.kt:18:9: error: accidental override: The following declarations have the same JVM signature (access$getBar$p(LDerived;)I): - fun (): Int defined in Derived - fun `access$getBar$p`(d: Derived): Int defined in Derived - get - ^ -compiler/testData/cli/jvm/syntheticAccessorSignatureClash.kt:19:9: error: accidental override: The following declarations have the same JVM signature (access$setBar$p(LDerived;I)V): - fun (: Int): Unit defined in Derived - fun `access$setBar$p`(d: Derived, i: Int): Unit defined in Derived - set - ^ -compiler/testData/cli/jvm/syntheticAccessorSignatureClash.kt:21:5: error: accidental override: The following declarations have the same JVM signature (access$getBaz$p(LDerived;)I): - fun (): Int defined in Derived - fun `access$getBaz$p`(d: Derived): Int defined in Derived - private var baz = 1 - ^ -compiler/testData/cli/jvm/syntheticAccessorSignatureClash.kt:23:5: error: accidental override: The following declarations have the same JVM signature (access$getBoo$p(LDerived;)I): - fun (): Int defined in Derived + fun `access$foo`(`$this`: Derived): Unit defined in Derived +class Derived : Base() { + ^ +compiler/testData/cli/jvm/syntheticAccessorSignatureClash.kt:14:7: error: accidental override: The following declarations have the same JVM signature (access$getBoo$p(LDerived;)I): fun `access$getBoo$p`(d: Derived): Int defined in Derived - private val boo = 1 - ^ -compiler/testData/cli/jvm/syntheticAccessorSignatureClash.kt:27:9: error: accidental override: The following declarations have the same JVM signature (access$setBar1$p(LDerived;I)V): - fun (: Int): Unit defined in Derived + fun `access$getBoo$p`(`$this`: Derived): Int defined in Derived +class Derived : Base() { + ^ +compiler/testData/cli/jvm/syntheticAccessorSignatureClash.kt:14:7: error: accidental override: The following declarations have the same JVM signature (access$setBar$p(LDerived;I)V): + fun `access$setBar$p`(d: Derived, i: Int): Unit defined in Derived + fun `access$setBar$p`(`$this`: Derived, ``: Int): Unit defined in Derived +class Derived : Base() { + ^ +compiler/testData/cli/jvm/syntheticAccessorSignatureClash.kt:14:7: error: accidental override: The following declarations have the same JVM signature (access$getBar$p(LDerived;)I): + fun `access$getBar$p`(d: Derived): Int defined in Derived + fun `access$getBar$p`(`$this`: Derived): Int defined in Derived +class Derived : Base() { + ^ +compiler/testData/cli/jvm/syntheticAccessorSignatureClash.kt:14:7: error: accidental override: The following declarations have the same JVM signature (access$setBar1$p(LDerived;I)V): fun `access$setBar1$p`(d: Derived, i: Int): Unit defined in Derived - set - ^ -COMPILATION_ERROR \ No newline at end of file + fun `access$setBar1$p`(`$this`: Derived, ``: Int): Unit defined in Derived +class Derived : Base() { + ^ +compiler/testData/cli/jvm/syntheticAccessorSignatureClash.kt:14:7: error: accidental override: The following declarations have the same JVM signature (access$getBaz$p(LDerived;)I): + fun `access$getBaz$p`(d: Derived): Int defined in Derived + fun `access$getBaz$p`(`$this`: Derived): Int defined in Derived +class Derived : Base() { + ^ +COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/useDeclarationThatWasExperimentalWithoutExplicitImport.out b/compiler/testData/cli/jvm/useDeclarationThatWasExperimentalWithoutExplicitImport.out index d86bac9de59..ae74f0da431 100644 --- a/compiler/testData/cli/jvm/useDeclarationThatWasExperimentalWithoutExplicitImport.out +++ b/compiler/testData/cli/jvm/useDeclarationThatWasExperimentalWithoutExplicitImport.out @@ -1 +1,2 @@ +warning: language version 1.3 is deprecated and its support will be removed in a future version of Kotlin OK diff --git a/compiler/testData/cli/jvm/useDeclarationThatWasExperimentalWithoutExplicitImportCommandLine.out b/compiler/testData/cli/jvm/useDeclarationThatWasExperimentalWithoutExplicitImportCommandLine.out index d86bac9de59..ae74f0da431 100644 --- a/compiler/testData/cli/jvm/useDeclarationThatWasExperimentalWithoutExplicitImportCommandLine.out +++ b/compiler/testData/cli/jvm/useDeclarationThatWasExperimentalWithoutExplicitImportCommandLine.out @@ -1 +1,2 @@ +warning: language version 1.3 is deprecated and its support will be removed in a future version of Kotlin OK diff --git a/compiler/testData/cli/jvm/useDeclarationThatWasExperimentalWithoutMarker.out b/compiler/testData/cli/jvm/useDeclarationThatWasExperimentalWithoutMarker.out index 05f0afb2c5d..a239b5a8eb5 100644 --- a/compiler/testData/cli/jvm/useDeclarationThatWasExperimentalWithoutMarker.out +++ b/compiler/testData/cli/jvm/useDeclarationThatWasExperimentalWithoutMarker.out @@ -1,3 +1,4 @@ +warning: language version 1.3 is deprecated and its support will be removed in a future version of Kotlin compiler/testData/cli/jvm/useDeclarationThatWasExperimentalWithoutMarker.kt:1:13: error: this declaration is experimental and its usage must be marked with '@kotlin.ExperimentalStdlibApi' or '@OptIn(kotlin.ExperimentalStdlibApi::class)' fun test(s: ArrayDeque): ArrayDeque? { ^ diff --git a/compiler/testData/cli/jvm/variableInWhenSubject.args b/compiler/testData/cli/jvm/variableInWhenSubject.args index ca111f84f4e..822c33b4864 100644 --- a/compiler/testData/cli/jvm/variableInWhenSubject.args +++ b/compiler/testData/cli/jvm/variableInWhenSubject.args @@ -2,5 +2,5 @@ $TESTDATA_DIR$/variableInWhenSubject.kt -d $TEMP_DIR$ -language-version -1.2 --XXLanguage\:+VariableDeclarationInWhenSubject \ No newline at end of file +1.3 +-XXLanguage\:+VariableDeclarationInWhenSubject diff --git a/compiler/testData/cli/jvm/variableInWhenSubject.out b/compiler/testData/cli/jvm/variableInWhenSubject.out index 4fbe65494dc..f5e17f06e11 100644 --- a/compiler/testData/cli/jvm/variableInWhenSubject.out +++ b/compiler/testData/cli/jvm/variableInWhenSubject.out @@ -7,5 +7,5 @@ This mode is not recommended for production use, as no stability/compatibility guarantees are given on compiler or generated code. Use it at your own risk! -warning: language version 1.2 is deprecated and its support will be removed in a future version of Kotlin +warning: language version 1.3 is deprecated and its support will be removed in a future version of Kotlin OK diff --git a/compiler/tests-gen/org/jetbrains/kotlin/cli/CliTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/cli/CliTestGenerated.java index 2d4fefc58f1..2585ea7c5cf 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/cli/CliTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/cli/CliTestGenerated.java @@ -32,11 +32,6 @@ public class CliTestGenerated extends AbstractCliTest { runTest("compiler/testData/cli/jvm/abiStabilityIncorrectValue.args"); } - @TestMetadata("abiStabilityUnstableWithOldBackend.args") - public void testAbiStabilityUnstableWithOldBackend() throws Exception { - runTest("compiler/testData/cli/jvm/abiStabilityUnstableWithOldBackend.args"); - } - public void testAllFilesPresentInJvm() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/cli/jvm"), Pattern.compile("^(.+)\\.args$"), null, false); } @@ -576,11 +571,6 @@ public class CliTestGenerated extends AbstractCliTest { runTest("compiler/testData/cli/jvm/kotlinPackage.args"); } - @TestMetadata("kt19628_12.args") - public void testKt19628_12() throws Exception { - runTest("compiler/testData/cli/jvm/kt19628_12.args"); - } - @TestMetadata("kt19628_13.args") public void testKt19628_13() throws Exception { runTest("compiler/testData/cli/jvm/kt19628_13.args"); @@ -706,11 +696,6 @@ public class CliTestGenerated extends AbstractCliTest { runTest("compiler/testData/cli/jvm/progressiveModeOn.args"); } - @TestMetadata("releaseCoroutinesApiVersion1.2.args") - public void testReleaseCoroutinesApiVersion1_2() throws Exception { - runTest("compiler/testData/cli/jvm/releaseCoroutinesApiVersion1.2.args"); - } - @TestMetadata("resultInReturnTypeUnsupportedByDefault14.args") public void testResultInReturnTypeUnsupportedByDefault14() throws Exception { runTest("compiler/testData/cli/jvm/resultInReturnTypeUnsupportedByDefault14.args"); @@ -751,11 +736,6 @@ public class CliTestGenerated extends AbstractCliTest { runTest("compiler/testData/cli/jvm/singleJavaFileRoots.args"); } - @TestMetadata("standaloneSamConversionsAreDisabledExplicitlyWithNewInference.args") - public void testStandaloneSamConversionsAreDisabledExplicitlyWithNewInference() throws Exception { - runTest("compiler/testData/cli/jvm/standaloneSamConversionsAreDisabledExplicitlyWithNewInference.args"); - } - @TestMetadata("standaloneSamConversionsAreEnabledWithNewInference.args") public void testStandaloneSamConversionsAreEnabledWithNewInference() throws Exception { runTest("compiler/testData/cli/jvm/standaloneSamConversionsAreEnabledWithNewInference.args"); From 9b80a552e91459372f37fac3604436352396bc80 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Wed, 13 Jan 2021 14:41:42 +0300 Subject: [PATCH 105/212] [Test] Update testdata of spec tests --- .../p-1/pos/2.10.kt | 6 +++--- .../p-1/pos/2.12.kt | 6 +++--- .../p-1/pos/2.13.kt | 16 ++++++++-------- .../p-1/pos/2.14.kt | 6 +++--- .../p-1/pos/2.15.kt | 6 +++--- .../p-1/pos/2.16.kt | 6 +++--- .../p-1/pos/2.8.kt | 6 +++--- .../p-1/pos/2.9.kt | 6 +++--- 8 files changed, 29 insertions(+), 29 deletions(-) diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.10.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.10.kt index 973dd507afa..c366ca987da 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.10.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.10.kt @@ -20,7 +20,7 @@ package testsCase1 import libPackageCase1.* fun case1() { - listOf(elements = arrayOf(1), body = { "" }) + listOf(elements = arrayOf(1), body = { "" }) } // FILE: Lib1.kt package libPackageCase1 @@ -33,7 +33,7 @@ package testsCase2 import libPackageCase2.* fun case2() { - listOf(elements = arrayOf(1), body = { "" }) + listOf(elements = arrayOf(1), body = { "" }) } @@ -55,7 +55,7 @@ package testsCase3 import libPackageCase3.* fun case3() { - listOf(elements = arrayOf(1), body = { "" }) + listOf(elements = arrayOf(1), body = { "" }) } diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.12.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.12.kt index d6755fd9874..2dc47119c1f 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.12.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.12.kt @@ -26,7 +26,7 @@ class Case1() { fun case1() { fun Case1.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() - listOf(elements1 = arrayOf(1), body = { "" }) + listOf(elements1 = arrayOf(1), body = { "" }) } } // FILE: Lib1.kt @@ -66,7 +66,7 @@ class Case2() { fun case1() { fun Case2.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() - listOf(elements1 = arrayOf(1), body = { "" }) + listOf(elements1 = arrayOf(1), body = { "" }) } } @@ -120,7 +120,7 @@ class Case3() { fun case1() { fun Case3.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() - listOf(elements1 = arrayOf(1), body = { "" }) + listOf(elements1 = arrayOf(1), body = { "" }) } } diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.13.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.13.kt index 9b830a475c8..40710a9b7b2 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.13.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.13.kt @@ -25,11 +25,11 @@ class Case1() { fun case1_0() { fun Case1.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() - listOf(elements1 = arrayOf(1), body = { "" }) + listOf(elements1 = arrayOf(1), body = { "" }) fun case1_1() { fun Case1.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() - listOf(elements1 = arrayOf(1), body = { "" }) + listOf(elements1 = arrayOf(1), body = { "" }) } } @@ -72,11 +72,11 @@ class Case2() { fun case1_0() { fun Case2.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() - listOf(elements1 = arrayOf(1), body = { "" }) + listOf(elements1 = arrayOf(1), body = { "" }) fun case1_1() { fun Case2.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() - listOf(elements1 = arrayOf(1), body = { "" }) + listOf(elements1 = arrayOf(1), body = { "" }) } } @@ -87,7 +87,7 @@ class Case2() { { TODO() }): List = TODO() fun case2_0() { - listOf(elements1 = arrayOf(1), body = { "" }) + listOf(elements1 = arrayOf(1), body = { "" }) } } @@ -141,11 +141,11 @@ class Case3() { fun case1_0() { //fun Case3.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() - listOf(elements1 = arrayOf(1), body = { "" }) + listOf(elements1 = arrayOf(1), body = { "" }) fun case1_1() { // fun Case3.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() - listOf(elements1 = arrayOf(1), body = { "" }) + listOf(elements1 = arrayOf(1), body = { "" }) } } @@ -155,7 +155,7 @@ class Case3() { //fun Case3.listOf(vararg elements1: T = TODO(), body: () -> T = { TODO() }): List = TODO() fun case2_0() { - listOf(elements1 = arrayOf(1), body = { "" }) + listOf(elements1 = arrayOf(1), body = { "" }) } } diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.14.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.14.kt index 9cb3acbf983..8f4009182b5 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.14.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.14.kt @@ -24,7 +24,7 @@ import libPackageCase1Explicit.listOf class Case1() { fun case1() { - listOf(elements1 = arrayOf(1), body = { "" }) + listOf(elements1 = arrayOf(1), body = { "" }) } } @@ -60,7 +60,7 @@ import libPackageCase2Explicit.listOf class Case2() { fun case1() { - listOf(elements1 = arrayOf(1), body = { "" }) + listOf(elements1 = arrayOf(1), body = { "" }) } } @@ -103,7 +103,7 @@ import libPackageCase3Explicit.listOf class Case3() { fun case1() { - listOf(elements1 = arrayOf(1), body = { "" }) + listOf(elements1 = arrayOf(1), body = { "" }) } } diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.15.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.15.kt index 72aa97dafed..76d3beb85ce 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.15.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.15.kt @@ -23,7 +23,7 @@ import libPackageCase1Explicit.listOf class Case1() { fun case1() { - listOf(elements1 = arrayOf(1), body = { "" }) + listOf(elements1 = arrayOf(1), body = { "" }) } } @@ -55,7 +55,7 @@ import libPackageCase2Explicit.listOf class Case2() { fun case1() { - listOf(elements1 = arrayOf(1), body = { "" }) + listOf(elements1 = arrayOf(1), body = { "" }) } } @@ -95,7 +95,7 @@ import libPackageCase3Explicit.listOf class Case3() { fun case1() { - listOf(elements1 = arrayOf(1), body = { "" }) + listOf(elements1 = arrayOf(1), body = { "" }) } } diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.16.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.16.kt index e0425318192..fd1db955206 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.16.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.16.kt @@ -23,7 +23,7 @@ import libPackageCase1Explicit.listOf class Case1() { fun case() { - listOf(elements1 = arrayOf(1), body = { "" }) + listOf(elements1 = arrayOf(1), body = { "" }) } } @@ -54,7 +54,7 @@ import libPackageCase2Explicit.listOf class Case2() { fun case() { - listOf(elements1 = arrayOf(1), body = { "" }) + listOf(elements1 = arrayOf(1), body = { "" }) } } @@ -93,7 +93,7 @@ import libPackageCase3Explicit.listOf class Case3() { fun case() { - listOf(elements1 = arrayOf(1), body = { "" }) + listOf(elements1 = arrayOf(1), body = { "" }) } } diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.8.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.8.kt index 9d1e073cf1a..eb5935f175f 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.8.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.8.kt @@ -21,7 +21,7 @@ import libPackageCase1.* import libPackageCase1Explicit.listOf fun case1() { - listOf(elements1 = arrayOf(1), body = { "" }) + listOf(elements1 = arrayOf(1), body = { "" }) } // FILE: Lib1.kt @@ -47,7 +47,7 @@ import libPackageCase2.* import libPackageCase2Explicit.listOf fun case2() { - listOf(elements1 = arrayOf(1), body = { "" }) + listOf(elements1 = arrayOf(1), body = { "" }) } class A { @@ -80,7 +80,7 @@ import libPackageCase3.* import libPackageCase3Explicit.listOf fun case3() { - listOf(elements1 = arrayOf(1), body = { "" }) + listOf(elements1 = arrayOf(1), body = { "" }) } class A { diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.9.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.9.kt index ed42966d3bb..d3b646d5519 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.9.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.9.kt @@ -20,7 +20,7 @@ package testsCase1 import libPackageCase1.* fun case1() { - listOf(elements1 = arrayOf(1), body = { "" }) + listOf(elements1 = arrayOf(1), body = { "" }) } // FILE: Lib1.kt @@ -39,7 +39,7 @@ package testsCase2 import libPackageCase2.* fun case2() { - listOf(elements1 = arrayOf(1), body = { "" }) + listOf(elements1 = arrayOf(1), body = { "" }) } // FILE: Lib2.kt @@ -67,7 +67,7 @@ package testsCase3 import libPackageCase3.* fun case3() { - listOf(elements1 = arrayOf(1), body = { "" }) + listOf(elements1 = arrayOf(1), body = { "" }) } // FILE: Lib3.kt From f3393eae1bbcd36aafa659e1af3605a0ab68c12f Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Wed, 13 Jan 2021 14:53:48 +0300 Subject: [PATCH 106/212] [Test] Update testdata of CompileKotlinAgainstCustomBinariesTest --- .../output.txt | 28 +++++---- .../output.txt | 5 +- .../requireKotlin/output.txt | 24 ++++---- .../requireKotlinInNestedClasses/output.txt | 4 +- .../output.txt | 4 +- .../output.txt | 4 +- .../requireKotlinInNestedClassesJs/output.txt | 4 +- .../suspensionPointInMonitor/output.txt | 6 +- .../wrongInlineTarget/warningsOnly_1_3.txt | 1 + .../AbstractKotlinCompilerIntegrationTest.kt | 2 +- .../CompileKotlinAgainstCustomBinariesTest.kt | 57 ++++++------------- 11 files changed, 63 insertions(+), 76 deletions(-) diff --git a/compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromReleaseWarnings/output.txt b/compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromReleaseWarnings/output.txt index 08698261d27..d8dc60ec0b7 100644 --- a/compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromReleaseWarnings/output.txt +++ b/compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromReleaseWarnings/output.txt @@ -1,25 +1,29 @@ -compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromReleaseWarnings/release.kt:2:5: warning: 'builder(suspend () -> Unit): Unit' is deprecated. Experimental coroutines support will be dropped in 1.4 +warning: language version 1.3 is deprecated and its support will be removed in a future version of Kotlin +compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromReleaseWarnings/release.kt:2:5: error: unresolved reference: builder builder {} ^ -compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromReleaseWarnings/release.kt:3:5: warning: 'builder2(suspend Int.(String) -> Unit): Unit' is deprecated. Experimental coroutines support will be dropped in 1.4 +compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromReleaseWarnings/release.kt:3:5: error: unresolved reference: builder2 builder2 { } ^ -compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromReleaseWarnings/release.kt:6:7: warning: 'start(): Unit' is deprecated. Experimental coroutines support will be dropped in 1.4 +compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromReleaseWarnings/release.kt:6:7: error: unresolved reference: start x.start() ^ -compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromReleaseWarnings/release.kt:8:5: warning: 'dummy(): Unit' is deprecated. Experimental coroutines support will be dropped in 1.4 +compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromReleaseWarnings/release.kt:8:5: error: unresolved reference: dummy dummy() ^ -compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromReleaseWarnings/release.kt:9:9: warning: 'dummy(): String' is deprecated. Experimental coroutines support will be dropped in 1.4 +compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromReleaseWarnings/release.kt:9:5: error: unresolved reference: C C().dummy() - ^ -compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromReleaseWarnings/release.kt:10:25: warning: 'dummy(): String' is deprecated. Experimental coroutines support will be dropped in 1.4 + ^ +compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromReleaseWarnings/release.kt:10:5: error: unresolved reference: WithNested WithNested.Nested().dummy() - ^ -compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromReleaseWarnings/release.kt:11:25: warning: 'dummy(): String' is deprecated. Experimental coroutines support will be dropped in 1.4 + ^ +compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromReleaseWarnings/release.kt:11:5: error: unresolved reference: WithInner WithInner().Inner().dummy() - ^ -compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromReleaseWarnings/release.kt:13:5: warning: 'suspendAcceptsSuspend(suspend () -> Unit): Unit' is deprecated. Experimental coroutines support will be dropped in 1.4 + ^ +compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromReleaseWarnings/release.kt:13:5: error: unresolved reference: suspendAcceptsSuspend suspendAcceptsSuspend { ^ -OK +compiler/testData/compileKotlinAgainstCustomBinaries/experimentalCoroutineCallFromReleaseWarnings/release.kt:14:9: error: suspension functions can be called only within coroutine body + callRelease() + ^ +COMPILATION_ERROR diff --git a/compiler/testData/compileKotlinAgainstCustomBinaries/releaseCompilerAgainstPreReleaseLibrary/output.txt b/compiler/testData/compileKotlinAgainstCustomBinaries/releaseCompilerAgainstPreReleaseLibrary/output.txt index 822985f3365..4cc95f7c2b9 100644 --- a/compiler/testData/compileKotlinAgainstCustomBinaries/releaseCompilerAgainstPreReleaseLibrary/output.txt +++ b/compiler/testData/compileKotlinAgainstCustomBinaries/releaseCompilerAgainstPreReleaseLibrary/output.txt @@ -35,7 +35,10 @@ compiler/testData/compileKotlinAgainstCustomBinaries/releaseCompilerAgainstPreRe compiler/testData/compileKotlinAgainstCustomBinaries/releaseCompilerAgainstPreReleaseLibrary/source.kt:13:5: error: class 'a.AKt' is compiled by a pre-release version of Kotlin and cannot be loaded by this version of the compiler bar = 239 ^ +compiler/testData/compileKotlinAgainstCustomBinaries/releaseCompilerAgainstPreReleaseLibrary/source.kt:13:5: error: class 'kotlin.Unit' is compiled by a pre-release version of Kotlin and cannot be loaded by this version of the compiler + bar = 239 + ^ compiler/testData/compileKotlinAgainstCustomBinaries/releaseCompilerAgainstPreReleaseLibrary/source.kt:14:12: error: class 'a.AKt' is compiled by a pre-release version of Kotlin and cannot be loaded by this version of the compiler val z: TA = "" ^ -COMPILATION_ERROR \ No newline at end of file +COMPILATION_ERROR diff --git a/compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/output.txt b/compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/output.txt index 55b446859e9..f71f823905f 100644 --- a/compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/output.txt +++ b/compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/output.txt @@ -1,37 +1,37 @@ -compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:3:13: error: 'A' is only available since Kotlin 42.33 and cannot be used in Kotlin 1.4. This declaration is only supported since Kotlin 42.33 +compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:3:13: error: 'A' is only available since Kotlin 42.33 and cannot be used in Kotlin 1.5. This declaration is only supported since Kotlin 42.33 fun test(a: A): TA { ^ -compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:3:13: error: 'A' is only available since Kotlin 40.34 and cannot be used in Kotlin 1.4 +compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:3:13: error: 'A' is only available since Kotlin 40.34 and cannot be used in Kotlin 1.5 fun test(a: A): TA { ^ -compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:3:13: error: 'A' is only available since Kotlin 45.35 and cannot be used in Kotlin 1.4 +compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:3:13: error: 'A' is only available since Kotlin 45.35 and cannot be used in Kotlin 1.5 fun test(a: A): TA { ^ -compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:3:17: error: 'typealias TA = String' is only available since Kotlin 42.33 and cannot be used in Kotlin 1.4. This declaration is only supported since Kotlin 42.33 +compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:3:17: error: 'typealias TA = String' is only available since Kotlin 42.33 and cannot be used in Kotlin 1.5. This declaration is only supported since Kotlin 42.33 fun test(a: A): TA { ^ -compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:3:17: error: 'typealias TA = String' is only available since Kotlin 40.34 and cannot be used in Kotlin 1.4 +compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:3:17: error: 'typealias TA = String' is only available since Kotlin 40.34 and cannot be used in Kotlin 1.5 fun test(a: A): TA { ^ -compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:3:17: error: 'typealias TA = String' is only available since Kotlin 45.35 and cannot be used in Kotlin 1.4 +compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:3:17: error: 'typealias TA = String' is only available since Kotlin 45.35 and cannot be used in Kotlin 1.5 fun test(a: A): TA { ^ -compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:4:5: error: 'f(): Unit' is only available since Kotlin 42.33 and cannot be used in Kotlin 1.4. This declaration is only supported since Kotlin 42.33 +compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:4:5: error: 'f(): Unit' is only available since Kotlin 42.33 and cannot be used in Kotlin 1.5. This declaration is only supported since Kotlin 42.33 f() ^ -compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:4:5: error: 'f(): Unit' is only available since Kotlin 40.34 and cannot be used in Kotlin 1.4 +compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:4:5: error: 'f(): Unit' is only available since Kotlin 40.34 and cannot be used in Kotlin 1.5 f() ^ -compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:4:5: error: 'f(): Unit' is only available since Kotlin 45.35 and cannot be used in Kotlin 1.4 +compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:4:5: error: 'f(): Unit' is only available since Kotlin 45.35 and cannot be used in Kotlin 1.5 f() ^ -compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:5:12: error: 'p: String' is only available since Kotlin 42.33 and cannot be used in Kotlin 1.4. This declaration is only supported since Kotlin 42.33 +compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:5:12: error: 'p: String' is only available since Kotlin 42.33 and cannot be used in Kotlin 1.5. This declaration is only supported since Kotlin 42.33 return p ^ -compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:5:12: error: 'p: String' is only available since Kotlin 40.34 and cannot be used in Kotlin 1.4 +compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:5:12: error: 'p: String' is only available since Kotlin 40.34 and cannot be used in Kotlin 1.5 return p ^ -compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:5:12: error: 'p: String' is only available since Kotlin 45.35 and cannot be used in Kotlin 1.4 +compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:5:12: error: 'p: String' is only available since Kotlin 45.35 and cannot be used in Kotlin 1.5 return p ^ COMPILATION_ERROR diff --git a/compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClasses/output.txt b/compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClasses/output.txt index 4c3ea728286..5d188de16f8 100644 --- a/compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClasses/output.txt +++ b/compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClasses/output.txt @@ -1,7 +1,7 @@ -compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClasses/source.kt:3:19: error: 'Nested' is only available since Kotlin 1.44 and cannot be used in Kotlin 1.4 +compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClasses/source.kt:3:19: error: 'Nested' is only available since Kotlin 1.44 and cannot be used in Kotlin 1.5 fun test(a: Outer.Nested) { ^ -compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClasses/source.kt:4:7: error: 'f(): Unit' is only available since Kotlin 1.88 and cannot be used in Kotlin 1.4 +compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClasses/source.kt:4:7: error: 'f(): Unit' is only available since Kotlin 1.88 and cannot be used in Kotlin 1.5 a.f() ^ COMPILATION_ERROR diff --git a/compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesAgainst13/output.txt b/compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesAgainst13/output.txt index b08bc1461de..94d31bbf20d 100644 --- a/compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesAgainst13/output.txt +++ b/compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesAgainst13/output.txt @@ -1,7 +1,7 @@ -compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesAgainst13/source.kt:3:19: error: 'Nested' is only available since Kotlin 1.44 and cannot be used in Kotlin 1.4 +compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesAgainst13/source.kt:3:19: error: 'Nested' is only available since Kotlin 1.44 and cannot be used in Kotlin 1.5 fun test(a: Outer.Nested) { ^ -compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesAgainst13/source.kt:4:7: error: 'f(): Unit' is only available since Kotlin 1.88 and cannot be used in Kotlin 1.4 +compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesAgainst13/source.kt:4:7: error: 'f(): Unit' is only available since Kotlin 1.88 and cannot be used in Kotlin 1.5 a.f() ^ COMPILATION_ERROR diff --git a/compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesAgainst14Js/output.txt b/compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesAgainst14Js/output.txt index ec228e52b40..38b553628f6 100644 --- a/compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesAgainst14Js/output.txt +++ b/compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesAgainst14Js/output.txt @@ -1,7 +1,7 @@ -compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesAgainst14Js/source.kt:3:19: error: 'Nested' is only available since Kotlin 1.44 and cannot be used in Kotlin 1.4 +compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesAgainst14Js/source.kt:3:19: error: 'Nested' is only available since Kotlin 1.44 and cannot be used in Kotlin 1.5 fun test(a: Outer.Nested) { ^ -compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesAgainst14Js/source.kt:4:7: error: 'f(): Unit' is only available since Kotlin 1.88 and cannot be used in Kotlin 1.4 +compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesAgainst14Js/source.kt:4:7: error: 'f(): Unit' is only available since Kotlin 1.88 and cannot be used in Kotlin 1.5 a.f() ^ COMPILATION_ERROR diff --git a/compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesJs/output.txt b/compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesJs/output.txt index e6ec5c811bd..d234abc4811 100644 --- a/compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesJs/output.txt +++ b/compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesJs/output.txt @@ -1,7 +1,7 @@ -compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesJs/source.kt:3:19: error: 'Nested' is only available since Kotlin 1.44 and cannot be used in Kotlin 1.4 +compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesJs/source.kt:3:19: error: 'Nested' is only available since Kotlin 1.44 and cannot be used in Kotlin 1.5 fun test(a: Outer.Nested) { ^ -compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesJs/source.kt:4:7: error: 'f(): Unit' is only available since Kotlin 1.88 and cannot be used in Kotlin 1.4 +compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesJs/source.kt:4:7: error: 'f(): Unit' is only available since Kotlin 1.88 and cannot be used in Kotlin 1.5 a.f() ^ COMPILATION_ERROR diff --git a/compiler/testData/compileKotlinAgainstCustomBinaries/suspensionPointInMonitor/output.txt b/compiler/testData/compileKotlinAgainstCustomBinaries/suspensionPointInMonitor/output.txt index a066b87afe4..0bb75df7bfb 100644 --- a/compiler/testData/compileKotlinAgainstCustomBinaries/suspensionPointInMonitor/output.txt +++ b/compiler/testData/compileKotlinAgainstCustomBinaries/suspensionPointInMonitor/output.txt @@ -4,9 +4,9 @@ compiler/testData/compileKotlinAgainstCustomBinaries/suspensionPointInMonitor/so compiler/testData/compileKotlinAgainstCustomBinaries/suspensionPointInMonitor/source.kt:14:13: error: a suspension point at SourceKt$test$2.invokeSuspend(source.kt:17) is inside a critical section builder { ^ -compiler/testData/compileKotlinAgainstCustomBinaries/suspensionPointInMonitor/source.kt:24:9: error: a suspension point at SourceKt$test$3$invokeSuspend$$inlined$withCrossinline$2.invokeSuspend(source.kt:60) is inside a critical section - withCrossinline { - ^ +compiler/testData/compileKotlinAgainstCustomBinaries/suspensionPointInMonitor/source.kt:49:1: error: a suspension point at SourceKt$test$3$invokeSuspend$$inlined$withCrossinline$2.invokeSuspend(source.kt:60) is inside a critical section +inline fun withCrossinline(crossinline a: suspend () -> Unit): suspend () -> Unit { +^ compiler/testData/compileKotlinAgainstCustomBinaries/suspensionPointInMonitor/source.kt:50:34: error: a suspension point at SourceKt$withCrossinline$c$1.invokeSuspend(source.kt:52) is inside a critical section val c : suspend () -> Unit = { ^ diff --git a/compiler/testData/compileKotlinAgainstCustomBinaries/wrongInlineTarget/warningsOnly_1_3.txt b/compiler/testData/compileKotlinAgainstCustomBinaries/wrongInlineTarget/warningsOnly_1_3.txt index 3c5b44ae3aa..451f29a417b 100644 --- a/compiler/testData/compileKotlinAgainstCustomBinaries/wrongInlineTarget/warningsOnly_1_3.txt +++ b/compiler/testData/compileKotlinAgainstCustomBinaries/wrongInlineTarget/warningsOnly_1_3.txt @@ -1,3 +1,4 @@ +warning: language version 1.3 is deprecated and its support will be removed in a future version of Kotlin compiler/testData/compileKotlinAgainstCustomBinaries/wrongInlineTarget/warningsOnly_1_3.kt:8:9: warning: cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6. Please specify proper '-jvm-target' option inlineFunBase {} ^ diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/AbstractKotlinCompilerIntegrationTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/AbstractKotlinCompilerIntegrationTest.kt index 5109120ace8..a7a2c3df99f 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/AbstractKotlinCompilerIntegrationTest.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/jvm/compiler/AbstractKotlinCompilerIntegrationTest.kt @@ -131,7 +131,7 @@ abstract class AbstractKotlinCompilerIntegrationTest : TestCaseWithTmpdir() { return destination } - private fun normalizeOutput(output: Pair): String { + protected fun normalizeOutput(output: Pair): String { return AbstractCliTest.getNormalizedCompilerOutput(output.first, output.second, testDataDirectory.path) .replace(FileUtil.toSystemIndependentName(tmpdir.absolutePath), "\$TMP_DIR\$") } diff --git a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstCustomBinariesTest.kt b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstCustomBinariesTest.kt index cc10adc2fac..7e218e9c4c1 100644 --- a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstCustomBinariesTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstCustomBinariesTest.kt @@ -9,6 +9,7 @@ import com.intellij.openapi.util.io.FileUtil import junit.framework.TestCase import org.jetbrains.kotlin.cli.WrongBytecodeVersionTest import org.jetbrains.kotlin.cli.common.CLICompiler +import org.jetbrains.kotlin.cli.common.ExitCode import org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport import org.jetbrains.kotlin.cli.common.messages.MessageRenderer import org.jetbrains.kotlin.cli.common.messages.PrintingMessageCollector @@ -382,7 +383,17 @@ class CompileKotlinAgainstCustomBinariesTest : AbstractKotlinCompilerIntegration } fun testRequireKotlinInNestedClassesAgainst13() { - val library = compileLibrary("library", additionalOptions = listOf("-language-version", "1.3")) + val library = compileLibrary( + "library", + additionalOptions = listOf("-language-version", "1.3"), + checkKotlinOutput = { actual -> + assertEquals( + normalizeOutput( + "warning: language version 1.3 is deprecated and its support will be removed in a future version of Kotlin\n" to ExitCode.OK + ), actual + ) + } + ) compileKotlin("source.kt", tmpdir, listOf(library)) } @@ -543,43 +554,6 @@ class CompileKotlinAgainstCustomBinariesTest : AbstractKotlinCompilerIntegration compileKotlin("source.kt", tmpdir, listOf(library)) } - fun testReleaseCoroutineCallFromExperimental() { - val library = compileLibrary( - "library", - additionalOptions = listOf("-language-version", "1.3", "-api-version", "1.3"), - checkKotlinOutput = {} - ) - compileKotlin( - "experimental.kt", - tmpdir, - listOf(library), - additionalOptions = listOf("-language-version", "1.2", "-Xskip-metadata-version-check") - ) - } - - fun testExperimentalCoroutineCallFromRelease() { - doTestExperimentalCoroutineCallFromRelease() - } - - fun testExperimentalCoroutineCallFromReleaseWarnings() { - doTestExperimentalCoroutineCallFromRelease() - } - - private fun doTestExperimentalCoroutineCallFromRelease() { - val library = compileLibrary( - "library", - additionalOptions = listOf("-language-version", "1.2"), - checkKotlinOutput = {}, - extraClassPath = listOf(ForTestCompileRuntime.coroutinesCompatForTests()) - ) - compileKotlin( - "release.kt", - tmpdir, - listOf(library, ForTestCompileRuntime.coroutinesCompatForTests()), - additionalOptions = listOf("-language-version", "1.3", "-api-version", "1.3") - ) - } - fun testInternalFromForeignModule() { compileKotlin("source.kt", tmpdir, listOf(compileLibrary("library"))) } @@ -601,7 +575,12 @@ class CompileKotlinAgainstCustomBinariesTest : AbstractKotlinCompilerIntegration fun testJvmDefaultCompatibilityAgainstJava() { val library = compileLibrary("library", additionalOptions = listOf("-Xjvm-default=disable")) - compileKotlin("source.kt", tmpdir, listOf(library), additionalOptions = listOf("-jvm-target", "1.8", "-Xjvm-default=all-compatibility")) + compileKotlin( + "source.kt", + tmpdir, + listOf(library), + additionalOptions = listOf("-jvm-target", "1.8", "-Xjvm-default=all-compatibility") + ) } fun testInternalFromForeignModuleJs() { From d87d0cceae449f7174f218208e936ea7f722ec0d Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Wed, 13 Jan 2021 17:11:40 +0100 Subject: [PATCH 107/212] JVM IR: report all sources as outputs for .kotlin_module file This fixes some tests for LV=1.5 in KotlinJpsBuildTest, KotlinJpsBuildTestIncremental, IncrementalJvmJpsTestGenerated, IncrementalCacheVersionChangedTestGenerated. #KT-42069 Fixed --- .../src/org/jetbrains/kotlin/codegen/ClassFileFactory.java | 2 +- .../src/org/jetbrains/kotlin/backend/jvm/JvmIrCodegenFactory.kt | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/ClassFileFactory.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/ClassFileFactory.java index f6fe43879ad..b8b156c1ca2 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/ClassFileFactory.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/ClassFileFactory.java @@ -264,7 +264,7 @@ public class ClassFileFactory implements OutputFileCollection { return new MultifileClassCodegenImpl(state, files, facadeFqName); } - private void registerSourceFiles(Collection files) { + public void registerSourceFiles(@NotNull Collection files) { sourceFiles.addAll(toIoFilesIgnoringNonPhysical(files)); } diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmIrCodegenFactory.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmIrCodegenFactory.kt index ec2fea20048..862507de227 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmIrCodegenFactory.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmIrCodegenFactory.kt @@ -177,6 +177,8 @@ class JvmIrCodegenFactory(private val phaseConfig: PhaseConfig) : CodegenFactory context.typeMapper.mapType(context.referenceClass(descriptor).defaultType) } + context.state.factory.registerSourceFiles(irModuleFragment.files.map(context.psiSourceManager::getKtFile)) + JvmLower(context).lower(irModuleFragment) for (generateMultifileFacade in listOf(true, false)) { From 4dff7e648fdef580859f2b64adfed01731ea7a21 Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Wed, 13 Jan 2021 17:44:08 +0100 Subject: [PATCH 108/212] Minor, restore abiStabilityUnstableWithOldBackend CLI test Add -Xuse-old-backend to make it pass with LV=1.5 where JVM IR is enabled by default. --- .../testData/cli/jvm/abiStabilityUnstableWithOldBackend.args | 5 +++++ .../testData/cli/jvm/abiStabilityUnstableWithOldBackend.out | 2 ++ .../tests-gen/org/jetbrains/kotlin/cli/CliTestGenerated.java | 5 +++++ 3 files changed, 12 insertions(+) create mode 100644 compiler/testData/cli/jvm/abiStabilityUnstableWithOldBackend.args create mode 100644 compiler/testData/cli/jvm/abiStabilityUnstableWithOldBackend.out diff --git a/compiler/testData/cli/jvm/abiStabilityUnstableWithOldBackend.args b/compiler/testData/cli/jvm/abiStabilityUnstableWithOldBackend.args new file mode 100644 index 00000000000..95a2e286aa9 --- /dev/null +++ b/compiler/testData/cli/jvm/abiStabilityUnstableWithOldBackend.args @@ -0,0 +1,5 @@ +$TESTDATA_DIR$/simple.kt +-d +$TEMP_DIR$ +-Xabi-stability=unstable +-Xuse-old-backend diff --git a/compiler/testData/cli/jvm/abiStabilityUnstableWithOldBackend.out b/compiler/testData/cli/jvm/abiStabilityUnstableWithOldBackend.out new file mode 100644 index 00000000000..4383a3f6de4 --- /dev/null +++ b/compiler/testData/cli/jvm/abiStabilityUnstableWithOldBackend.out @@ -0,0 +1,2 @@ +error: -Xabi-stability=unstable is not supported in the old JVM backend +COMPILATION_ERROR diff --git a/compiler/tests-gen/org/jetbrains/kotlin/cli/CliTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/cli/CliTestGenerated.java index 2585ea7c5cf..445389dac65 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/cli/CliTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/cli/CliTestGenerated.java @@ -32,6 +32,11 @@ public class CliTestGenerated extends AbstractCliTest { runTest("compiler/testData/cli/jvm/abiStabilityIncorrectValue.args"); } + @TestMetadata("abiStabilityUnstableWithOldBackend.args") + public void testAbiStabilityUnstableWithOldBackend() throws Exception { + runTest("compiler/testData/cli/jvm/abiStabilityUnstableWithOldBackend.args"); + } + public void testAllFilesPresentInJvm() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/cli/jvm"), Pattern.compile("^(.+)\\.args$"), null, false); } From 1deb317e0d6c18266aaf1a8095a26a396e9416c2 Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Wed, 13 Jan 2021 18:08:30 +0100 Subject: [PATCH 109/212] Update and regenerate incremental compilation tests for 1.5 Set TargetBackend.JVM_IR for these tests by default; remove the generated IR-based test and add a new old-backend-based test. This fixes the issue where some (3) of these tests were not properly ignored because of incorrect target backend used in the test generator. Also update test data for some tests which use local functions, which are not generated to separate anonymous classes in JVM IR. --- ...ementalJvmOldBackendCompilerRunnerTest.kt} | 6 +- ...ementalJvmCompilerRunnerTestGenerated.java | 400 +++++----- ...ldBackendCompilerRunnerTestGenerated.java} | 602 +++++++-------- .../kotlin/generators/tests/GenerateTests.kt | 23 +- .../build/IncrementalJvmJpsTestGenerated.java | 689 +++++++++--------- .../inlineFunCallSite/localFun/build.log | 1 - .../javaUsedInKotlin/methodRenamed/build.log | 1 - 7 files changed, 863 insertions(+), 859 deletions(-) rename compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/{AbstractIrIncrementalJvmCompilerRunnerTest.kt => AbstractIncrementalJvmOldBackendCompilerRunnerTest.kt} (69%) rename compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/{IrIncrementalJvmCompilerRunnerTestGenerated.java => IncrementalJvmOldBackendCompilerRunnerTestGenerated.java} (90%) diff --git a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/AbstractIrIncrementalJvmCompilerRunnerTest.kt b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/AbstractIncrementalJvmOldBackendCompilerRunnerTest.kt similarity index 69% rename from compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/AbstractIrIncrementalJvmCompilerRunnerTest.kt rename to compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/AbstractIncrementalJvmOldBackendCompilerRunnerTest.kt index 62c4a918525..91e7c356941 100644 --- a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/AbstractIrIncrementalJvmCompilerRunnerTest.kt +++ b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/AbstractIncrementalJvmOldBackendCompilerRunnerTest.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ @@ -8,9 +8,9 @@ package org.jetbrains.kotlin.incremental import org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments import java.io.File -abstract class AbstractIrIncrementalJvmCompilerRunnerTest : AbstractIncrementalJvmCompilerRunnerTest() { +abstract class AbstractIncrementalJvmOldBackendCompilerRunnerTest : AbstractIncrementalJvmCompilerRunnerTest() { override fun createCompilerArguments(destinationDir: File, testDir: File): K2JVMCompilerArguments = super.createCompilerArguments(destinationDir, testDir).apply { - useIR = true + useOldBackend = true } } diff --git a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalJvmCompilerRunnerTestGenerated.java b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalJvmCompilerRunnerTestGenerated.java index d6d002495ec..c491abb57cc 100644 --- a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalJvmCompilerRunnerTestGenerated.java +++ b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalJvmCompilerRunnerTestGenerated.java @@ -25,7 +25,7 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class PureKotlin extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } @TestMetadata("accessingFunctionsViaPackagePart") @@ -64,7 +64,7 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement } public void testAllFilesPresentInPureKotlin() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/pureKotlin"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, false); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/pureKotlin"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, false); } @TestMetadata("annotations") @@ -668,11 +668,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class ClassHierarchyAffected extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInClassHierarchyAffected() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, false); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, false); } @TestMetadata("annotationFlagRemoved") @@ -881,11 +881,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class InlineFunCallSite extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInInlineFunCallSite() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } @TestMetadata("classProperty") @@ -963,11 +963,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class ClassProperty extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInClassProperty() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/classProperty"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/classProperty"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -976,11 +976,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class CompanionObjectProperty extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInCompanionObjectProperty() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/companionObjectProperty"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/companionObjectProperty"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -989,11 +989,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class Coroutine extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInCoroutine() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/coroutine"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/coroutine"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1002,11 +1002,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class Function extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInFunction() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/function"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/function"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1015,11 +1015,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class Getter extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInGetter() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/getter"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/getter"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1028,11 +1028,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class Lambda extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInLambda() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/lambda"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/lambda"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1041,11 +1041,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class LocalFun extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInLocalFun() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/localFun"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/localFun"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1054,11 +1054,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class Method extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMethod() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/method"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/method"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1067,11 +1067,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class ParameterDefaultValue extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInParameterDefaultValue() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/parameterDefaultValue"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/parameterDefaultValue"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1080,11 +1080,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class PrimaryConstructorParameterDefaultValue extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInPrimaryConstructorParameterDefaultValue() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/primaryConstructorParameterDefaultValue"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/primaryConstructorParameterDefaultValue"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1093,11 +1093,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class SuperCall extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInSuperCall() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/superCall"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/superCall"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1106,11 +1106,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class ThisCall extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInThisCall() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/thisCall"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/thisCall"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1119,11 +1119,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class TopLevelObjectProperty extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInTopLevelObjectProperty() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/topLevelObjectProperty"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/topLevelObjectProperty"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1132,11 +1132,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class TopLevelProperty extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInTopLevelProperty() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/topLevelProperty"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/topLevelProperty"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } } @@ -1146,11 +1146,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class WithJava extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInWithJava() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } @TestMetadata("jps-plugin/testData/incremental/withJava/convertBetweenJavaAndKotlin") @@ -1158,11 +1158,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class ConvertBetweenJavaAndKotlin extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInConvertBetweenJavaAndKotlin() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/convertBetweenJavaAndKotlin"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/convertBetweenJavaAndKotlin"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } @TestMetadata("javaToKotlin") @@ -1190,11 +1190,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class JavaToKotlin extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInJavaToKotlin() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/convertBetweenJavaAndKotlin/javaToKotlin"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/convertBetweenJavaAndKotlin/javaToKotlin"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1203,11 +1203,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class JavaToKotlinAndBack extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInJavaToKotlinAndBack() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/convertBetweenJavaAndKotlin/javaToKotlinAndBack"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/convertBetweenJavaAndKotlin/javaToKotlinAndBack"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1216,11 +1216,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class JavaToKotlinAndRemove extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInJavaToKotlinAndRemove() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/convertBetweenJavaAndKotlin/javaToKotlinAndRemove"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/convertBetweenJavaAndKotlin/javaToKotlinAndRemove"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1229,11 +1229,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class KotlinToJava extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInKotlinToJava() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/convertBetweenJavaAndKotlin/kotlinToJava"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/convertBetweenJavaAndKotlin/kotlinToJava"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } } @@ -1243,11 +1243,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class JavaUsedInKotlin extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInJavaUsedInKotlin() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } @TestMetadata("changeFieldType") @@ -1350,11 +1350,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class ChangeFieldType extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInChangeFieldType() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeFieldType"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeFieldType"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1363,11 +1363,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class ChangeNotUsedSignature extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInChangeNotUsedSignature() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeNotUsedSignature"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeNotUsedSignature"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1376,11 +1376,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class ChangePropertyOverrideType extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInChangePropertyOverrideType() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changePropertyOverrideType"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changePropertyOverrideType"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1389,11 +1389,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class ChangeSignature extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInChangeSignature() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeSignature"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeSignature"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1402,11 +1402,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class ChangeSignaturePackagePrivate extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInChangeSignaturePackagePrivate() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeSignaturePackagePrivate"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeSignaturePackagePrivate"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1415,11 +1415,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class ChangeSignaturePackagePrivateNonRoot extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInChangeSignaturePackagePrivateNonRoot() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeSignaturePackagePrivateNonRoot"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeSignaturePackagePrivateNonRoot"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1428,11 +1428,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class ChangeSignatureStatic extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInChangeSignatureStatic() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeSignatureStatic"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeSignatureStatic"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1441,11 +1441,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class ConstantChanged extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInConstantChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/constantChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/constantChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1454,11 +1454,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class ConstantUnchanged extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInConstantUnchanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/constantUnchanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/constantUnchanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1467,11 +1467,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class EnumEntryAdded extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInEnumEntryAdded() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/enumEntryAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/enumEntryAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1480,11 +1480,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class EnumEntryRemoved extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInEnumEntryRemoved() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/enumEntryRemoved"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/enumEntryRemoved"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1493,11 +1493,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class JavaAndKotlinChangedSimultaneously extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInJavaAndKotlinChangedSimultaneously() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/javaAndKotlinChangedSimultaneously"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/javaAndKotlinChangedSimultaneously"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1506,11 +1506,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class JavaFieldNullabilityChanged extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInJavaFieldNullabilityChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/javaFieldNullabilityChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/javaFieldNullabilityChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1519,11 +1519,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class JavaMethodParamNullabilityChanged extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInJavaMethodParamNullabilityChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/javaMethodParamNullabilityChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/javaMethodParamNullabilityChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1532,11 +1532,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class JavaMethodReturnTypeNullabilityChanged extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInJavaMethodReturnTypeNullabilityChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/javaMethodReturnTypeNullabilityChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/javaMethodReturnTypeNullabilityChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1545,11 +1545,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class MethodAddedInSuper extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMethodAddedInSuper() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/methodAddedInSuper"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/methodAddedInSuper"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1558,11 +1558,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class MethodRenamed extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMethodRenamed() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/methodRenamed"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/methodRenamed"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1571,11 +1571,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class MixedInheritance extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMixedInheritance() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/mixedInheritance"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/mixedInheritance"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1584,11 +1584,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class NotChangeSignature extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInNotChangeSignature() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/notChangeSignature"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/notChangeSignature"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1597,11 +1597,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class SamConversions extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInSamConversions() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/samConversions"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/samConversions"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } @TestMetadata("methodAdded") @@ -1629,11 +1629,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class MethodAdded extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMethodAdded() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/samConversions/methodAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/samConversions/methodAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1642,11 +1642,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class MethodAddedSamAdapter extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMethodAddedSamAdapter() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/samConversions/methodAddedSamAdapter"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/samConversions/methodAddedSamAdapter"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1655,11 +1655,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class MethodSignatureChanged extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMethodSignatureChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/samConversions/methodSignatureChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/samConversions/methodSignatureChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1668,11 +1668,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class MethodSignatureChangedSamAdapter extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMethodSignatureChangedSamAdapter() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/samConversions/methodSignatureChangedSamAdapter"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/samConversions/methodSignatureChangedSamAdapter"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } } @@ -1683,7 +1683,7 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class KotlinUsedInJava extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } @TestMetadata("addOptionalParameter") @@ -1692,7 +1692,7 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement } public void testAllFilesPresentInKotlinUsedInJava() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } @TestMetadata("changeNotUsedSignature") @@ -1765,11 +1765,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class AddOptionalParameter extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInAddOptionalParameter() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/addOptionalParameter"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/addOptionalParameter"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1778,11 +1778,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class ChangeNotUsedSignature extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInChangeNotUsedSignature() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/changeNotUsedSignature"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/changeNotUsedSignature"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1791,11 +1791,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class ChangeSignature extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInChangeSignature() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/changeSignature"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/changeSignature"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1804,11 +1804,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class ConstantChanged extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInConstantChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/constantChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/constantChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1817,11 +1817,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class ConstantUnchanged extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInConstantUnchanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/constantUnchanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/constantUnchanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1830,11 +1830,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class FunRenamed extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInFunRenamed() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/funRenamed"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/funRenamed"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1843,11 +1843,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class JvmFieldChanged extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInJvmFieldChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/jvmFieldChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/jvmFieldChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1856,11 +1856,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class JvmFieldUnchanged extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInJvmFieldUnchanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/jvmFieldUnchanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/jvmFieldUnchanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1869,11 +1869,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class MethodAddedInSuper extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMethodAddedInSuper() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/methodAddedInSuper"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/methodAddedInSuper"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1882,11 +1882,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class NotChangeSignature extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInNotChangeSignature() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/notChangeSignature"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/notChangeSignature"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1895,11 +1895,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class OnlyTopLevelFunctionInFileRemoved extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInOnlyTopLevelFunctionInFileRemoved() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/onlyTopLevelFunctionInFileRemoved"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/onlyTopLevelFunctionInFileRemoved"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1908,11 +1908,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class PackageFileAdded extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInPackageFileAdded() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/packageFileAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/packageFileAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1921,11 +1921,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class PrivateChanges extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInPrivateChanges() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/privateChanges"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/privateChanges"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1934,11 +1934,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class PropertyRenamed extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInPropertyRenamed() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/propertyRenamed"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/propertyRenamed"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } } @@ -1948,7 +1948,7 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class Other extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } @TestMetadata("accessingFunctionsViaRenamedFileClass") @@ -1957,7 +1957,7 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement } public void testAllFilesPresentInOther() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } @TestMetadata("allKotlinFilesRemovedThenNewAdded") @@ -2110,11 +2110,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class AccessingFunctionsViaRenamedFileClass extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInAccessingFunctionsViaRenamedFileClass() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/accessingFunctionsViaRenamedFileClass"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/accessingFunctionsViaRenamedFileClass"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2123,11 +2123,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class AllKotlinFilesRemovedThenNewAdded extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInAllKotlinFilesRemovedThenNewAdded() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/allKotlinFilesRemovedThenNewAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/allKotlinFilesRemovedThenNewAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2136,11 +2136,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class ClassRedeclaration extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInClassRedeclaration() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/classRedeclaration"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/classRedeclaration"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2149,11 +2149,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class ClassToPackageFacade extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInClassToPackageFacade() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/classToPackageFacade"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/classToPackageFacade"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2162,11 +2162,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class ConflictingPlatformDeclarations extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInConflictingPlatformDeclarations() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/conflictingPlatformDeclarations"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/conflictingPlatformDeclarations"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2175,11 +2175,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class DefaultValueInConstructorAdded extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInDefaultValueInConstructorAdded() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/defaultValueInConstructorAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/defaultValueInConstructorAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2188,11 +2188,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class InlineFunctionWithJvmNameInClass extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInInlineFunctionWithJvmNameInClass() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/inlineFunctionWithJvmNameInClass"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/inlineFunctionWithJvmNameInClass"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2201,11 +2201,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class InlineTopLevelFunctionWithJvmName extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInInlineTopLevelFunctionWithJvmName() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/inlineTopLevelFunctionWithJvmName"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/inlineTopLevelFunctionWithJvmName"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2214,11 +2214,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class InlineTopLevelValPropertyWithJvmName extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInInlineTopLevelValPropertyWithJvmName() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/inlineTopLevelValPropertyWithJvmName"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/inlineTopLevelValPropertyWithJvmName"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2227,11 +2227,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class InnerClassNotGeneratedWhenRebuilding extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInInnerClassNotGeneratedWhenRebuilding() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/innerClassNotGeneratedWhenRebuilding"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/innerClassNotGeneratedWhenRebuilding"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2240,11 +2240,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class JvmNameChanged extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInJvmNameChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/jvmNameChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/jvmNameChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2253,11 +2253,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class MainRedeclaration extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMainRedeclaration() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/mainRedeclaration"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/mainRedeclaration"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2266,11 +2266,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class MultifileClassAddTopLevelFunWithDefault extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMultifileClassAddTopLevelFunWithDefault() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassAddTopLevelFunWithDefault"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassAddTopLevelFunWithDefault"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2279,11 +2279,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class MultifileClassFileAdded extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMultifileClassFileAdded() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassFileAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassFileAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2292,11 +2292,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class MultifileClassFileChanged extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMultifileClassFileChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassFileChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassFileChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2305,11 +2305,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class MultifileClassFileMovedToAnotherMultifileClass extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMultifileClassFileMovedToAnotherMultifileClass() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassFileMovedToAnotherMultifileClass"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassFileMovedToAnotherMultifileClass"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2318,11 +2318,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class MultifileClassInlineFunction extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMultifileClassInlineFunction() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassInlineFunction"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassInlineFunction"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2331,11 +2331,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class MultifileClassInlineFunctionAccessingField extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMultifileClassInlineFunctionAccessingField() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassInlineFunctionAccessingField"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassInlineFunctionAccessingField"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2344,11 +2344,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class MultifileClassRecreated extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMultifileClassRecreated() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassRecreated"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassRecreated"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2357,11 +2357,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class MultifileClassRecreatedAfterRenaming extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMultifileClassRecreatedAfterRenaming() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassRecreatedAfterRenaming"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassRecreatedAfterRenaming"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2370,11 +2370,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class MultifileClassRemoved extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMultifileClassRemoved() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassRemoved"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassRemoved"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2383,11 +2383,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class MultifilePackagePartMethodAdded extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMultifilePackagePartMethodAdded() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifilePackagePartMethodAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifilePackagePartMethodAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2396,11 +2396,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class MultifilePartsWithProperties extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMultifilePartsWithProperties() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifilePartsWithProperties"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifilePartsWithProperties"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2409,11 +2409,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class OptionalParameter extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInOptionalParameter() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/optionalParameter"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/optionalParameter"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2422,11 +2422,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class PackageFacadeToClass extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInPackageFacadeToClass() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/packageFacadeToClass"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/packageFacadeToClass"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2435,11 +2435,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class PackageMultifileClassOneFileWithPublicChanges extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInPackageMultifileClassOneFileWithPublicChanges() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/packageMultifileClassOneFileWithPublicChanges"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/packageMultifileClassOneFileWithPublicChanges"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2448,11 +2448,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class PackageMultifileClassPrivateOnlyChanged extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInPackageMultifileClassPrivateOnlyChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/packageMultifileClassPrivateOnlyChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/packageMultifileClassPrivateOnlyChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2461,11 +2461,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class PublicPropertyWithPrivateSetterMultiFileFacade extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInPublicPropertyWithPrivateSetterMultiFileFacade() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/publicPropertyWithPrivateSetterMultiFileFacade"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/publicPropertyWithPrivateSetterMultiFileFacade"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2474,11 +2474,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class TopLevelFunctionWithJvmName extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInTopLevelFunctionWithJvmName() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/topLevelFunctionWithJvmName"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/topLevelFunctionWithJvmName"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2487,11 +2487,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class TopLevelPropertyWithJvmName extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInTopLevelPropertyWithJvmName() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/topLevelPropertyWithJvmName"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/topLevelPropertyWithJvmName"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } } @@ -2502,7 +2502,7 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class IncrementalJvmCompilerOnly extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } @TestMetadata("addAnnotationToJavaClass") @@ -2516,7 +2516,7 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement } public void testAllFilesPresentInIncrementalJvmCompilerOnly() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/incrementalJvmCompilerOnly"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/incrementalJvmCompilerOnly"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } @TestMetadata("changeAnnotationInJavaClass") @@ -2539,11 +2539,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class AddAnnotationToJavaClass extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInAddAnnotationToJavaClass() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/incrementalJvmCompilerOnly/addAnnotationToJavaClass"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/incrementalJvmCompilerOnly/addAnnotationToJavaClass"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2552,11 +2552,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class AddNestedClass extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInAddNestedClass() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/incrementalJvmCompilerOnly/addNestedClass"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/incrementalJvmCompilerOnly/addNestedClass"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2565,11 +2565,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class ChangeAnnotationInJavaClass extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInChangeAnnotationInJavaClass() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/incrementalJvmCompilerOnly/changeAnnotationInJavaClass"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/incrementalJvmCompilerOnly/changeAnnotationInJavaClass"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2578,11 +2578,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class InlineFunctionRegeneratedObjectStability extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInInlineFunctionRegeneratedObjectStability() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/incrementalJvmCompilerOnly/inlineFunctionRegeneratedObjectStability"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/incrementalJvmCompilerOnly/inlineFunctionRegeneratedObjectStability"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2591,11 +2591,11 @@ public class IncrementalJvmCompilerRunnerTestGenerated extends AbstractIncrement @RunWith(JUnit3RunnerWithInners.class) public static class InlineFunctionSmapStability extends AbstractIncrementalJvmCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInInlineFunctionSmapStability() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/incrementalJvmCompilerOnly/inlineFunctionSmapStability"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/incrementalJvmCompilerOnly/inlineFunctionSmapStability"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } } diff --git a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IrIncrementalJvmCompilerRunnerTestGenerated.java b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalJvmOldBackendCompilerRunnerTestGenerated.java similarity index 90% rename from compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IrIncrementalJvmCompilerRunnerTestGenerated.java rename to compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalJvmOldBackendCompilerRunnerTestGenerated.java index aed97a26828..5ad5fe7932d 100644 --- a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IrIncrementalJvmCompilerRunnerTestGenerated.java +++ b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalJvmOldBackendCompilerRunnerTestGenerated.java @@ -19,13 +19,13 @@ import java.util.regex.Pattern; /** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ @SuppressWarnings("all") @RunWith(JUnit3RunnerWithInners.class) -public class IrIncrementalJvmCompilerRunnerTestGenerated extends AbstractIrIncrementalJvmCompilerRunnerTest { +public class IncrementalJvmOldBackendCompilerRunnerTestGenerated extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { @TestMetadata("jps-plugin/testData/incremental/pureKotlin") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class PureKotlin extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class PureKotlin extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } @TestMetadata("accessingFunctionsViaPackagePart") @@ -64,7 +64,7 @@ public class IrIncrementalJvmCompilerRunnerTestGenerated extends AbstractIrIncre } public void testAllFilesPresentInPureKotlin() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/pureKotlin"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, false); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/pureKotlin"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, false); } @TestMetadata("annotations") @@ -666,13 +666,13 @@ public class IrIncrementalJvmCompilerRunnerTestGenerated extends AbstractIrIncre @TestMetadata("jps-plugin/testData/incremental/classHierarchyAffected") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class ClassHierarchyAffected extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class ClassHierarchyAffected extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInClassHierarchyAffected() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, false); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, false); } @TestMetadata("annotationFlagRemoved") @@ -879,13 +879,13 @@ public class IrIncrementalJvmCompilerRunnerTestGenerated extends AbstractIrIncre @TestMetadata("jps-plugin/testData/incremental/inlineFunCallSite") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class InlineFunCallSite extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class InlineFunCallSite extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInInlineFunCallSite() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } @TestMetadata("classProperty") @@ -961,182 +961,182 @@ public class IrIncrementalJvmCompilerRunnerTestGenerated extends AbstractIrIncre @TestMetadata("jps-plugin/testData/incremental/inlineFunCallSite/classProperty") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class ClassProperty extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class ClassProperty extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInClassProperty() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/classProperty"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/classProperty"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/inlineFunCallSite/companionObjectProperty") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class CompanionObjectProperty extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class CompanionObjectProperty extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInCompanionObjectProperty() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/companionObjectProperty"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/companionObjectProperty"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/inlineFunCallSite/coroutine") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class Coroutine extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class Coroutine extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInCoroutine() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/coroutine"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/coroutine"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/inlineFunCallSite/function") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class Function extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class Function extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInFunction() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/function"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/function"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/inlineFunCallSite/getter") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class Getter extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class Getter extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInGetter() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/getter"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/getter"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/inlineFunCallSite/lambda") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class Lambda extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class Lambda extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInLambda() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/lambda"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/lambda"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/inlineFunCallSite/localFun") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class LocalFun extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class LocalFun extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInLocalFun() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/localFun"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/localFun"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/inlineFunCallSite/method") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class Method extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class Method extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInMethod() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/method"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/method"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/inlineFunCallSite/parameterDefaultValue") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class ParameterDefaultValue extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class ParameterDefaultValue extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInParameterDefaultValue() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/parameterDefaultValue"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/parameterDefaultValue"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/inlineFunCallSite/primaryConstructorParameterDefaultValue") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class PrimaryConstructorParameterDefaultValue extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class PrimaryConstructorParameterDefaultValue extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInPrimaryConstructorParameterDefaultValue() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/primaryConstructorParameterDefaultValue"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/primaryConstructorParameterDefaultValue"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/inlineFunCallSite/superCall") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class SuperCall extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class SuperCall extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInSuperCall() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/superCall"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/superCall"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/inlineFunCallSite/thisCall") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class ThisCall extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class ThisCall extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInThisCall() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/thisCall"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/thisCall"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/inlineFunCallSite/topLevelObjectProperty") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class TopLevelObjectProperty extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class TopLevelObjectProperty extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInTopLevelObjectProperty() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/topLevelObjectProperty"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/topLevelObjectProperty"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/inlineFunCallSite/topLevelProperty") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class TopLevelProperty extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class TopLevelProperty extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInTopLevelProperty() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/topLevelProperty"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/topLevelProperty"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } } @@ -1144,25 +1144,25 @@ public class IrIncrementalJvmCompilerRunnerTestGenerated extends AbstractIrIncre @TestMetadata("jps-plugin/testData/incremental/withJava") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class WithJava extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class WithJava extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInWithJava() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } @TestMetadata("jps-plugin/testData/incremental/withJava/convertBetweenJavaAndKotlin") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class ConvertBetweenJavaAndKotlin extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class ConvertBetweenJavaAndKotlin extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInConvertBetweenJavaAndKotlin() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/convertBetweenJavaAndKotlin"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/convertBetweenJavaAndKotlin"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } @TestMetadata("javaToKotlin") @@ -1188,52 +1188,52 @@ public class IrIncrementalJvmCompilerRunnerTestGenerated extends AbstractIrIncre @TestMetadata("jps-plugin/testData/incremental/withJava/convertBetweenJavaAndKotlin/javaToKotlin") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class JavaToKotlin extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class JavaToKotlin extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInJavaToKotlin() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/convertBetweenJavaAndKotlin/javaToKotlin"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/convertBetweenJavaAndKotlin/javaToKotlin"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/convertBetweenJavaAndKotlin/javaToKotlinAndBack") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class JavaToKotlinAndBack extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class JavaToKotlinAndBack extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInJavaToKotlinAndBack() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/convertBetweenJavaAndKotlin/javaToKotlinAndBack"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/convertBetweenJavaAndKotlin/javaToKotlinAndBack"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/convertBetweenJavaAndKotlin/javaToKotlinAndRemove") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class JavaToKotlinAndRemove extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class JavaToKotlinAndRemove extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInJavaToKotlinAndRemove() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/convertBetweenJavaAndKotlin/javaToKotlinAndRemove"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/convertBetweenJavaAndKotlin/javaToKotlinAndRemove"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/convertBetweenJavaAndKotlin/kotlinToJava") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class KotlinToJava extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class KotlinToJava extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInKotlinToJava() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/convertBetweenJavaAndKotlin/kotlinToJava"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/convertBetweenJavaAndKotlin/kotlinToJava"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } } @@ -1241,13 +1241,13 @@ public class IrIncrementalJvmCompilerRunnerTestGenerated extends AbstractIrIncre @TestMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class JavaUsedInKotlin extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class JavaUsedInKotlin extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInJavaUsedInKotlin() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } @TestMetadata("changeFieldType") @@ -1348,260 +1348,260 @@ public class IrIncrementalJvmCompilerRunnerTestGenerated extends AbstractIrIncre @TestMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeFieldType") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class ChangeFieldType extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class ChangeFieldType extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInChangeFieldType() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeFieldType"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeFieldType"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeNotUsedSignature") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class ChangeNotUsedSignature extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class ChangeNotUsedSignature extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInChangeNotUsedSignature() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeNotUsedSignature"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeNotUsedSignature"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changePropertyOverrideType") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class ChangePropertyOverrideType extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class ChangePropertyOverrideType extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInChangePropertyOverrideType() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changePropertyOverrideType"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changePropertyOverrideType"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeSignature") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class ChangeSignature extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class ChangeSignature extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInChangeSignature() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeSignature"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeSignature"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeSignaturePackagePrivate") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class ChangeSignaturePackagePrivate extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class ChangeSignaturePackagePrivate extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInChangeSignaturePackagePrivate() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeSignaturePackagePrivate"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeSignaturePackagePrivate"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeSignaturePackagePrivateNonRoot") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class ChangeSignaturePackagePrivateNonRoot extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class ChangeSignaturePackagePrivateNonRoot extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInChangeSignaturePackagePrivateNonRoot() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeSignaturePackagePrivateNonRoot"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeSignaturePackagePrivateNonRoot"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeSignatureStatic") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class ChangeSignatureStatic extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class ChangeSignatureStatic extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInChangeSignatureStatic() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeSignatureStatic"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeSignatureStatic"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/constantChanged") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class ConstantChanged extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class ConstantChanged extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInConstantChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/constantChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/constantChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/constantUnchanged") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class ConstantUnchanged extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class ConstantUnchanged extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInConstantUnchanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/constantUnchanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/constantUnchanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/enumEntryAdded") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class EnumEntryAdded extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class EnumEntryAdded extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInEnumEntryAdded() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/enumEntryAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/enumEntryAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/enumEntryRemoved") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class EnumEntryRemoved extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class EnumEntryRemoved extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInEnumEntryRemoved() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/enumEntryRemoved"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/enumEntryRemoved"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/javaAndKotlinChangedSimultaneously") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class JavaAndKotlinChangedSimultaneously extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class JavaAndKotlinChangedSimultaneously extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInJavaAndKotlinChangedSimultaneously() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/javaAndKotlinChangedSimultaneously"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/javaAndKotlinChangedSimultaneously"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/javaFieldNullabilityChanged") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class JavaFieldNullabilityChanged extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class JavaFieldNullabilityChanged extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInJavaFieldNullabilityChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/javaFieldNullabilityChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/javaFieldNullabilityChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/javaMethodParamNullabilityChanged") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class JavaMethodParamNullabilityChanged extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class JavaMethodParamNullabilityChanged extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInJavaMethodParamNullabilityChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/javaMethodParamNullabilityChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/javaMethodParamNullabilityChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/javaMethodReturnTypeNullabilityChanged") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class JavaMethodReturnTypeNullabilityChanged extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class JavaMethodReturnTypeNullabilityChanged extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInJavaMethodReturnTypeNullabilityChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/javaMethodReturnTypeNullabilityChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/javaMethodReturnTypeNullabilityChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/methodAddedInSuper") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class MethodAddedInSuper extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class MethodAddedInSuper extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInMethodAddedInSuper() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/methodAddedInSuper"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/methodAddedInSuper"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/methodRenamed") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class MethodRenamed extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class MethodRenamed extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInMethodRenamed() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/methodRenamed"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/methodRenamed"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/mixedInheritance") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class MixedInheritance extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class MixedInheritance extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInMixedInheritance() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/mixedInheritance"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/mixedInheritance"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/notChangeSignature") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class NotChangeSignature extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class NotChangeSignature extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInNotChangeSignature() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/notChangeSignature"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/notChangeSignature"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/samConversions") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class SamConversions extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class SamConversions extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInSamConversions() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/samConversions"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/samConversions"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } @TestMetadata("methodAdded") @@ -1627,52 +1627,52 @@ public class IrIncrementalJvmCompilerRunnerTestGenerated extends AbstractIrIncre @TestMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/samConversions/methodAdded") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class MethodAdded extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class MethodAdded extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInMethodAdded() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/samConversions/methodAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/samConversions/methodAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/samConversions/methodAddedSamAdapter") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class MethodAddedSamAdapter extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class MethodAddedSamAdapter extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInMethodAddedSamAdapter() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/samConversions/methodAddedSamAdapter"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/samConversions/methodAddedSamAdapter"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/samConversions/methodSignatureChanged") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class MethodSignatureChanged extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class MethodSignatureChanged extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInMethodSignatureChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/samConversions/methodSignatureChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/samConversions/methodSignatureChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/samConversions/methodSignatureChangedSamAdapter") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class MethodSignatureChangedSamAdapter extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class MethodSignatureChangedSamAdapter extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInMethodSignatureChangedSamAdapter() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/samConversions/methodSignatureChangedSamAdapter"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/samConversions/methodSignatureChangedSamAdapter"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } } @@ -1681,9 +1681,9 @@ public class IrIncrementalJvmCompilerRunnerTestGenerated extends AbstractIrIncre @TestMetadata("jps-plugin/testData/incremental/withJava/kotlinUsedInJava") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class KotlinUsedInJava extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class KotlinUsedInJava extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } @TestMetadata("addOptionalParameter") @@ -1692,7 +1692,7 @@ public class IrIncrementalJvmCompilerRunnerTestGenerated extends AbstractIrIncre } public void testAllFilesPresentInKotlinUsedInJava() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } @TestMetadata("changeNotUsedSignature") @@ -1763,182 +1763,182 @@ public class IrIncrementalJvmCompilerRunnerTestGenerated extends AbstractIrIncre @TestMetadata("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/addOptionalParameter") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class AddOptionalParameter extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class AddOptionalParameter extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInAddOptionalParameter() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/addOptionalParameter"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/addOptionalParameter"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/changeNotUsedSignature") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class ChangeNotUsedSignature extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class ChangeNotUsedSignature extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInChangeNotUsedSignature() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/changeNotUsedSignature"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/changeNotUsedSignature"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/changeSignature") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class ChangeSignature extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class ChangeSignature extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInChangeSignature() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/changeSignature"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/changeSignature"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/constantChanged") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class ConstantChanged extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class ConstantChanged extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInConstantChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/constantChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/constantChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/constantUnchanged") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class ConstantUnchanged extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class ConstantUnchanged extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInConstantUnchanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/constantUnchanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/constantUnchanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/funRenamed") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class FunRenamed extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class FunRenamed extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInFunRenamed() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/funRenamed"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/funRenamed"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/jvmFieldChanged") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class JvmFieldChanged extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class JvmFieldChanged extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInJvmFieldChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/jvmFieldChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/jvmFieldChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/jvmFieldUnchanged") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class JvmFieldUnchanged extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class JvmFieldUnchanged extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInJvmFieldUnchanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/jvmFieldUnchanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/jvmFieldUnchanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/methodAddedInSuper") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class MethodAddedInSuper extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class MethodAddedInSuper extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInMethodAddedInSuper() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/methodAddedInSuper"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/methodAddedInSuper"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/notChangeSignature") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class NotChangeSignature extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class NotChangeSignature extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInNotChangeSignature() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/notChangeSignature"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/notChangeSignature"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/onlyTopLevelFunctionInFileRemoved") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class OnlyTopLevelFunctionInFileRemoved extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class OnlyTopLevelFunctionInFileRemoved extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInOnlyTopLevelFunctionInFileRemoved() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/onlyTopLevelFunctionInFileRemoved"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/onlyTopLevelFunctionInFileRemoved"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/packageFileAdded") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class PackageFileAdded extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class PackageFileAdded extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInPackageFileAdded() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/packageFileAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/packageFileAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/privateChanges") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class PrivateChanges extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class PrivateChanges extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInPrivateChanges() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/privateChanges"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/privateChanges"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/propertyRenamed") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class PropertyRenamed extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class PropertyRenamed extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInPropertyRenamed() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/propertyRenamed"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/propertyRenamed"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } } @@ -1946,9 +1946,9 @@ public class IrIncrementalJvmCompilerRunnerTestGenerated extends AbstractIrIncre @TestMetadata("jps-plugin/testData/incremental/withJava/other") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class Other extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class Other extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } @TestMetadata("accessingFunctionsViaRenamedFileClass") @@ -1957,7 +1957,7 @@ public class IrIncrementalJvmCompilerRunnerTestGenerated extends AbstractIrIncre } public void testAllFilesPresentInOther() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } @TestMetadata("allKotlinFilesRemovedThenNewAdded") @@ -2108,390 +2108,390 @@ public class IrIncrementalJvmCompilerRunnerTestGenerated extends AbstractIrIncre @TestMetadata("jps-plugin/testData/incremental/withJava/other/accessingFunctionsViaRenamedFileClass") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class AccessingFunctionsViaRenamedFileClass extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class AccessingFunctionsViaRenamedFileClass extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInAccessingFunctionsViaRenamedFileClass() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/accessingFunctionsViaRenamedFileClass"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/accessingFunctionsViaRenamedFileClass"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/other/allKotlinFilesRemovedThenNewAdded") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class AllKotlinFilesRemovedThenNewAdded extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class AllKotlinFilesRemovedThenNewAdded extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInAllKotlinFilesRemovedThenNewAdded() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/allKotlinFilesRemovedThenNewAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/allKotlinFilesRemovedThenNewAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/other/classRedeclaration") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class ClassRedeclaration extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class ClassRedeclaration extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInClassRedeclaration() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/classRedeclaration"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/classRedeclaration"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/other/classToPackageFacade") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class ClassToPackageFacade extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class ClassToPackageFacade extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInClassToPackageFacade() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/classToPackageFacade"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/classToPackageFacade"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/other/conflictingPlatformDeclarations") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class ConflictingPlatformDeclarations extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class ConflictingPlatformDeclarations extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInConflictingPlatformDeclarations() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/conflictingPlatformDeclarations"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/conflictingPlatformDeclarations"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/other/defaultValueInConstructorAdded") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class DefaultValueInConstructorAdded extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class DefaultValueInConstructorAdded extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInDefaultValueInConstructorAdded() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/defaultValueInConstructorAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/defaultValueInConstructorAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/other/inlineFunctionWithJvmNameInClass") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class InlineFunctionWithJvmNameInClass extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class InlineFunctionWithJvmNameInClass extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInInlineFunctionWithJvmNameInClass() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/inlineFunctionWithJvmNameInClass"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/inlineFunctionWithJvmNameInClass"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/other/inlineTopLevelFunctionWithJvmName") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class InlineTopLevelFunctionWithJvmName extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class InlineTopLevelFunctionWithJvmName extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInInlineTopLevelFunctionWithJvmName() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/inlineTopLevelFunctionWithJvmName"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/inlineTopLevelFunctionWithJvmName"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/other/inlineTopLevelValPropertyWithJvmName") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class InlineTopLevelValPropertyWithJvmName extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class InlineTopLevelValPropertyWithJvmName extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInInlineTopLevelValPropertyWithJvmName() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/inlineTopLevelValPropertyWithJvmName"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/inlineTopLevelValPropertyWithJvmName"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/other/innerClassNotGeneratedWhenRebuilding") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class InnerClassNotGeneratedWhenRebuilding extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class InnerClassNotGeneratedWhenRebuilding extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInInnerClassNotGeneratedWhenRebuilding() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/innerClassNotGeneratedWhenRebuilding"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/innerClassNotGeneratedWhenRebuilding"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/other/jvmNameChanged") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class JvmNameChanged extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class JvmNameChanged extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInJvmNameChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/jvmNameChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/jvmNameChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/other/mainRedeclaration") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class MainRedeclaration extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class MainRedeclaration extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInMainRedeclaration() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/mainRedeclaration"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/mainRedeclaration"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/other/multifileClassAddTopLevelFunWithDefault") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class MultifileClassAddTopLevelFunWithDefault extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class MultifileClassAddTopLevelFunWithDefault extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInMultifileClassAddTopLevelFunWithDefault() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassAddTopLevelFunWithDefault"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassAddTopLevelFunWithDefault"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/other/multifileClassFileAdded") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class MultifileClassFileAdded extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class MultifileClassFileAdded extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInMultifileClassFileAdded() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassFileAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassFileAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/other/multifileClassFileChanged") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class MultifileClassFileChanged extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class MultifileClassFileChanged extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInMultifileClassFileChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassFileChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassFileChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/other/multifileClassFileMovedToAnotherMultifileClass") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class MultifileClassFileMovedToAnotherMultifileClass extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class MultifileClassFileMovedToAnotherMultifileClass extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInMultifileClassFileMovedToAnotherMultifileClass() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassFileMovedToAnotherMultifileClass"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassFileMovedToAnotherMultifileClass"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/other/multifileClassInlineFunction") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class MultifileClassInlineFunction extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class MultifileClassInlineFunction extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInMultifileClassInlineFunction() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassInlineFunction"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassInlineFunction"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/other/multifileClassInlineFunctionAccessingField") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class MultifileClassInlineFunctionAccessingField extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class MultifileClassInlineFunctionAccessingField extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInMultifileClassInlineFunctionAccessingField() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassInlineFunctionAccessingField"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassInlineFunctionAccessingField"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/other/multifileClassRecreated") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class MultifileClassRecreated extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class MultifileClassRecreated extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInMultifileClassRecreated() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassRecreated"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassRecreated"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/other/multifileClassRecreatedAfterRenaming") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class MultifileClassRecreatedAfterRenaming extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class MultifileClassRecreatedAfterRenaming extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInMultifileClassRecreatedAfterRenaming() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassRecreatedAfterRenaming"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassRecreatedAfterRenaming"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/other/multifileClassRemoved") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class MultifileClassRemoved extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class MultifileClassRemoved extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInMultifileClassRemoved() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassRemoved"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassRemoved"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/other/multifilePackagePartMethodAdded") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class MultifilePackagePartMethodAdded extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class MultifilePackagePartMethodAdded extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInMultifilePackagePartMethodAdded() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifilePackagePartMethodAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifilePackagePartMethodAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/other/multifilePartsWithProperties") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class MultifilePartsWithProperties extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class MultifilePartsWithProperties extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInMultifilePartsWithProperties() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifilePartsWithProperties"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifilePartsWithProperties"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/other/optionalParameter") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class OptionalParameter extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class OptionalParameter extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInOptionalParameter() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/optionalParameter"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/optionalParameter"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/other/packageFacadeToClass") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class PackageFacadeToClass extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class PackageFacadeToClass extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInPackageFacadeToClass() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/packageFacadeToClass"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/packageFacadeToClass"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/other/packageMultifileClassOneFileWithPublicChanges") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class PackageMultifileClassOneFileWithPublicChanges extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class PackageMultifileClassOneFileWithPublicChanges extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInPackageMultifileClassOneFileWithPublicChanges() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/packageMultifileClassOneFileWithPublicChanges"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/packageMultifileClassOneFileWithPublicChanges"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/other/packageMultifileClassPrivateOnlyChanged") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class PackageMultifileClassPrivateOnlyChanged extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class PackageMultifileClassPrivateOnlyChanged extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInPackageMultifileClassPrivateOnlyChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/packageMultifileClassPrivateOnlyChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/packageMultifileClassPrivateOnlyChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/other/publicPropertyWithPrivateSetterMultiFileFacade") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class PublicPropertyWithPrivateSetterMultiFileFacade extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class PublicPropertyWithPrivateSetterMultiFileFacade extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInPublicPropertyWithPrivateSetterMultiFileFacade() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/publicPropertyWithPrivateSetterMultiFileFacade"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/publicPropertyWithPrivateSetterMultiFileFacade"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/other/topLevelFunctionWithJvmName") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class TopLevelFunctionWithJvmName extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class TopLevelFunctionWithJvmName extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInTopLevelFunctionWithJvmName() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/topLevelFunctionWithJvmName"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/topLevelFunctionWithJvmName"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/withJava/other/topLevelPropertyWithJvmName") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class TopLevelPropertyWithJvmName extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class TopLevelPropertyWithJvmName extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInTopLevelPropertyWithJvmName() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/topLevelPropertyWithJvmName"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/topLevelPropertyWithJvmName"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } } @@ -2500,9 +2500,9 @@ public class IrIncrementalJvmCompilerRunnerTestGenerated extends AbstractIrIncre @TestMetadata("jps-plugin/testData/incremental/incrementalJvmCompilerOnly") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class IncrementalJvmCompilerOnly extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class IncrementalJvmCompilerOnly extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } @TestMetadata("addAnnotationToJavaClass") @@ -2516,7 +2516,7 @@ public class IrIncrementalJvmCompilerRunnerTestGenerated extends AbstractIrIncre } public void testAllFilesPresentInIncrementalJvmCompilerOnly() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/incrementalJvmCompilerOnly"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/incrementalJvmCompilerOnly"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } @TestMetadata("changeAnnotationInJavaClass") @@ -2537,65 +2537,65 @@ public class IrIncrementalJvmCompilerRunnerTestGenerated extends AbstractIrIncre @TestMetadata("jps-plugin/testData/incremental/incrementalJvmCompilerOnly/addAnnotationToJavaClass") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class AddAnnotationToJavaClass extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class AddAnnotationToJavaClass extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInAddAnnotationToJavaClass() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/incrementalJvmCompilerOnly/addAnnotationToJavaClass"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/incrementalJvmCompilerOnly/addAnnotationToJavaClass"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/incrementalJvmCompilerOnly/addNestedClass") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class AddNestedClass extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class AddNestedClass extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInAddNestedClass() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/incrementalJvmCompilerOnly/addNestedClass"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/incrementalJvmCompilerOnly/addNestedClass"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/incrementalJvmCompilerOnly/changeAnnotationInJavaClass") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class ChangeAnnotationInJavaClass extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class ChangeAnnotationInJavaClass extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInChangeAnnotationInJavaClass() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/incrementalJvmCompilerOnly/changeAnnotationInJavaClass"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/incrementalJvmCompilerOnly/changeAnnotationInJavaClass"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/incrementalJvmCompilerOnly/inlineFunctionRegeneratedObjectStability") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class InlineFunctionRegeneratedObjectStability extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class InlineFunctionRegeneratedObjectStability extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInInlineFunctionRegeneratedObjectStability() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/incrementalJvmCompilerOnly/inlineFunctionRegeneratedObjectStability"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/incrementalJvmCompilerOnly/inlineFunctionRegeneratedObjectStability"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } @TestMetadata("jps-plugin/testData/incremental/incrementalJvmCompilerOnly/inlineFunctionSmapStability") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class InlineFunctionSmapStability extends AbstractIrIncrementalJvmCompilerRunnerTest { + public static class InlineFunctionSmapStability extends AbstractIncrementalJvmOldBackendCompilerRunnerTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } public void testAllFilesPresentInInlineFunctionSmapStability() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/incrementalJvmCompilerOnly/inlineFunctionSmapStability"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/incrementalJvmCompilerOnly/inlineFunctionSmapStability"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM, true); } } } diff --git a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt index 51ab4b7af2e..a2e92eb3b75 100644 --- a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt +++ b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt @@ -1443,13 +1443,18 @@ fun main(args: Array) { testGroup("jps-plugin/jps-tests/test", "jps-plugin/testData") { testClass { - model("incremental/multiModule/common", extension = null, excludeParentDirs = true) - model("incremental/multiModule/jvm", extension = null, excludeParentDirs = true) - model("incremental/multiModule/multiplatform/custom", extension = null, excludeParentDirs = true) - model("incremental/pureKotlin", extension = null, recursive = false) - model("incremental/withJava", extension = null, excludeParentDirs = true) - model("incremental/inlineFunCallSite", extension = null, excludeParentDirs = true) - model("incremental/classHierarchyAffected", extension = null, excludeParentDirs = true) + model("incremental/multiModule/common", extension = null, excludeParentDirs = true, targetBackend = TargetBackend.JVM_IR) + model("incremental/multiModule/jvm", extension = null, excludeParentDirs = true, targetBackend = TargetBackend.JVM_IR) + model( + "incremental/multiModule/multiplatform/custom", extension = null, excludeParentDirs = true, + targetBackend = TargetBackend.JVM_IR + ) + model("incremental/pureKotlin", extension = null, recursive = false, targetBackend = TargetBackend.JVM_IR) + model("incremental/withJava", extension = null, excludeParentDirs = true, targetBackend = TargetBackend.JVM_IR) + model("incremental/inlineFunCallSite", extension = null, excludeParentDirs = true, targetBackend = TargetBackend.JVM_IR) + model( + "incremental/classHierarchyAffected", extension = null, excludeParentDirs = true, targetBackend = TargetBackend.JVM_IR + ) } actualizeMppJpsIncTestCaseDirs(testDataRoot, "incremental/multiModule/multiplatform/withGeneratedContent") @@ -1518,8 +1523,8 @@ fun main(args: Array) { model("incremental/withJava", extension = null, excludeParentDirs = true, targetBackend = targetBackend) model("incremental/incrementalJvmCompilerOnly", extension = null, excludeParentDirs = true, targetBackend = targetBackend) } - testClass(init = incrementalJvmTestData(TargetBackend.JVM)) - testClass(init = incrementalJvmTestData(TargetBackend.JVM_IR)) + testClass(init = incrementalJvmTestData(TargetBackend.JVM_IR)) + testClass(init = incrementalJvmTestData(TargetBackend.JVM)) testClass { model("incremental/pureKotlin", extension = null, recursive = false) diff --git a/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/IncrementalJvmJpsTestGenerated.java b/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/IncrementalJvmJpsTestGenerated.java index 1e17cafc916..c8de15fe074 100644 --- a/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/IncrementalJvmJpsTestGenerated.java +++ b/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/IncrementalJvmJpsTestGenerated.java @@ -9,6 +9,7 @@ import com.intellij.testFramework.TestDataPath; import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; import org.jetbrains.kotlin.test.KotlinTestUtils; import org.jetbrains.kotlin.test.util.KtTestUtil; +import org.jetbrains.kotlin.test.TargetBackend; import org.jetbrains.kotlin.test.TestMetadata; import org.junit.runner.RunWith; @@ -24,11 +25,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class Common extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInCommon() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } @TestMetadata("classAdded") @@ -156,11 +157,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class ClassAdded extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInClassAdded() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/classAdded"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/classAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -169,11 +170,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class ClassRemoved extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInClassRemoved() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/classRemoved"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/classRemoved"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -182,11 +183,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class ConstantValueChanged extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInConstantValueChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/constantValueChanged"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/constantValueChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -195,11 +196,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class CopyFileToAnotherModule extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInCopyFileToAnotherModule() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/copyFileToAnotherModule"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/copyFileToAnotherModule"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -208,11 +209,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class DefaultArgumentInConstructorRemoved extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInDefaultArgumentInConstructorRemoved() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/defaultArgumentInConstructorRemoved"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/defaultArgumentInConstructorRemoved"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -221,11 +222,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class DefaultParameterAdded extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInDefaultParameterAdded() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/defaultParameterAdded"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/defaultParameterAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -234,11 +235,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class DefaultParameterAddedForTopLevelFun extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInDefaultParameterAddedForTopLevelFun() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/defaultParameterAddedForTopLevelFun"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/defaultParameterAddedForTopLevelFun"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -247,11 +248,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class DefaultParameterRemoved extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInDefaultParameterRemoved() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/defaultParameterRemoved"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/defaultParameterRemoved"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -260,11 +261,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class DefaultParameterRemovedForTopLevelFun extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInDefaultParameterRemovedForTopLevelFun() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/defaultParameterRemovedForTopLevelFun"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/defaultParameterRemovedForTopLevelFun"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -273,11 +274,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class DefaultValueInConstructorRemoved extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInDefaultValueInConstructorRemoved() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/defaultValueInConstructorRemoved"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/defaultValueInConstructorRemoved"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -286,11 +287,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class DuplicatedClass extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInDuplicatedClass() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/duplicatedClass"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/duplicatedClass"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -299,11 +300,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class ExportedDependency extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInExportedDependency() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/exportedDependency"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/exportedDependency"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -312,11 +313,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class FunctionFromDifferentPackageChanged extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInFunctionFromDifferentPackageChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/functionFromDifferentPackageChanged"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/functionFromDifferentPackageChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -325,11 +326,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class InlineFunctionInlined extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInInlineFunctionInlined() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/inlineFunctionInlined"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/inlineFunctionInlined"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -338,11 +339,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class InlineFunctionTwoPackageParts extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInInlineFunctionTwoPackageParts() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/inlineFunctionTwoPackageParts"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/inlineFunctionTwoPackageParts"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -351,11 +352,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class MoveFileToAnotherModule extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMoveFileToAnotherModule() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/moveFileToAnotherModule"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/moveFileToAnotherModule"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -364,11 +365,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class Simple extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInSimple() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/simple"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/simple"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -377,11 +378,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class SimpleDependency extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInSimpleDependency() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/simpleDependency"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/simpleDependency"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -390,11 +391,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class SimpleDependencyErrorOnAccessToInternal1 extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInSimpleDependencyErrorOnAccessToInternal1() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/simpleDependencyErrorOnAccessToInternal1"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/simpleDependencyErrorOnAccessToInternal1"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -403,11 +404,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class SimpleDependencyErrorOnAccessToInternal2 extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInSimpleDependencyErrorOnAccessToInternal2() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/simpleDependencyErrorOnAccessToInternal2"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/simpleDependencyErrorOnAccessToInternal2"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -416,11 +417,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class SimpleDependencyUnchanged extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInSimpleDependencyUnchanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/simpleDependencyUnchanged"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/simpleDependencyUnchanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -429,11 +430,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class TransitiveDependency extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInTransitiveDependency() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/transitiveDependency"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/transitiveDependency"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -442,11 +443,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class TransitiveInlining extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInTransitiveInlining() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/transitiveInlining"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/transitiveInlining"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -455,11 +456,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class TwoDependants extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInTwoDependants() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/twoDependants"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/common/twoDependants"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } } @@ -469,11 +470,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class Jvm extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInJvm() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/jvm"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/jvm"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } @TestMetadata("circular") @@ -506,11 +507,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class Circular extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInCircular() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/jvm/circular"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/jvm/circular"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -519,11 +520,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class CircularDependencyClasses extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInCircularDependencyClasses() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/jvm/circularDependencyClasses"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/jvm/circularDependencyClasses"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -532,11 +533,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class CircularDependencySamePackageUnchanged extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInCircularDependencySamePackageUnchanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/jvm/circularDependencySamePackageUnchanged"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/jvm/circularDependencySamePackageUnchanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -545,11 +546,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class CircularDependencyTopLevelFunctions extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInCircularDependencyTopLevelFunctions() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/jvm/circularDependencyTopLevelFunctions"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/jvm/circularDependencyTopLevelFunctions"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -558,11 +559,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class CircularDependencyWithAccessToInternal extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInCircularDependencyWithAccessToInternal() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/jvm/circularDependencyWithAccessToInternal"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/jvm/circularDependencyWithAccessToInternal"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } } @@ -572,11 +573,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class Custom extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInCustom() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/multiplatform/custom"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/multiplatform/custom"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } @TestMetadata("buildError") @@ -614,11 +615,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class BuildError extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInBuildError() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/multiplatform/custom/buildError"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/multiplatform/custom/buildError"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -627,11 +628,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class BuildError2Levels extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInBuildError2Levels() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/multiplatform/custom/buildError2Levels"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/multiplatform/custom/buildError2Levels"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -640,11 +641,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class CommonSourcesCompilerArg extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInCommonSourcesCompilerArg() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/multiplatform/custom/commonSourcesCompilerArg"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/multiplatform/custom/commonSourcesCompilerArg"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -653,11 +654,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class ComplementaryFiles extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInComplementaryFiles() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/multiplatform/custom/complementaryFiles"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/multiplatform/custom/complementaryFiles"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -666,11 +667,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class ModifyOptionalAnnotationUsage extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInModifyOptionalAnnotationUsage() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/multiplatform/custom/modifyOptionalAnnotationUsage"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/multiplatform/custom/modifyOptionalAnnotationUsage"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -679,11 +680,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class NotSameCompiler extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInNotSameCompiler() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/multiplatform/custom/notSameCompiler"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/multiModule/multiplatform/custom/notSameCompiler"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } } @@ -693,7 +694,7 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class PureKotlin extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } @TestMetadata("accessingFunctionsViaPackagePart") @@ -732,7 +733,7 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes } public void testAllFilesPresentInPureKotlin() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/pureKotlin"), Pattern.compile("^([^\\.]+)$"), null, false); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/pureKotlin"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, false); } @TestMetadata("annotations") @@ -1336,11 +1337,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class WithJava extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInWithJava() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } @TestMetadata("jps-plugin/testData/incremental/withJava/convertBetweenJavaAndKotlin") @@ -1348,11 +1349,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class ConvertBetweenJavaAndKotlin extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInConvertBetweenJavaAndKotlin() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/convertBetweenJavaAndKotlin"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/convertBetweenJavaAndKotlin"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } @TestMetadata("javaToKotlin") @@ -1380,11 +1381,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class JavaToKotlin extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInJavaToKotlin() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/convertBetweenJavaAndKotlin/javaToKotlin"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/convertBetweenJavaAndKotlin/javaToKotlin"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1393,11 +1394,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class JavaToKotlinAndBack extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInJavaToKotlinAndBack() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/convertBetweenJavaAndKotlin/javaToKotlinAndBack"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/convertBetweenJavaAndKotlin/javaToKotlinAndBack"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1406,11 +1407,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class JavaToKotlinAndRemove extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInJavaToKotlinAndRemove() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/convertBetweenJavaAndKotlin/javaToKotlinAndRemove"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/convertBetweenJavaAndKotlin/javaToKotlinAndRemove"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1419,11 +1420,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class KotlinToJava extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInKotlinToJava() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/convertBetweenJavaAndKotlin/kotlinToJava"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/convertBetweenJavaAndKotlin/kotlinToJava"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } } @@ -1433,11 +1434,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class JavaUsedInKotlin extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInJavaUsedInKotlin() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } @TestMetadata("changeFieldType") @@ -1540,11 +1541,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class ChangeFieldType extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInChangeFieldType() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeFieldType"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeFieldType"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1553,11 +1554,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class ChangeNotUsedSignature extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInChangeNotUsedSignature() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeNotUsedSignature"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeNotUsedSignature"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1566,11 +1567,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class ChangePropertyOverrideType extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInChangePropertyOverrideType() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changePropertyOverrideType"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changePropertyOverrideType"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1579,11 +1580,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class ChangeSignature extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInChangeSignature() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeSignature"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeSignature"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1592,11 +1593,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class ChangeSignaturePackagePrivate extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInChangeSignaturePackagePrivate() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeSignaturePackagePrivate"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeSignaturePackagePrivate"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1605,11 +1606,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class ChangeSignaturePackagePrivateNonRoot extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInChangeSignaturePackagePrivateNonRoot() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeSignaturePackagePrivateNonRoot"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeSignaturePackagePrivateNonRoot"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1618,11 +1619,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class ChangeSignatureStatic extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInChangeSignatureStatic() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeSignatureStatic"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/changeSignatureStatic"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1631,11 +1632,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class ConstantChanged extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInConstantChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/constantChanged"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/constantChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1644,11 +1645,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class ConstantUnchanged extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInConstantUnchanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/constantUnchanged"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/constantUnchanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1657,11 +1658,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class EnumEntryAdded extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInEnumEntryAdded() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/enumEntryAdded"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/enumEntryAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1670,11 +1671,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class EnumEntryRemoved extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInEnumEntryRemoved() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/enumEntryRemoved"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/enumEntryRemoved"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1683,11 +1684,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class JavaAndKotlinChangedSimultaneously extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInJavaAndKotlinChangedSimultaneously() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/javaAndKotlinChangedSimultaneously"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/javaAndKotlinChangedSimultaneously"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1696,11 +1697,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class JavaFieldNullabilityChanged extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInJavaFieldNullabilityChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/javaFieldNullabilityChanged"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/javaFieldNullabilityChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1709,11 +1710,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class JavaMethodParamNullabilityChanged extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInJavaMethodParamNullabilityChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/javaMethodParamNullabilityChanged"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/javaMethodParamNullabilityChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1722,11 +1723,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class JavaMethodReturnTypeNullabilityChanged extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInJavaMethodReturnTypeNullabilityChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/javaMethodReturnTypeNullabilityChanged"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/javaMethodReturnTypeNullabilityChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1735,11 +1736,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class MethodAddedInSuper extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMethodAddedInSuper() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/methodAddedInSuper"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/methodAddedInSuper"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1748,11 +1749,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class MethodRenamed extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMethodRenamed() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/methodRenamed"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/methodRenamed"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1761,11 +1762,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class MixedInheritance extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMixedInheritance() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/mixedInheritance"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/mixedInheritance"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1774,11 +1775,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class NotChangeSignature extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInNotChangeSignature() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/notChangeSignature"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/notChangeSignature"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1787,11 +1788,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class SamConversions extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInSamConversions() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/samConversions"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/samConversions"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } @TestMetadata("methodAdded") @@ -1819,11 +1820,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class MethodAdded extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMethodAdded() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/samConversions/methodAdded"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/samConversions/methodAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1832,11 +1833,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class MethodAddedSamAdapter extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMethodAddedSamAdapter() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/samConversions/methodAddedSamAdapter"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/samConversions/methodAddedSamAdapter"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1845,11 +1846,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class MethodSignatureChanged extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMethodSignatureChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/samConversions/methodSignatureChanged"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/samConversions/methodSignatureChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1858,11 +1859,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class MethodSignatureChangedSamAdapter extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMethodSignatureChangedSamAdapter() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/samConversions/methodSignatureChangedSamAdapter"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/javaUsedInKotlin/samConversions/methodSignatureChangedSamAdapter"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } } @@ -1873,7 +1874,7 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class KotlinUsedInJava extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } @TestMetadata("addOptionalParameter") @@ -1882,7 +1883,7 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes } public void testAllFilesPresentInKotlinUsedInJava() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } @TestMetadata("changeNotUsedSignature") @@ -1955,11 +1956,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class AddOptionalParameter extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInAddOptionalParameter() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/addOptionalParameter"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/addOptionalParameter"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1968,11 +1969,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class ChangeNotUsedSignature extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInChangeNotUsedSignature() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/changeNotUsedSignature"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/changeNotUsedSignature"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1981,11 +1982,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class ChangeSignature extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInChangeSignature() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/changeSignature"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/changeSignature"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -1994,11 +1995,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class ConstantChanged extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInConstantChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/constantChanged"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/constantChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2007,11 +2008,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class ConstantUnchanged extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInConstantUnchanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/constantUnchanged"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/constantUnchanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2020,11 +2021,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class FunRenamed extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInFunRenamed() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/funRenamed"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/funRenamed"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2033,11 +2034,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class JvmFieldChanged extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInJvmFieldChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/jvmFieldChanged"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/jvmFieldChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2046,11 +2047,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class JvmFieldUnchanged extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInJvmFieldUnchanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/jvmFieldUnchanged"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/jvmFieldUnchanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2059,11 +2060,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class MethodAddedInSuper extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMethodAddedInSuper() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/methodAddedInSuper"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/methodAddedInSuper"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2072,11 +2073,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class NotChangeSignature extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInNotChangeSignature() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/notChangeSignature"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/notChangeSignature"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2085,11 +2086,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class OnlyTopLevelFunctionInFileRemoved extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInOnlyTopLevelFunctionInFileRemoved() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/onlyTopLevelFunctionInFileRemoved"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/onlyTopLevelFunctionInFileRemoved"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2098,11 +2099,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class PackageFileAdded extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInPackageFileAdded() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/packageFileAdded"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/packageFileAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2111,11 +2112,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class PrivateChanges extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInPrivateChanges() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/privateChanges"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/privateChanges"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2124,11 +2125,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class PropertyRenamed extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInPropertyRenamed() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/propertyRenamed"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/kotlinUsedInJava/propertyRenamed"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } } @@ -2138,7 +2139,7 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class Other extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } @TestMetadata("accessingFunctionsViaRenamedFileClass") @@ -2147,7 +2148,7 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes } public void testAllFilesPresentInOther() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } @TestMetadata("allKotlinFilesRemovedThenNewAdded") @@ -2300,11 +2301,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class AccessingFunctionsViaRenamedFileClass extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInAccessingFunctionsViaRenamedFileClass() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/accessingFunctionsViaRenamedFileClass"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/accessingFunctionsViaRenamedFileClass"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2313,11 +2314,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class AllKotlinFilesRemovedThenNewAdded extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInAllKotlinFilesRemovedThenNewAdded() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/allKotlinFilesRemovedThenNewAdded"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/allKotlinFilesRemovedThenNewAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2326,11 +2327,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class ClassRedeclaration extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInClassRedeclaration() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/classRedeclaration"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/classRedeclaration"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2339,11 +2340,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class ClassToPackageFacade extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInClassToPackageFacade() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/classToPackageFacade"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/classToPackageFacade"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2352,11 +2353,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class ConflictingPlatformDeclarations extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInConflictingPlatformDeclarations() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/conflictingPlatformDeclarations"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/conflictingPlatformDeclarations"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2365,11 +2366,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class DefaultValueInConstructorAdded extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInDefaultValueInConstructorAdded() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/defaultValueInConstructorAdded"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/defaultValueInConstructorAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2378,11 +2379,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class InlineFunctionWithJvmNameInClass extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInInlineFunctionWithJvmNameInClass() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/inlineFunctionWithJvmNameInClass"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/inlineFunctionWithJvmNameInClass"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2391,11 +2392,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class InlineTopLevelFunctionWithJvmName extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInInlineTopLevelFunctionWithJvmName() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/inlineTopLevelFunctionWithJvmName"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/inlineTopLevelFunctionWithJvmName"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2404,11 +2405,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class InlineTopLevelValPropertyWithJvmName extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInInlineTopLevelValPropertyWithJvmName() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/inlineTopLevelValPropertyWithJvmName"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/inlineTopLevelValPropertyWithJvmName"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2417,11 +2418,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class InnerClassNotGeneratedWhenRebuilding extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInInnerClassNotGeneratedWhenRebuilding() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/innerClassNotGeneratedWhenRebuilding"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/innerClassNotGeneratedWhenRebuilding"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2430,11 +2431,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class JvmNameChanged extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInJvmNameChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/jvmNameChanged"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/jvmNameChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2443,11 +2444,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class MainRedeclaration extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMainRedeclaration() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/mainRedeclaration"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/mainRedeclaration"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2456,11 +2457,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class MultifileClassAddTopLevelFunWithDefault extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMultifileClassAddTopLevelFunWithDefault() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassAddTopLevelFunWithDefault"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassAddTopLevelFunWithDefault"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2469,11 +2470,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class MultifileClassFileAdded extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMultifileClassFileAdded() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassFileAdded"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassFileAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2482,11 +2483,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class MultifileClassFileChanged extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMultifileClassFileChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassFileChanged"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassFileChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2495,11 +2496,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class MultifileClassFileMovedToAnotherMultifileClass extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMultifileClassFileMovedToAnotherMultifileClass() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassFileMovedToAnotherMultifileClass"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassFileMovedToAnotherMultifileClass"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2508,11 +2509,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class MultifileClassInlineFunction extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMultifileClassInlineFunction() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassInlineFunction"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassInlineFunction"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2521,11 +2522,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class MultifileClassInlineFunctionAccessingField extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMultifileClassInlineFunctionAccessingField() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassInlineFunctionAccessingField"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassInlineFunctionAccessingField"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2534,11 +2535,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class MultifileClassRecreated extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMultifileClassRecreated() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassRecreated"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassRecreated"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2547,11 +2548,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class MultifileClassRecreatedAfterRenaming extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMultifileClassRecreatedAfterRenaming() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassRecreatedAfterRenaming"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassRecreatedAfterRenaming"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2560,11 +2561,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class MultifileClassRemoved extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMultifileClassRemoved() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassRemoved"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifileClassRemoved"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2573,11 +2574,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class MultifilePackagePartMethodAdded extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMultifilePackagePartMethodAdded() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifilePackagePartMethodAdded"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifilePackagePartMethodAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2586,11 +2587,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class MultifilePartsWithProperties extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMultifilePartsWithProperties() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifilePartsWithProperties"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/multifilePartsWithProperties"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2599,11 +2600,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class OptionalParameter extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInOptionalParameter() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/optionalParameter"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/optionalParameter"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2612,11 +2613,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class PackageFacadeToClass extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInPackageFacadeToClass() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/packageFacadeToClass"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/packageFacadeToClass"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2625,11 +2626,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class PackageMultifileClassOneFileWithPublicChanges extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInPackageMultifileClassOneFileWithPublicChanges() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/packageMultifileClassOneFileWithPublicChanges"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/packageMultifileClassOneFileWithPublicChanges"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2638,11 +2639,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class PackageMultifileClassPrivateOnlyChanged extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInPackageMultifileClassPrivateOnlyChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/packageMultifileClassPrivateOnlyChanged"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/packageMultifileClassPrivateOnlyChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2651,11 +2652,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class PublicPropertyWithPrivateSetterMultiFileFacade extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInPublicPropertyWithPrivateSetterMultiFileFacade() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/publicPropertyWithPrivateSetterMultiFileFacade"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/publicPropertyWithPrivateSetterMultiFileFacade"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2664,11 +2665,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class TopLevelFunctionWithJvmName extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInTopLevelFunctionWithJvmName() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/topLevelFunctionWithJvmName"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/topLevelFunctionWithJvmName"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2677,11 +2678,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class TopLevelPropertyWithJvmName extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInTopLevelPropertyWithJvmName() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/topLevelPropertyWithJvmName"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/withJava/other/topLevelPropertyWithJvmName"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } } @@ -2692,11 +2693,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class InlineFunCallSite extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInInlineFunCallSite() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } @TestMetadata("classProperty") @@ -2774,11 +2775,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class ClassProperty extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInClassProperty() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/classProperty"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/classProperty"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2787,11 +2788,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class CompanionObjectProperty extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInCompanionObjectProperty() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/companionObjectProperty"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/companionObjectProperty"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2800,11 +2801,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class Coroutine extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInCoroutine() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/coroutine"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/coroutine"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2813,11 +2814,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class Function extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInFunction() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/function"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/function"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2826,11 +2827,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class Getter extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInGetter() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/getter"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/getter"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2839,11 +2840,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class Lambda extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInLambda() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/lambda"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/lambda"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2852,11 +2853,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class LocalFun extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInLocalFun() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/localFun"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/localFun"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2865,11 +2866,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class Method extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMethod() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/method"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/method"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2878,11 +2879,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class ParameterDefaultValue extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInParameterDefaultValue() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/parameterDefaultValue"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/parameterDefaultValue"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2891,11 +2892,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class PrimaryConstructorParameterDefaultValue extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInPrimaryConstructorParameterDefaultValue() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/primaryConstructorParameterDefaultValue"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/primaryConstructorParameterDefaultValue"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2904,11 +2905,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class SuperCall extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInSuperCall() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/superCall"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/superCall"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2917,11 +2918,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class ThisCall extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInThisCall() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/thisCall"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/thisCall"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2930,11 +2931,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class TopLevelObjectProperty extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInTopLevelObjectProperty() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/topLevelObjectProperty"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/topLevelObjectProperty"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -2943,11 +2944,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class TopLevelProperty extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInTopLevelProperty() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/topLevelProperty"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/inlineFunCallSite/topLevelProperty"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } } @@ -2957,11 +2958,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class ClassHierarchyAffected extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInClassHierarchyAffected() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } @TestMetadata("annotationFlagRemoved") @@ -3169,11 +3170,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class AnnotationFlagRemoved extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInAnnotationFlagRemoved() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/annotationFlagRemoved"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/annotationFlagRemoved"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -3182,11 +3183,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class AnnotationListChanged extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInAnnotationListChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/annotationListChanged"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/annotationListChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -3195,11 +3196,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class BridgeGenerated extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInBridgeGenerated() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/bridgeGenerated"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/bridgeGenerated"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -3208,11 +3209,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class ClassBecameFinal extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInClassBecameFinal() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/classBecameFinal"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/classBecameFinal"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -3221,11 +3222,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class ClassBecameInterface extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInClassBecameInterface() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/classBecameInterface"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/classBecameInterface"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -3234,11 +3235,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class ClassBecamePrivate extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInClassBecamePrivate() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/classBecamePrivate"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/classBecamePrivate"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -3247,11 +3248,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class ClassMovedIntoOtherClass extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInClassMovedIntoOtherClass() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/classMovedIntoOtherClass"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/classMovedIntoOtherClass"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -3260,11 +3261,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class ClassRemoved extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInClassRemoved() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/classRemoved"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/classRemoved"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -3273,11 +3274,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class ClassRemovedAndRestored extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInClassRemovedAndRestored() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/classRemovedAndRestored"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/classRemovedAndRestored"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -3286,11 +3287,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class CompanionObjectInheritedMemberChanged extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInCompanionObjectInheritedMemberChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/companionObjectInheritedMemberChanged"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/companionObjectInheritedMemberChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -3299,11 +3300,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class CompanionObjectMemberChanged extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInCompanionObjectMemberChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/companionObjectMemberChanged"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/companionObjectMemberChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -3312,11 +3313,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class CompanionObjectNameChanged extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInCompanionObjectNameChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/companionObjectNameChanged"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/companionObjectNameChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -3325,11 +3326,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class CompanionObjectToSimpleObject extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInCompanionObjectToSimpleObject() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/companionObjectToSimpleObject"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/companionObjectToSimpleObject"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -3338,11 +3339,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class ConstructorVisibilityChanged extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInConstructorVisibilityChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/constructorVisibilityChanged"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/constructorVisibilityChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -3351,11 +3352,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class EnumEntryAdded extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInEnumEntryAdded() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/enumEntryAdded"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/enumEntryAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -3364,11 +3365,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class EnumEntryRemoved extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInEnumEntryRemoved() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/enumEntryRemoved"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/enumEntryRemoved"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -3377,11 +3378,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class EnumMemberChanged extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInEnumMemberChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/enumMemberChanged"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/enumMemberChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -3390,11 +3391,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class FlagsAndMemberInDifferentClassesChanged extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInFlagsAndMemberInDifferentClassesChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/flagsAndMemberInDifferentClassesChanged"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/flagsAndMemberInDifferentClassesChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -3403,11 +3404,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class FlagsAndMemberInSameClassChanged extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInFlagsAndMemberInSameClassChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/flagsAndMemberInSameClassChanged"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/flagsAndMemberInSameClassChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -3416,11 +3417,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class ImplcitUpcast extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInImplcitUpcast() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/implcitUpcast"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/implcitUpcast"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -3429,11 +3430,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class InferredTypeArgumentChanged extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInInferredTypeArgumentChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/inferredTypeArgumentChanged"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/inferredTypeArgumentChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -3442,11 +3443,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class InferredTypeChanged extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInInferredTypeChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/inferredTypeChanged"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/inferredTypeChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -3455,11 +3456,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class InterfaceAnyMethods extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInInterfaceAnyMethods() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/interfaceAnyMethods"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/interfaceAnyMethods"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -3468,11 +3469,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class LambdaParameterAffected extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInLambdaParameterAffected() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/lambdaParameterAffected"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/lambdaParameterAffected"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -3481,11 +3482,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class MethodAdded extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMethodAdded() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/methodAdded"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/methodAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -3494,11 +3495,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class MethodAnnotationAdded extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMethodAnnotationAdded() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/methodAnnotationAdded"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/methodAnnotationAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -3507,11 +3508,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class MethodNullabilityChanged extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMethodNullabilityChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/methodNullabilityChanged"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/methodNullabilityChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -3520,11 +3521,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class MethodParameterWithDefaultValueAdded extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMethodParameterWithDefaultValueAdded() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/methodParameterWithDefaultValueAdded"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/methodParameterWithDefaultValueAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -3533,11 +3534,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class MethodRemoved extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInMethodRemoved() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/methodRemoved"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/methodRemoved"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -3546,11 +3547,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class OverrideExplicit extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInOverrideExplicit() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/overrideExplicit"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/overrideExplicit"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -3559,11 +3560,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class OverrideImplicit extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInOverrideImplicit() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/overrideImplicit"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/overrideImplicit"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -3572,11 +3573,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class PropertyNullabilityChanged extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInPropertyNullabilityChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/propertyNullabilityChanged"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/propertyNullabilityChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -3585,11 +3586,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class SealedClassImplAdded extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInSealedClassImplAdded() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/sealedClassImplAdded"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/sealedClassImplAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -3598,11 +3599,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class SealedClassIndirectImplAdded extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInSealedClassIndirectImplAdded() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/sealedClassIndirectImplAdded"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/sealedClassIndirectImplAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -3611,11 +3612,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class SealedClassNestedImplAdded extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInSealedClassNestedImplAdded() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/sealedClassNestedImplAdded"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/sealedClassNestedImplAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -3624,11 +3625,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class SecondaryConstructorAdded extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInSecondaryConstructorAdded() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/secondaryConstructorAdded"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/secondaryConstructorAdded"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -3637,11 +3638,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class StarProjectionUpperBoundChanged extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInStarProjectionUpperBoundChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/starProjectionUpperBoundChanged"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/starProjectionUpperBoundChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -3650,11 +3651,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class SupertypesListChanged extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInSupertypesListChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/supertypesListChanged"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/supertypesListChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -3663,11 +3664,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class TypeParameterListChanged extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInTypeParameterListChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/typeParameterListChanged"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/typeParameterListChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } @@ -3676,11 +3677,11 @@ public class IncrementalJvmJpsTestGenerated extends AbstractIncrementalJvmJpsTes @RunWith(JUnit3RunnerWithInners.class) public static class VarianceChanged extends AbstractIncrementalJvmJpsTest { private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); } public void testAllFilesPresentInVarianceChanged() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/varianceChanged"), Pattern.compile("^([^\\.]+)$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("jps-plugin/testData/incremental/classHierarchyAffected/varianceChanged"), Pattern.compile("^([^\\.]+)$"), null, TargetBackend.JVM_IR, true); } } } diff --git a/jps-plugin/testData/incremental/inlineFunCallSite/localFun/build.log b/jps-plugin/testData/incremental/inlineFunCallSite/localFun/build.log index 5c109d067c3..98c5e9ece93 100644 --- a/jps-plugin/testData/incremental/inlineFunCallSite/localFun/build.log +++ b/jps-plugin/testData/incremental/inlineFunCallSite/localFun/build.log @@ -13,7 +13,6 @@ Exit code: ADDITIONAL_PASS_REQUIRED ------------------------------------------ Cleaning output files: out/production/module/META-INF/module.kotlin_module - out/production/module/usage/UsageKt$usage$1.class out/production/module/usage/UsageKt.class End of files Compiling files: diff --git a/jps-plugin/testData/incremental/withJava/javaUsedInKotlin/methodRenamed/build.log b/jps-plugin/testData/incremental/withJava/javaUsedInKotlin/methodRenamed/build.log index ef25b3a5cdb..822681ec959 100644 --- a/jps-plugin/testData/incremental/withJava/javaUsedInKotlin/methodRenamed/build.log +++ b/jps-plugin/testData/incremental/withJava/javaUsedInKotlin/methodRenamed/build.log @@ -10,7 +10,6 @@ Compiling files: End of files Cleaning output files: out/production/module/META-INF/module.kotlin_module - out/production/module/WillBeResolvedToOtherKt$willBeResolvedToOther$1.class out/production/module/WillBeResolvedToOtherKt.class out/production/module/WillBeUnresolvedKt.class End of files From f350e9dacb1c4d5cfc632d0722df4193b04a0e83 Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Wed, 13 Jan 2021 19:02:52 +0100 Subject: [PATCH 110/212] Fix rendering of metadata of multifile facades in classFilesComparison.kt Multifile facades (class files with header kind MULTIFILE_CLASS) have the list of their parts in the d1 field (KotlinClassHeader.data), not some byte-encoded protobuf message which this code was trying to deserialize previously. --- .../testingUtils/classFilesComparison.kt | 44 +++++++++++-------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/build-common/test/org/jetbrains/kotlin/incremental/testingUtils/classFilesComparison.kt b/build-common/test/org/jetbrains/kotlin/incremental/testingUtils/classFilesComparison.kt index 237c037691e..d10b89f3cec 100644 --- a/build-common/test/org/jetbrains/kotlin/incremental/testingUtils/classFilesComparison.kt +++ b/build-common/test/org/jetbrains/kotlin/incremental/testingUtils/classFilesComparison.kt @@ -151,29 +151,35 @@ private fun classFileToString(classFile: File): String { val traceVisitor = TraceClassVisitor(PrintWriter(out)) ClassReader(classFile.readBytes()).accept(traceVisitor, 0) - val classHeader = LocalFileKotlinClass.create(classFile)?.classHeader + val classHeader = LocalFileKotlinClass.create(classFile)?.classHeader ?: return "" + if (!classHeader.metadataVersion.isCompatible()) { + error("Incompatible class ($classHeader): $classFile") + } - val annotationDataEncoded = classHeader?.data - if (annotationDataEncoded != null) { - ByteArrayInputStream(BitEncoding.decodeBytes(annotationDataEncoded)).use { - input -> + when (classHeader.kind) { + KotlinClassHeader.Kind.FILE_FACADE, KotlinClassHeader.Kind.CLASS, KotlinClassHeader.Kind.MULTIFILE_CLASS_PART -> { + ByteArrayInputStream(BitEncoding.decodeBytes(classHeader.data!!)).use { input -> + out.write("\n------ string table types proto -----\n${DebugJvmProtoBuf.StringTableTypes.parseDelimitedFrom(input)}") - out.write("\n------ string table types proto -----\n${DebugJvmProtoBuf.StringTableTypes.parseDelimitedFrom(input)}") - - if (!classHeader.metadataVersion.isCompatible()) { - error("Incompatible class ($classHeader): $classFile") - } - - when (classHeader.kind) { - KotlinClassHeader.Kind.FILE_FACADE -> - out.write("\n------ file facade proto -----\n${DebugProtoBuf.Package.parseFrom(input, getExtensionRegistry())}") - KotlinClassHeader.Kind.CLASS -> - out.write("\n------ class proto -----\n${DebugProtoBuf.Class.parseFrom(input, getExtensionRegistry())}") - KotlinClassHeader.Kind.MULTIFILE_CLASS_PART -> - out.write("\n------ multi-file part proto -----\n${DebugProtoBuf.Package.parseFrom(input, getExtensionRegistry())}") - else -> throw IllegalStateException() + when (classHeader.kind) { + KotlinClassHeader.Kind.FILE_FACADE -> + out.write("\n------ file facade proto -----\n${DebugProtoBuf.Package.parseFrom(input, getExtensionRegistry())}") + KotlinClassHeader.Kind.CLASS -> + out.write("\n------ class proto -----\n${DebugProtoBuf.Class.parseFrom(input, getExtensionRegistry())}") + KotlinClassHeader.Kind.MULTIFILE_CLASS_PART -> + out.write("\n------ multi-file part proto -----\n${DebugProtoBuf.Package.parseFrom(input, getExtensionRegistry())}") + else -> error(classHeader.kind) + } } } + KotlinClassHeader.Kind.MULTIFILE_CLASS -> { + out.write("\n------ multi-file facade data -----\n") + out.write(classHeader.data!!.joinToString("\n")) + } + KotlinClassHeader.Kind.SYNTHETIC_CLASS -> { + // Synthetic class has no metadata, thus there can be no differences in it. + } + KotlinClassHeader.Kind.UNKNOWN -> error("Should not meet unknown classes here: $classFile") } return out.toString() From c6039d76d39b92620e35130706ee9447ab88e379 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Wed, 13 Jan 2021 17:26:09 +0300 Subject: [PATCH 111/212] Enforce using old backend in JvmAbiAnalysisHandlerExtension --- .../kotlin/jvm/abi/JvmAbiAnalysisHandlerExtension.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/jvm-abi-gen/src/org/jetbrains/kotlin/jvm/abi/JvmAbiAnalysisHandlerExtension.kt b/plugins/jvm-abi-gen/src/org/jetbrains/kotlin/jvm/abi/JvmAbiAnalysisHandlerExtension.kt index f63921accb4..fda7407888d 100644 --- a/plugins/jvm-abi-gen/src/org/jetbrains/kotlin/jvm/abi/JvmAbiAnalysisHandlerExtension.kt +++ b/plugins/jvm-abi-gen/src/org/jetbrains/kotlin/jvm/abi/JvmAbiAnalysisHandlerExtension.kt @@ -48,8 +48,12 @@ import java.io.File import java.util.* class JvmAbiAnalysisHandlerExtension( - private val compilerConfiguration: CompilerConfiguration + compilerConfiguration: CompilerConfiguration ) : AnalysisHandlerExtension { + private val compilerConfiguration: CompilerConfiguration = compilerConfiguration.copy().apply { + put(JVMConfigurationKeys.IR, false) + } + override fun analysisCompleted( project: Project, module: ModuleDescriptor, From 7632c117456a793df6e87d14c456f7613594675f Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Wed, 13 Jan 2021 17:56:26 +0300 Subject: [PATCH 112/212] Enforce using old backend in JvmCliReplShellExtension --- .../scripting/compiler/plugin/JvmCliReplShellExtension.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/scripting/scripting-compiler/src/org/jetbrains/kotlin/scripting/compiler/plugin/JvmCliReplShellExtension.kt b/plugins/scripting/scripting-compiler/src/org/jetbrains/kotlin/scripting/compiler/plugin/JvmCliReplShellExtension.kt index 132605e84fe..e614cf81c7e 100644 --- a/plugins/scripting/scripting-compiler/src/org/jetbrains/kotlin/scripting/compiler/plugin/JvmCliReplShellExtension.kt +++ b/plugins/scripting/scripting-compiler/src/org/jetbrains/kotlin/scripting/compiler/plugin/JvmCliReplShellExtension.kt @@ -10,6 +10,7 @@ import org.jetbrains.kotlin.cli.common.ExitCode import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments import org.jetbrains.kotlin.cli.common.extensions.ShellExtension import org.jetbrains.kotlin.config.CompilerConfiguration +import org.jetbrains.kotlin.config.JVMConfigurationKeys import org.jetbrains.kotlin.scripting.compiler.plugin.repl.ReplFromTerminal class JvmCliReplShellExtension : ShellExtension { @@ -21,7 +22,8 @@ class JvmCliReplShellExtension : ShellExtension { configuration: CompilerConfiguration, projectEnvironment: JavaCoreProjectEnvironment ): ExitCode { + configuration.put(JVMConfigurationKeys.IR, false) ReplFromTerminal.run(projectEnvironment.parentDisposable, configuration) return ExitCode.OK } -} \ No newline at end of file +} From 16e0c0b820058cd2718165c4f5f8be279eaa8b1a Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Thu, 14 Jan 2021 08:54:05 +0300 Subject: [PATCH 113/212] [Test] Update testdata of quickfix tests related to sealed classes --- idea/testData/quickfix/addDataModifier/sealed.kt | 3 +-- idea/testData/quickfix/implement/sealed.kt | 2 +- idea/testData/quickfix/implement/sealed.kt.after | 11 ++++++----- idea/testData/quickfix/implement/sealedEmpty.kt | 2 +- idea/testData/quickfix/implement/sealedEmpty.kt.after | 5 ++--- .../testData/quickfix/implement/sealedWithConflict.kt | 2 +- .../quickfix/implement/sealedWithConflict.kt.after | 10 +++++----- .../invalidSealedClassInheritance.kt | 3 +-- 8 files changed, 18 insertions(+), 20 deletions(-) diff --git a/idea/testData/quickfix/addDataModifier/sealed.kt b/idea/testData/quickfix/addDataModifier/sealed.kt index ef37181f075..9ed02042cc2 100644 --- a/idea/testData/quickfix/addDataModifier/sealed.kt +++ b/idea/testData/quickfix/addDataModifier/sealed.kt @@ -5,7 +5,6 @@ // ACTION: Create member function 'Foo.component2' // ACTION: Enable a trailing comma by default in the formatter // ACTION: Put arguments on separate lines -// ERROR: Cannot access '': it is private in 'Foo' // ERROR: Destructuring declaration initializer of type Foo must have a 'component1()' function // ERROR: Destructuring declaration initializer of type Foo must have a 'component2()' function // ERROR: Sealed types cannot be instantiated @@ -13,4 +12,4 @@ sealed class Foo(val bar: String, val baz: Int) fun test() { var (bar, baz) = Foo("A", 1) -} \ No newline at end of file +} diff --git a/idea/testData/quickfix/implement/sealed.kt b/idea/testData/quickfix/implement/sealed.kt index 1d360339ce5..3d0e38a10ac 100644 --- a/idea/testData/quickfix/implement/sealed.kt +++ b/idea/testData/quickfix/implement/sealed.kt @@ -4,4 +4,4 @@ sealed class Base { abstract fun foo(): Int -} \ No newline at end of file +} diff --git a/idea/testData/quickfix/implement/sealed.kt.after b/idea/testData/quickfix/implement/sealed.kt.after index b380f48a2cf..98b985363e4 100644 --- a/idea/testData/quickfix/implement/sealed.kt.after +++ b/idea/testData/quickfix/implement/sealed.kt.after @@ -4,9 +4,10 @@ sealed class Base { abstract fun foo(): Int - class BaseImpl : Base() { - override fun foo(): Int { - TODO("Not yet implemented") - } +} + +class BaseImpl : Base() { + override fun foo(): Int { + TODO("Not yet implemented") } -} \ No newline at end of file +} diff --git a/idea/testData/quickfix/implement/sealedEmpty.kt b/idea/testData/quickfix/implement/sealedEmpty.kt index b10b62726d4..4a13b1c0f3d 100644 --- a/idea/testData/quickfix/implement/sealedEmpty.kt +++ b/idea/testData/quickfix/implement/sealedEmpty.kt @@ -1,4 +1,4 @@ // "Implement sealed class" "true" // SHOULD_BE_AVAILABLE_AFTER_EXECUTION -sealed class Sealed \ No newline at end of file +sealed class Sealed diff --git a/idea/testData/quickfix/implement/sealedEmpty.kt.after b/idea/testData/quickfix/implement/sealedEmpty.kt.after index 4b1bee41ba0..3cc5436491e 100644 --- a/idea/testData/quickfix/implement/sealedEmpty.kt.after +++ b/idea/testData/quickfix/implement/sealedEmpty.kt.after @@ -1,6 +1,5 @@ // "Implement sealed class" "true" // SHOULD_BE_AVAILABLE_AFTER_EXECUTION -sealed class Sealed { - class SealedImpl : Sealed() -} \ No newline at end of file +sealed class Sealed +class SealedImpl : Sealed() diff --git a/idea/testData/quickfix/implement/sealedWithConflict.kt b/idea/testData/quickfix/implement/sealedWithConflict.kt index 8b89b7c6278..e133256f526 100644 --- a/idea/testData/quickfix/implement/sealedWithConflict.kt +++ b/idea/testData/quickfix/implement/sealedWithConflict.kt @@ -8,4 +8,4 @@ sealed class Base { class BaseImpl : Base() { override fun foo() = throw UnsupportedOperationException() } -} \ No newline at end of file +} diff --git a/idea/testData/quickfix/implement/sealedWithConflict.kt.after b/idea/testData/quickfix/implement/sealedWithConflict.kt.after index bbe48e11cb9..94defff9863 100644 --- a/idea/testData/quickfix/implement/sealedWithConflict.kt.after +++ b/idea/testData/quickfix/implement/sealedWithConflict.kt.after @@ -8,10 +8,10 @@ sealed class Base { class BaseImpl : Base() { override fun foo() = throw UnsupportedOperationException() } +} - class BaseImpl1 : Base() { - override fun foo(): Int { - TODO("Not yet implemented") - } +class BaseImpl : Base() { + override fun foo(): Int { + TODO("Not yet implemented") } -} \ No newline at end of file +} diff --git a/idea/testData/quickfix/increaseVisibility/invalidSealedClassInheritance.kt b/idea/testData/quickfix/increaseVisibility/invalidSealedClassInheritance.kt index a2a6b53aef5..f03c0682797 100644 --- a/idea/testData/quickfix/increaseVisibility/invalidSealedClassInheritance.kt +++ b/idea/testData/quickfix/increaseVisibility/invalidSealedClassInheritance.kt @@ -1,11 +1,10 @@ // "Make '' public" "false" // "Make '' internal" "false" // ACTION: Introduce import alias -// ERROR: Cannot access '': it is private in 'SealedClass' // ERROR: This type is sealed, so it can be inherited by only its own nested classes or objects sealed class SealedClass fun test() { class Test : SealedClass() -} \ No newline at end of file +} From a9ef8bb32f8b9ca773d3a339e34377539fdb5d5a Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Thu, 14 Jan 2021 09:57:26 +0300 Subject: [PATCH 114/212] [IDE] Update SuperClassNotInitialized to relaxed restrictions on sealed classes --- .../kotlin/idea/quickfix/SuperClassNotInitialized.kt | 7 ++++--- .../addParenthesisForInvalidSealedClass.kt | 2 +- .../addParenthesisForInvalidSealedClass2.kt | 10 ---------- .../addParenthesisForSealedClass2.kt | 8 ++++++++ .../addParenthesisForSealedClass2.kt.after | 8 ++++++++ .../kotlin/idea/quickfix/QuickFixTestGenerated.java | 10 +++++----- 6 files changed, 26 insertions(+), 19 deletions(-) delete mode 100644 idea/testData/quickfix/supertypeInitialization/addParenthesisForInvalidSealedClass2.kt create mode 100644 idea/testData/quickfix/supertypeInitialization/addParenthesisForSealedClass2.kt create mode 100644 idea/testData/quickfix/supertypeInitialization/addParenthesisForSealedClass2.kt.after diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/SuperClassNotInitialized.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/SuperClassNotInitialized.kt index 28fd9b0cd9c..c49002e73ca 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/SuperClassNotInitialized.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/SuperClassNotInitialized.kt @@ -31,6 +31,7 @@ import org.jetbrains.kotlin.renderer.DescriptorRenderer import org.jetbrains.kotlin.renderer.render import org.jetbrains.kotlin.resolve.BindingContext import org.jetbrains.kotlin.resolve.DescriptorToSourceUtils +import org.jetbrains.kotlin.resolve.descriptorUtil.classId import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode import org.jetbrains.kotlin.types.KotlinType import org.jetbrains.kotlin.types.TypeConstructorSubstitution @@ -52,10 +53,10 @@ object SuperClassNotInitialized : KotlinIntentionActionsFactory() { val superClass = (type.constructor.declarationDescriptor as? ClassDescriptor) ?: return emptyList() val classDescriptor = classOrObjectDeclaration.resolveToDescriptorIfAny(BodyResolveMode.FULL) ?: return emptyList() - val containingPackage = superClass.containingDeclaration as? PackageFragmentDescriptor - val inSameFile = containingPackage == classDescriptor.containingDeclaration + val containingPackage = superClass.classId?.packageFqName + val inSamePackage = containingPackage != null && containingPackage == classDescriptor.classId?.packageFqName val constructors = superClass.constructors.filter { - it.isVisible(classDescriptor) || (superClass.modality == Modality.SEALED && inSameFile) + it.isVisible(classDescriptor) && (superClass.modality != Modality.SEALED || inSamePackage && classDescriptor.visibility != DescriptorVisibilities.LOCAL) } if (constructors.isEmpty() && (!superClass.isExpect || superClass.kind != ClassKind.CLASS)) { return emptyList() // no accessible constructor diff --git a/idea/testData/quickfix/supertypeInitialization/addParenthesisForInvalidSealedClass.kt b/idea/testData/quickfix/supertypeInitialization/addParenthesisForInvalidSealedClass.kt index a6c9a803094..60c2bf1c61a 100644 --- a/idea/testData/quickfix/supertypeInitialization/addParenthesisForInvalidSealedClass.kt +++ b/idea/testData/quickfix/supertypeInitialization/addParenthesisForInvalidSealedClass.kt @@ -6,4 +6,4 @@ sealed class A fun test() { class B : A -} \ No newline at end of file +} diff --git a/idea/testData/quickfix/supertypeInitialization/addParenthesisForInvalidSealedClass2.kt b/idea/testData/quickfix/supertypeInitialization/addParenthesisForInvalidSealedClass2.kt deleted file mode 100644 index 5a6961352fb..00000000000 --- a/idea/testData/quickfix/supertypeInitialization/addParenthesisForInvalidSealedClass2.kt +++ /dev/null @@ -1,10 +0,0 @@ -// "Change to constructor invocation" "false" -// ACTION: Introduce import alias -// ERROR: This type has a constructor, and thus must be initialized here -// ERROR: This type is sealed, so it can be inherited by only its own nested classes or objects - -class My { - sealed class A - - class B : A -} \ No newline at end of file diff --git a/idea/testData/quickfix/supertypeInitialization/addParenthesisForSealedClass2.kt b/idea/testData/quickfix/supertypeInitialization/addParenthesisForSealedClass2.kt new file mode 100644 index 00000000000..a1fd9b71fa8 --- /dev/null +++ b/idea/testData/quickfix/supertypeInitialization/addParenthesisForSealedClass2.kt @@ -0,0 +1,8 @@ +// "Change to constructor invocation" "true" +// ACTION: Introduce import alias + +class My { + sealed class A + + class B : A +} diff --git a/idea/testData/quickfix/supertypeInitialization/addParenthesisForSealedClass2.kt.after b/idea/testData/quickfix/supertypeInitialization/addParenthesisForSealedClass2.kt.after new file mode 100644 index 00000000000..54451d5f1f8 --- /dev/null +++ b/idea/testData/quickfix/supertypeInitialization/addParenthesisForSealedClass2.kt.after @@ -0,0 +1,8 @@ +// "Change to constructor invocation" "true" +// ACTION: Introduce import alias + +class My { + sealed class A + + class B : A() +} diff --git a/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixTestGenerated.java index 524ed4f1a3a..a19d3bdbe5e 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixTestGenerated.java @@ -12509,11 +12509,6 @@ public class QuickFixTestGenerated extends AbstractQuickFixTest { runTest("idea/testData/quickfix/supertypeInitialization/addParenthesisForInvalidSealedClass.kt"); } - @TestMetadata("addParenthesisForInvalidSealedClass2.kt") - public void testAddParenthesisForInvalidSealedClass2() throws Exception { - runTest("idea/testData/quickfix/supertypeInitialization/addParenthesisForInvalidSealedClass2.kt"); - } - @TestMetadata("addParenthesisForLocalClass.kt") public void testAddParenthesisForLocalClass() throws Exception { runTest("idea/testData/quickfix/supertypeInitialization/addParenthesisForLocalClass.kt"); @@ -12529,6 +12524,11 @@ public class QuickFixTestGenerated extends AbstractQuickFixTest { runTest("idea/testData/quickfix/supertypeInitialization/addParenthesisForSealedClass.kt"); } + @TestMetadata("addParenthesisForSealedClass2.kt") + public void testAddParenthesisForSealedClass2() throws Exception { + runTest("idea/testData/quickfix/supertypeInitialization/addParenthesisForSealedClass2.kt"); + } + public void testAllFilesPresentInSupertypeInitialization() throws Exception { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/testData/quickfix/supertypeInitialization"), Pattern.compile("^([\\w\\-_]+)\\.kt$"), null, true); } From a6600cef474da9d54d9e2189aef2a4419a8ddf56 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Thu, 14 Jan 2021 10:33:54 +0300 Subject: [PATCH 115/212] [Test] Remove some outdated tests from LocalInspectionTestGenerated Those tests are referring to outdated language features which are meaningless for language version 1.5 --- .../conversionPerArgumentDisabled1.kt | 8 -------- .../conversionPerArgumentDisabled2.kt | 12 ----------- .../conversionPerArgumentDisabled3.kt | 8 -------- .../removeRedundantBackticks/underscore.kt | 8 -------- .../LocalInspectionTestGenerated.java | 20 ------------------- 5 files changed, 56 deletions(-) delete mode 100644 idea/testData/inspectionsLocal/redundantSamConstructor/conversionPerArgumentDisabled1.kt delete mode 100644 idea/testData/inspectionsLocal/redundantSamConstructor/conversionPerArgumentDisabled2.kt delete mode 100644 idea/testData/inspectionsLocal/redundantSamConstructor/conversionPerArgumentDisabled3.kt delete mode 100644 idea/testData/inspectionsLocal/removeRedundantBackticks/underscore.kt diff --git a/idea/testData/inspectionsLocal/redundantSamConstructor/conversionPerArgumentDisabled1.kt b/idea/testData/inspectionsLocal/redundantSamConstructor/conversionPerArgumentDisabled1.kt deleted file mode 100644 index de9ff4bbd7b..00000000000 --- a/idea/testData/inspectionsLocal/redundantSamConstructor/conversionPerArgumentDisabled1.kt +++ /dev/null @@ -1,8 +0,0 @@ -// COMPILER_ARGUMENTS: -XXLanguage:+NewInference -XXLanguage:+SamConversionForKotlinFunctions -XXLanguage:+FunctionalInterfaceConversion -XXLanguage:-SamConversionPerArgument -// PROBLEM: none - -fun test(r1: Runnable, r2: Runnable) {} - -fun usage(r1: Runnable) { - test(r1, Runnable {}) -} diff --git a/idea/testData/inspectionsLocal/redundantSamConstructor/conversionPerArgumentDisabled2.kt b/idea/testData/inspectionsLocal/redundantSamConstructor/conversionPerArgumentDisabled2.kt deleted file mode 100644 index 82ecff5437a..00000000000 --- a/idea/testData/inspectionsLocal/redundantSamConstructor/conversionPerArgumentDisabled2.kt +++ /dev/null @@ -1,12 +0,0 @@ -// COMPILER_ARGUMENTS: -XXLanguage:+NewInference -XXLanguage:+SamConversionForKotlinFunctions -XXLanguage:+FunctionalInterfaceConversion -XXLanguage:-SamConversionPerArgument -// PROBLEM: none - -fun interface KtRunnable { - fun run() -} - -fun test(r1: KtRunnable, r2: KtRunnable) {} - -fun usage(r1: KtRunnable) { - test(r1, KtRunnable {}) -} diff --git a/idea/testData/inspectionsLocal/redundantSamConstructor/conversionPerArgumentDisabled3.kt b/idea/testData/inspectionsLocal/redundantSamConstructor/conversionPerArgumentDisabled3.kt deleted file mode 100644 index 83b4b56f196..00000000000 --- a/idea/testData/inspectionsLocal/redundantSamConstructor/conversionPerArgumentDisabled3.kt +++ /dev/null @@ -1,8 +0,0 @@ -// COMPILER_ARGUMENTS: -XXLanguage:+NewInference -XXLanguage:+SamConversionForKotlinFunctions -XXLanguage:+FunctionalInterfaceConversion -XXLanguage:-SamConversionPerArgument -// PROBLEM: none - -fun test(r1: Runnable, r2: Runnable) {} - -fun usage() { - test(Runnable { return@Runnable }, Runnable {}) -} diff --git a/idea/testData/inspectionsLocal/removeRedundantBackticks/underscore.kt b/idea/testData/inspectionsLocal/removeRedundantBackticks/underscore.kt deleted file mode 100644 index 6e8ffeee49d..00000000000 --- a/idea/testData/inspectionsLocal/removeRedundantBackticks/underscore.kt +++ /dev/null @@ -1,8 +0,0 @@ -// PROBLEM: none - -fun test() { - try { - } catch (_: Throwable) { - `_`.printStackTrace() - } -} \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/idea/inspections/LocalInspectionTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/inspections/LocalInspectionTestGenerated.java index 0d671f91375..5815f98b6be 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/inspections/LocalInspectionTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/inspections/LocalInspectionTestGenerated.java @@ -8739,21 +8739,6 @@ public class LocalInspectionTestGenerated extends AbstractLocalInspectionTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/testData/inspectionsLocal/redundantSamConstructor"), Pattern.compile("^([\\w\\-_]+)\\.(kt|kts)$"), null, true); } - @TestMetadata("conversionPerArgumentDisabled1.kt") - public void testConversionPerArgumentDisabled1() throws Exception { - runTest("idea/testData/inspectionsLocal/redundantSamConstructor/conversionPerArgumentDisabled1.kt"); - } - - @TestMetadata("conversionPerArgumentDisabled2.kt") - public void testConversionPerArgumentDisabled2() throws Exception { - runTest("idea/testData/inspectionsLocal/redundantSamConstructor/conversionPerArgumentDisabled2.kt"); - } - - @TestMetadata("conversionPerArgumentDisabled3.kt") - public void testConversionPerArgumentDisabled3() throws Exception { - runTest("idea/testData/inspectionsLocal/redundantSamConstructor/conversionPerArgumentDisabled3.kt"); - } - @TestMetadata("conversionPerArgumentEnabled1.kt") public void testConversionPerArgumentEnabled1() throws Exception { runTest("idea/testData/inspectionsLocal/redundantSamConstructor/conversionPerArgumentEnabled1.kt"); @@ -9656,11 +9641,6 @@ public class LocalInspectionTestGenerated extends AbstractLocalInspectionTest { runTest("idea/testData/inspectionsLocal/removeRedundantBackticks/property.kt"); } - @TestMetadata("underscore.kt") - public void testUnderscore() throws Exception { - runTest("idea/testData/inspectionsLocal/removeRedundantBackticks/underscore.kt"); - } - @TestMetadata("underscores.kt") public void testUnderscores() throws Exception { runTest("idea/testData/inspectionsLocal/removeRedundantBackticks/underscores.kt"); From 6a2796b067c5265217fcec71dae92ef0e16e3863 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Thu, 14 Jan 2021 10:52:55 +0300 Subject: [PATCH 116/212] [Test] Fix source maps in testdata according to KT-37704 --- .../inlineCallInsideInlineLambda.kt | 8 +++----- .../codegen/boxInline/smap/anonymous/kt19175.kt | 3 +-- .../codegen/boxInline/smap/anonymous/lambda.kt | 1 - .../boxInline/smap/anonymous/lambdaOnCallSite.kt | 3 +-- .../smap/anonymous/lambdaOnInlineCallSite.kt | 5 ++--- .../codegen/boxInline/smap/anonymous/object.kt | 3 +-- .../boxInline/smap/anonymous/objectOnCallSite.kt | 3 +-- .../smap/anonymous/objectOnInlineCallSite.kt | 5 ++--- .../anonymous/severalMappingsForDefaultFile.kt | 4 +--- .../testData/codegen/boxInline/smap/assertion.kt | 7 +++---- .../codegen/boxInline/smap/classCycle.kt | 3 --- .../boxInline/smap/classFromDefaultPackage.kt | 3 +-- .../codegen/boxInline/smap/crossroutines.kt | 7 +++---- .../smap/defaultFunctionWithInlineCall.kt | 4 +--- .../defaultLambda/defaultLambdaInAnonymous.kt | 10 +++------- .../smap/defaultLambda/inlinInDefault.kt | 6 ++---- .../smap/defaultLambda/inlinInDefault2.kt | 6 ++---- .../defaultLambda/inlineAnonymousInDefault.kt | 9 +++------ .../defaultLambda/inlineAnonymousInDefault2.kt | 9 +++------ .../boxInline/smap/defaultLambda/kt21827.kt | 5 ++--- .../boxInline/smap/defaultLambda/nested.kt | 3 +-- .../boxInline/smap/defaultLambda/simple.kt | 3 +-- .../boxInline/smap/defaultLambda/simple2.kt | 5 ++--- .../codegen/boxInline/smap/inlineOnly/reified.kt | 3 +-- .../boxInline/smap/inlineOnly/reifiedProperty.kt | 3 +-- .../codegen/boxInline/smap/interleavedFiles.kt | 3 +-- .../testData/codegen/boxInline/smap/kt23369.kt | 3 +-- .../testData/codegen/boxInline/smap/kt23369_2.kt | 3 +-- .../testData/codegen/boxInline/smap/kt23369_3.kt | 3 +-- .../testData/codegen/boxInline/smap/kt35006.kt | 1 - .../codegen/boxInline/smap/multiFileFacade.kt | 4 +--- .../boxInline/smap/newsmap/differentMapping.kt | 7 +++---- .../smap/newsmap/mappingInInlineFunLambda.kt | 9 +++------ .../smap/newsmap/mappingInSubInlineLambda.kt | 8 +++----- .../mappingInSubInlineLambdaSameFileInline.kt | 8 +++----- .../testData/codegen/boxInline/smap/oneFile.kt | 3 +-- .../codegen/boxInline/smap/rangeFolding.kt | 4 +--- .../boxInline/smap/rangeFoldingInClass.kt | 2 -- .../boxInline/smap/resolve/inlineComponent.kt | 5 ++--- .../boxInline/smap/resolve/inlineIterator.kt | 1 - compiler/testData/codegen/boxInline/smap/smap.kt | 16 +++++++--------- 41 files changed, 69 insertions(+), 132 deletions(-) diff --git a/compiler/testData/codegen/boxInline/anonymousObject/inlineCallInsideInlineLambda.kt b/compiler/testData/codegen/boxInline/anonymousObject/inlineCallInsideInlineLambda.kt index 52d6d1efcd2..f8d3d179c08 100644 --- a/compiler/testData/codegen/boxInline/anonymousObject/inlineCallInsideInlineLambda.kt +++ b/compiler/testData/codegen/boxInline/anonymousObject/inlineCallInsideInlineLambda.kt @@ -47,13 +47,12 @@ test/B *L 1#1,19:1 13#2,2:20 -*E *S KotlinDebug *F + 1 2.kt _2Kt *L -9#1,2:20 +9#1:20,2 *E SMAP @@ -68,11 +67,10 @@ test/A *L 1#1,19:1 7#2,2:20 -*E *S KotlinDebug *F + 1 2.kt _2Kt$box$1$1 *L -11#1,2:20 -*E \ No newline at end of file +11#1:20,2 +*E diff --git a/compiler/testData/codegen/boxInline/smap/anonymous/kt19175.kt b/compiler/testData/codegen/boxInline/smap/anonymous/kt19175.kt index effe64c557e..e7aeaec4f71 100644 --- a/compiler/testData/codegen/boxInline/smap/anonymous/kt19175.kt +++ b/compiler/testData/codegen/boxInline/smap/anonymous/kt19175.kt @@ -56,7 +56,6 @@ test/Introspector$SchemaRetriever *L 1#1,21:1 8#2:22 -*E *S KotlinDebug *F + 1 2.kt @@ -77,4 +76,4 @@ IntrospectorImpl$SchemaRetriever *L 1#1,12:1 9#2:13 -*E \ No newline at end of file +*E diff --git a/compiler/testData/codegen/boxInline/smap/anonymous/lambda.kt b/compiler/testData/codegen/boxInline/smap/anonymous/lambda.kt index 652017a989c..1690def94fa 100644 --- a/compiler/testData/codegen/boxInline/smap/anonymous/lambda.kt +++ b/compiler/testData/codegen/boxInline/smap/anonymous/lambda.kt @@ -56,7 +56,6 @@ builders/_1Kt *L 1#1,21:1 7#2:22 -*E *S KotlinDebug *F + 1 2.kt diff --git a/compiler/testData/codegen/boxInline/smap/anonymous/lambdaOnCallSite.kt b/compiler/testData/codegen/boxInline/smap/anonymous/lambdaOnCallSite.kt index 0510224c672..53e46025ae0 100644 --- a/compiler/testData/codegen/boxInline/smap/anonymous/lambdaOnCallSite.kt +++ b/compiler/testData/codegen/boxInline/smap/anonymous/lambdaOnCallSite.kt @@ -46,11 +46,10 @@ builders/_1Kt *L 1#1,23:1 7#2:24 -*E *S KotlinDebug *F + 1 2.kt _2Kt *L 9#1:24 -*E \ No newline at end of file +*E diff --git a/compiler/testData/codegen/boxInline/smap/anonymous/lambdaOnInlineCallSite.kt b/compiler/testData/codegen/boxInline/smap/anonymous/lambdaOnInlineCallSite.kt index c2d46b18725..949f01e9968 100644 --- a/compiler/testData/codegen/boxInline/smap/anonymous/lambdaOnInlineCallSite.kt +++ b/compiler/testData/codegen/boxInline/smap/anonymous/lambdaOnInlineCallSite.kt @@ -53,14 +53,13 @@ builders/_1Kt 10#1,6:30 7#2:25 7#2:29 -*E *S KotlinDebug *F + 1 2.kt _2Kt *L -20#1,3:26 -20#1,6:30 +20#1:26,3 +20#1:30,6 9#1:25 20#1:29 *E diff --git a/compiler/testData/codegen/boxInline/smap/anonymous/object.kt b/compiler/testData/codegen/boxInline/smap/anonymous/object.kt index abda5de5a05..5e410c30c0a 100644 --- a/compiler/testData/codegen/boxInline/smap/anonymous/object.kt +++ b/compiler/testData/codegen/boxInline/smap/anonymous/object.kt @@ -59,13 +59,12 @@ builders/_1Kt *L 1#1,22:1 7#2,5:23 -*E *S KotlinDebug *F + 1 2.kt _2Kt *L -9#1,5:23 +9#1:23,5 *E SMAP diff --git a/compiler/testData/codegen/boxInline/smap/anonymous/objectOnCallSite.kt b/compiler/testData/codegen/boxInline/smap/anonymous/objectOnCallSite.kt index 881bf7312ec..eabbb2ea24c 100644 --- a/compiler/testData/codegen/boxInline/smap/anonymous/objectOnCallSite.kt +++ b/compiler/testData/codegen/boxInline/smap/anonymous/objectOnCallSite.kt @@ -49,11 +49,10 @@ builders/_1Kt *L 1#1,26:1 7#2:27 -*E *S KotlinDebug *F + 1 2.kt _2Kt *L 9#1:27 -*E \ No newline at end of file +*E diff --git a/compiler/testData/codegen/boxInline/smap/anonymous/objectOnInlineCallSite.kt b/compiler/testData/codegen/boxInline/smap/anonymous/objectOnInlineCallSite.kt index 003692af4e2..fae9a58df06 100644 --- a/compiler/testData/codegen/boxInline/smap/anonymous/objectOnInlineCallSite.kt +++ b/compiler/testData/codegen/boxInline/smap/anonymous/objectOnInlineCallSite.kt @@ -54,14 +54,13 @@ builders/_1Kt 10#1,8:32 7#2:27 7#2:31 -*E *S KotlinDebug *F + 1 2.kt _2Kt *L -22#1,3:28 -22#1,8:32 +22#1:28,3 +22#1:32,8 9#1:27 22#1:31 *E diff --git a/compiler/testData/codegen/boxInline/smap/anonymous/severalMappingsForDefaultFile.kt b/compiler/testData/codegen/boxInline/smap/anonymous/severalMappingsForDefaultFile.kt index 03c7864a230..544454d615c 100644 --- a/compiler/testData/codegen/boxInline/smap/anonymous/severalMappingsForDefaultFile.kt +++ b/compiler/testData/codegen/boxInline/smap/anonymous/severalMappingsForDefaultFile.kt @@ -46,7 +46,6 @@ test/_1Kt 1#1,18:1 10#2:19 6#2:20 -*E *S KotlinDebug *F + 1 2.kt @@ -73,7 +72,6 @@ _2Kt 10#2:20 15#2:22 7#3:21 -*E *S KotlinDebug *F + 1 1.kt @@ -81,4 +79,4 @@ test/_1Kt$annotatedWith2$1 *L 6#1:19 6#1:22 -*E \ No newline at end of file +*E diff --git a/compiler/testData/codegen/boxInline/smap/assertion.kt b/compiler/testData/codegen/boxInline/smap/assertion.kt index 1ea060dc8ee..779611b7b2c 100644 --- a/compiler/testData/codegen/boxInline/smap/assertion.kt +++ b/compiler/testData/codegen/boxInline/smap/assertion.kt @@ -53,12 +53,11 @@ test/_1Kt 1#1,14:1 18#2,7:15 9#2,7:22 -*E *S KotlinDebug *F + 1 2.kt _2Kt *L -6#1,7:15 -7#1,7:22 -*E \ No newline at end of file +6#1:15,7 +7#1:22,7 +*E diff --git a/compiler/testData/codegen/boxInline/smap/classCycle.kt b/compiler/testData/codegen/boxInline/smap/classCycle.kt index e0af8c1e80c..7c6f7ac5bf9 100644 --- a/compiler/testData/codegen/boxInline/smap/classCycle.kt +++ b/compiler/testData/codegen/boxInline/smap/classCycle.kt @@ -30,7 +30,6 @@ test/A 1#1,14:1 11#1:16 6#2:15 -*E *S KotlinDebug *F + 1 1.kt @@ -55,7 +54,6 @@ test/B 10#2:15 11#2:17 11#2:18 -*E *S KotlinDebug *F + 1 1.kt @@ -85,7 +83,6 @@ test/B 6#2:9 10#3:8 11#3:10 -*E *S KotlinDebug *F + 1 2.kt diff --git a/compiler/testData/codegen/boxInline/smap/classFromDefaultPackage.kt b/compiler/testData/codegen/boxInline/smap/classFromDefaultPackage.kt index 8e1691d5627..fe9b11919d2 100644 --- a/compiler/testData/codegen/boxInline/smap/classFromDefaultPackage.kt +++ b/compiler/testData/codegen/boxInline/smap/classFromDefaultPackage.kt @@ -26,11 +26,10 @@ A *L 1#1,9:1 4#2:10 -*E *S KotlinDebug *F + 1 2.kt _2Kt *L 4#1:10 -*E \ No newline at end of file +*E diff --git a/compiler/testData/codegen/boxInline/smap/crossroutines.kt b/compiler/testData/codegen/boxInline/smap/crossroutines.kt index 787edabc791..23b3608f04c 100644 --- a/compiler/testData/codegen/boxInline/smap/crossroutines.kt +++ b/compiler/testData/codegen/boxInline/smap/crossroutines.kt @@ -96,14 +96,13 @@ test/_1Kt 1#1,29:1 12#2,5:30 19#2,3:35 -*E *S KotlinDebug *F + 1 2.kt _2Kt$box$1 *L -19#1,5:30 -22#1,3:35 +19#1:30,5 +22#1:35,3 *E SMAP @@ -132,4 +131,4 @@ _2Kt$box$1 *L 1#1,23:1 20#2,2:24 -*E \ No newline at end of file +*E diff --git a/compiler/testData/codegen/boxInline/smap/defaultFunctionWithInlineCall.kt b/compiler/testData/codegen/boxInline/smap/defaultFunctionWithInlineCall.kt index a9f655ae4d2..cab3ac62c0d 100644 --- a/compiler/testData/codegen/boxInline/smap/defaultFunctionWithInlineCall.kt +++ b/compiler/testData/codegen/boxInline/smap/defaultFunctionWithInlineCall.kt @@ -29,7 +29,6 @@ test/_1Kt *L 1#1,14:1 5#1:15 -*E *S KotlinDebug *F + 1 1.kt @@ -52,12 +51,11 @@ test/_1Kt 1#1,8:1 8#2,4:9 5#2:13 -*E *S KotlinDebug *F + 1 2.kt _2Kt *L -5#1,4:9 +5#1:9,4 5#1:13 *E diff --git a/compiler/testData/codegen/boxInline/smap/defaultLambda/defaultLambdaInAnonymous.kt b/compiler/testData/codegen/boxInline/smap/defaultLambda/defaultLambdaInAnonymous.kt index 92497a2de52..c06c6e1ecb2 100644 --- a/compiler/testData/codegen/boxInline/smap/defaultLambda/defaultLambdaInAnonymous.kt +++ b/compiler/testData/codegen/boxInline/smap/defaultLambda/defaultLambdaInAnonymous.kt @@ -67,7 +67,6 @@ test/_1Kt *L 1#1,39:1 30#2:40 -*E *S KotlinDebug *F + 1 1.kt @@ -118,13 +117,12 @@ test/_1Kt$lParams$1 1#1,8:1 32#2,5:9 33#3:14 -*E *S KotlinDebug *F + 1 2.kt _2Kt *L -5#1,5:9 +5#1:9,5 5#1:14 *E @@ -145,13 +143,12 @@ test/_1Kt$lParams$1 1#1,8:1 32#2,5:9 33#3:14 -*E *S KotlinDebug *F + 1 2.kt _2Kt *L -5#1,5:9 +5#1:9,5 5#1:14 *E @@ -167,7 +164,6 @@ test/_1Kt *L 1#1,39:1 30#2:40 -*E *S KotlinDebug *F + 1 1.kt @@ -188,4 +184,4 @@ test/_1Kt$lParams$1$1 *L 1#1,39:1 33#2:40 -*E \ No newline at end of file +*E diff --git a/compiler/testData/codegen/boxInline/smap/defaultLambda/inlinInDefault.kt b/compiler/testData/codegen/boxInline/smap/defaultLambda/inlinInDefault.kt index ba999813acc..b6925a7206a 100644 --- a/compiler/testData/codegen/boxInline/smap/defaultLambda/inlinInDefault.kt +++ b/compiler/testData/codegen/boxInline/smap/defaultLambda/inlinInDefault.kt @@ -58,7 +58,6 @@ test/_1Kt *L 1#1,39:1 30#2:40 -*E *S KotlinDebug *F + 1 1.kt @@ -85,13 +84,12 @@ test/_1Kt$lParams$1 32#2,5:11 30#2:17 33#3:16 -*E *S KotlinDebug *F + 1 2.kt _2Kt *L -6#1,5:11 +6#1:11,5 6#1:17 6#1:16 -*E \ No newline at end of file +*E diff --git a/compiler/testData/codegen/boxInline/smap/defaultLambda/inlinInDefault2.kt b/compiler/testData/codegen/boxInline/smap/defaultLambda/inlinInDefault2.kt index 292de81ad16..9deda9047a2 100644 --- a/compiler/testData/codegen/boxInline/smap/defaultLambda/inlinInDefault2.kt +++ b/compiler/testData/codegen/boxInline/smap/defaultLambda/inlinInDefault2.kt @@ -94,7 +94,6 @@ test/_1Kt *L 1#1,75:1 30#2:76 -*E *S KotlinDebug *F + 1 1.kt @@ -122,14 +121,13 @@ test/_1Kt$lParams$1 71#2,2:12 30#2:15 51#3:14 -*E *S KotlinDebug *F + 1 2.kt _2Kt *L 6#1:11 -6#1,2:12 +6#1:12,2 6#1:15 6#1:14 -*E \ No newline at end of file +*E diff --git a/compiler/testData/codegen/boxInline/smap/defaultLambda/inlineAnonymousInDefault.kt b/compiler/testData/codegen/boxInline/smap/defaultLambda/inlineAnonymousInDefault.kt index 5f9c5c57a75..a5496dd3c34 100644 --- a/compiler/testData/codegen/boxInline/smap/defaultLambda/inlineAnonymousInDefault.kt +++ b/compiler/testData/codegen/boxInline/smap/defaultLambda/inlineAnonymousInDefault.kt @@ -57,7 +57,6 @@ test/_1Kt *L 1#1,40:1 31#2:41 -*E *S KotlinDebug *F + 1 1.kt @@ -109,13 +108,12 @@ test/_1Kt$lParams$1 33#2,5:9 31#2:15 34#3:14 -*E *S KotlinDebug *F + 1 2.kt _2Kt *L -5#1,5:9 +5#1:9,5 5#1:15 5#1:14 *E @@ -138,13 +136,12 @@ test/_1Kt$lParams$1 33#2,5:9 31#2:15 34#3:14 -*E *S KotlinDebug *F + 1 2.kt _2Kt *L -5#1,5:9 +5#1:9,5 5#1:15 5#1:14 *E @@ -161,4 +158,4 @@ test/_1Kt$lParams$1 *L 1#1,40:1 34#2:41 -*E \ No newline at end of file +*E diff --git a/compiler/testData/codegen/boxInline/smap/defaultLambda/inlineAnonymousInDefault2.kt b/compiler/testData/codegen/boxInline/smap/defaultLambda/inlineAnonymousInDefault2.kt index 6aff50bbdbb..e4a0d619da3 100644 --- a/compiler/testData/codegen/boxInline/smap/defaultLambda/inlineAnonymousInDefault2.kt +++ b/compiler/testData/codegen/boxInline/smap/defaultLambda/inlineAnonymousInDefault2.kt @@ -59,7 +59,6 @@ test/_1Kt *L 1#1,40:1 31#2:41 -*E *S KotlinDebug *F + 1 1.kt @@ -111,13 +110,12 @@ test/_1Kt$lParams$1 33#2,5:11 31#2:17 34#3:16 -*E *S KotlinDebug *F + 1 2.kt _2Kt *L -6#1,5:11 +6#1:11,5 6#1:17 6#1:16 *E @@ -139,13 +137,12 @@ test/_1Kt$lParams$1 33#2,5:11 31#2:17 34#3:16 -*E *S KotlinDebug *F + 1 2.kt _2Kt *L -6#1,5:11 +6#1:11,5 6#1:17 6#1:16 *E @@ -162,4 +159,4 @@ test/_1Kt$lParams$1 *L 1#1,40:1 34#2:41 -*E \ No newline at end of file +*E diff --git a/compiler/testData/codegen/boxInline/smap/defaultLambda/kt21827.kt b/compiler/testData/codegen/boxInline/smap/defaultLambda/kt21827.kt index a8181437f6b..793f1f6f49d 100644 --- a/compiler/testData/codegen/boxInline/smap/defaultLambda/kt21827.kt +++ b/compiler/testData/codegen/boxInline/smap/defaultLambda/kt21827.kt @@ -73,12 +73,11 @@ test/_1Kt$lParams$1 1#1,10:1 31#2,5:11 32#3:16 -*E *S KotlinDebug *F + 1 2.kt _2Kt *L -6#1,5:11 +6#1:11,5 6#1:16 -*E \ No newline at end of file +*E diff --git a/compiler/testData/codegen/boxInline/smap/defaultLambda/nested.kt b/compiler/testData/codegen/boxInline/smap/defaultLambda/nested.kt index 59fd3929bde..ba04e586364 100644 --- a/compiler/testData/codegen/boxInline/smap/defaultLambda/nested.kt +++ b/compiler/testData/codegen/boxInline/smap/defaultLambda/nested.kt @@ -55,13 +55,12 @@ test/_1Kt *L 1#1,9:1 7#2,2:10 -*E *S KotlinDebug *F + 1 2.kt _2Kt *L -6#1,2:10 +6#1:10,2 *E SMAP diff --git a/compiler/testData/codegen/boxInline/smap/defaultLambda/simple.kt b/compiler/testData/codegen/boxInline/smap/defaultLambda/simple.kt index 410ca97bc99..e54918f3aaa 100644 --- a/compiler/testData/codegen/boxInline/smap/defaultLambda/simple.kt +++ b/compiler/testData/codegen/boxInline/smap/defaultLambda/simple.kt @@ -45,12 +45,11 @@ test/_1Kt$inlineFun$1 1#1,9:1 7#2,2:10 7#3:12 -*E *S KotlinDebug *F + 1 2.kt _2Kt *L -6#1,2:10 +6#1:10,2 6#1:12 *E diff --git a/compiler/testData/codegen/boxInline/smap/defaultLambda/simple2.kt b/compiler/testData/codegen/boxInline/smap/defaultLambda/simple2.kt index 92516833845..82d37489a0e 100644 --- a/compiler/testData/codegen/boxInline/smap/defaultLambda/simple2.kt +++ b/compiler/testData/codegen/boxInline/smap/defaultLambda/simple2.kt @@ -71,12 +71,11 @@ test/_1Kt$lParams$1 1#1,8:1 31#2,5:9 32#3:14 -*E *S KotlinDebug *F + 1 2.kt _2Kt *L -5#1,5:9 +5#1:9,5 5#1:14 -*E \ No newline at end of file +*E diff --git a/compiler/testData/codegen/boxInline/smap/inlineOnly/reified.kt b/compiler/testData/codegen/boxInline/smap/inlineOnly/reified.kt index 6294cba14ae..c12d2cdc6bf 100644 --- a/compiler/testData/codegen/boxInline/smap/inlineOnly/reified.kt +++ b/compiler/testData/codegen/boxInline/smap/inlineOnly/reified.kt @@ -30,11 +30,10 @@ test/_1Kt *L 1#1,12:1 6#2:13 -*E *S KotlinDebug *F + 1 2.kt _2Kt *L 6#1:13 -*E \ No newline at end of file +*E diff --git a/compiler/testData/codegen/boxInline/smap/inlineOnly/reifiedProperty.kt b/compiler/testData/codegen/boxInline/smap/inlineOnly/reifiedProperty.kt index 2b8886c7666..cee0ed27120 100644 --- a/compiler/testData/codegen/boxInline/smap/inlineOnly/reifiedProperty.kt +++ b/compiler/testData/codegen/boxInline/smap/inlineOnly/reifiedProperty.kt @@ -30,11 +30,10 @@ test/_1Kt *L 1#1,12:1 6#2:13 -*E *S KotlinDebug *F + 1 2.kt _2Kt *L 6#1:13 -*E \ No newline at end of file +*E diff --git a/compiler/testData/codegen/boxInline/smap/interleavedFiles.kt b/compiler/testData/codegen/boxInline/smap/interleavedFiles.kt index e86b9d6aa02..0ad34b218a5 100644 --- a/compiler/testData/codegen/boxInline/smap/interleavedFiles.kt +++ b/compiler/testData/codegen/boxInline/smap/interleavedFiles.kt @@ -40,7 +40,6 @@ test/_1Kt 4#2:18 4#2:20 4#2:22 -*E *S KotlinDebug *F + 1 2.kt @@ -49,7 +48,7 @@ _2Kt 8#1:19 13#1:21 13#1:23 -13#1,7:24 +13#1:24,7 7#1:18 9#1:20 13#1:22 diff --git a/compiler/testData/codegen/boxInline/smap/kt23369.kt b/compiler/testData/codegen/boxInline/smap/kt23369.kt index 319de860248..ad4dc7aacb1 100644 --- a/compiler/testData/codegen/boxInline/smap/kt23369.kt +++ b/compiler/testData/codegen/boxInline/smap/kt23369.kt @@ -30,11 +30,10 @@ test/_1_aKt *L 1#1,8:1 7#2:9 -*E *S KotlinDebug *F + 1 2.kt _2Kt *L 5#1:9 -*E \ No newline at end of file +*E diff --git a/compiler/testData/codegen/boxInline/smap/kt23369_2.kt b/compiler/testData/codegen/boxInline/smap/kt23369_2.kt index c61d7a7d015..5056bf17280 100644 --- a/compiler/testData/codegen/boxInline/smap/kt23369_2.kt +++ b/compiler/testData/codegen/boxInline/smap/kt23369_2.kt @@ -30,11 +30,10 @@ test/_1__aKt *L 1#1,8:1 7#2:9 -*E *S KotlinDebug *F + 1 2.kt _2Kt *L 5#1:9 -*E \ No newline at end of file +*E diff --git a/compiler/testData/codegen/boxInline/smap/kt23369_3.kt b/compiler/testData/codegen/boxInline/smap/kt23369_3.kt index 3205f481144..9cdb1363488 100644 --- a/compiler/testData/codegen/boxInline/smap/kt23369_3.kt +++ b/compiler/testData/codegen/boxInline/smap/kt23369_3.kt @@ -30,11 +30,10 @@ test/__aKt *L 1#1,8:1 7#2:9 -*E *S KotlinDebug *F + 1 2.kt _2Kt *L 5#1:9 -*E \ No newline at end of file +*E diff --git a/compiler/testData/codegen/boxInline/smap/kt35006.kt b/compiler/testData/codegen/boxInline/smap/kt35006.kt index fb239d66949..6c4480ed3f8 100644 --- a/compiler/testData/codegen/boxInline/smap/kt35006.kt +++ b/compiler/testData/codegen/boxInline/smap/kt35006.kt @@ -32,7 +32,6 @@ test/_1Kt 5#2:13 4#2:14 4#2:15 -*E *S KotlinDebug *F + 1 2.kt diff --git a/compiler/testData/codegen/boxInline/smap/multiFileFacade.kt b/compiler/testData/codegen/boxInline/smap/multiFileFacade.kt index ae3a53db870..257424317e4 100644 --- a/compiler/testData/codegen/boxInline/smap/multiFileFacade.kt +++ b/compiler/testData/codegen/boxInline/smap/multiFileFacade.kt @@ -25,7 +25,6 @@ Facade___1Kt *L 1#1,13:1 8#1:14 -*E *S KotlinDebug *F + 1 1.kt @@ -47,11 +46,10 @@ Facade___1Kt *L 1#1,5:1 8#2:6 -*E *S KotlinDebug *F + 1 2.kt _2Kt *L 3#1:6 -*E \ No newline at end of file +*E diff --git a/compiler/testData/codegen/boxInline/smap/newsmap/differentMapping.kt b/compiler/testData/codegen/boxInline/smap/newsmap/differentMapping.kt index 34739c8c2b8..6806931d187 100644 --- a/compiler/testData/codegen/boxInline/smap/newsmap/differentMapping.kt +++ b/compiler/testData/codegen/boxInline/smap/newsmap/differentMapping.kt @@ -44,12 +44,11 @@ test/_1Kt 1#1,18:1 7#2,4:19 7#2,4:23 -*E *S KotlinDebug *F + 1 2.kt _2Kt *L -7#1,4:19 -11#1,4:23 -*E \ No newline at end of file +7#1:19,4 +11#1:23,4 +*E diff --git a/compiler/testData/codegen/boxInline/smap/newsmap/mappingInInlineFunLambda.kt b/compiler/testData/codegen/boxInline/smap/newsmap/mappingInInlineFunLambda.kt index be59b950177..605f24a02ad 100644 --- a/compiler/testData/codegen/boxInline/smap/newsmap/mappingInInlineFunLambda.kt +++ b/compiler/testData/codegen/boxInline/smap/newsmap/mappingInInlineFunLambda.kt @@ -44,13 +44,12 @@ test/_1Kt *L 1#1,19:1 7#2,3:20 -*E *S KotlinDebug *F + 1 1.kt test/_1Kt$test$1 *L -14#1,3:20 +14#1:20,3 *E @@ -68,13 +67,12 @@ test/_1Kt *L 1#1,16:1 12#2,6:17 -*E *S KotlinDebug *F + 1 2.kt _2Kt *L -8#1,6:17 +8#1:17,6 *E SMAP @@ -93,12 +91,11 @@ _2Kt 7#2,2:20 9#2:24 9#3,2:22 -*E *S KotlinDebug *F + 1 1.kt test/_1Kt$test$1 *L -14#1,2:20 +14#1:20,2 14#1:24 *E diff --git a/compiler/testData/codegen/boxInline/smap/newsmap/mappingInSubInlineLambda.kt b/compiler/testData/codegen/boxInline/smap/newsmap/mappingInSubInlineLambda.kt index ac06630bb4d..7f7c70cc6f6 100644 --- a/compiler/testData/codegen/boxInline/smap/newsmap/mappingInSubInlineLambda.kt +++ b/compiler/testData/codegen/boxInline/smap/newsmap/mappingInSubInlineLambda.kt @@ -50,13 +50,12 @@ test/_1Kt *L 1#1,20:1 7#2,4:21 -*E *S KotlinDebug *F + 1 2.kt _2Kt *L -8#1,4:21 +8#1:21,4 *E SMAP @@ -71,11 +70,10 @@ test/_1Kt *L 1#1,20:1 13#2,3:21 -*E *S KotlinDebug *F + 1 2.kt _2Kt$box$1$1 *L -10#1,3:21 -*E \ No newline at end of file +10#1:21,3 +*E diff --git a/compiler/testData/codegen/boxInline/smap/newsmap/mappingInSubInlineLambdaSameFileInline.kt b/compiler/testData/codegen/boxInline/smap/newsmap/mappingInSubInlineLambdaSameFileInline.kt index 7cc7ac7e159..22e52e09da1 100644 --- a/compiler/testData/codegen/boxInline/smap/newsmap/mappingInSubInlineLambdaSameFileInline.kt +++ b/compiler/testData/codegen/boxInline/smap/newsmap/mappingInSubInlineLambdaSameFileInline.kt @@ -50,13 +50,12 @@ test/_1Kt *L 1#1,26:1 7#2,4:27 -*E *S KotlinDebug *F + 1 2.kt _2Kt *L -14#1,4:27 +14#1:27,4 *E SMAP @@ -71,11 +70,10 @@ _2Kt *L 1#1,26:1 6#2,3:27 -*E *S KotlinDebug *F + 1 2.kt _2Kt$box$1$1 *L -16#1,3:27 -*E \ No newline at end of file +16#1:27,3 +*E diff --git a/compiler/testData/codegen/boxInline/smap/oneFile.kt b/compiler/testData/codegen/boxInline/smap/oneFile.kt index e725aacd9d6..df2e0247903 100644 --- a/compiler/testData/codegen/boxInline/smap/oneFile.kt +++ b/compiler/testData/codegen/boxInline/smap/oneFile.kt @@ -34,11 +34,10 @@ _2Kt *L 1#1,15:1 10#1,3:16 -*E *S KotlinDebug *F + 1 2.kt _2Kt *L -4#1,3:16 +4#1:16,3 *E diff --git a/compiler/testData/codegen/boxInline/smap/rangeFolding.kt b/compiler/testData/codegen/boxInline/smap/rangeFolding.kt index 393f78582b6..6856000760d 100644 --- a/compiler/testData/codegen/boxInline/smap/rangeFolding.kt +++ b/compiler/testData/codegen/boxInline/smap/rangeFolding.kt @@ -40,7 +40,6 @@ test/_1Kt 4#1:15 6#1:16 5#1:17 -*E *S KotlinDebug *F + 1 1.kt @@ -65,12 +64,11 @@ test/_1Kt 1#1,17:1 9#2:18 4#2,9:19 -*E *S KotlinDebug *F + 1 2.kt _2Kt *L 13#1:18 -13#1,9:19 +13#1:19,9 *E diff --git a/compiler/testData/codegen/boxInline/smap/rangeFoldingInClass.kt b/compiler/testData/codegen/boxInline/smap/rangeFoldingInClass.kt index 506ce7b72f2..c1112c9549b 100644 --- a/compiler/testData/codegen/boxInline/smap/rangeFoldingInClass.kt +++ b/compiler/testData/codegen/boxInline/smap/rangeFoldingInClass.kt @@ -48,7 +48,6 @@ test/B 4#2:17 6#3:18 5#4:19 -*E *S KotlinDebug *F + 1 1.kt @@ -84,7 +83,6 @@ test/B 4#3:19 6#4:21 5#5:23 -*E *S KotlinDebug *F + 1 2.kt diff --git a/compiler/testData/codegen/boxInline/smap/resolve/inlineComponent.kt b/compiler/testData/codegen/boxInline/smap/resolve/inlineComponent.kt index 8d51446ddad..499cbff507e 100644 --- a/compiler/testData/codegen/boxInline/smap/resolve/inlineComponent.kt +++ b/compiler/testData/codegen/boxInline/smap/resolve/inlineComponent.kt @@ -34,11 +34,10 @@ zzz/_1Kt *L 1#1,11:1 7#2,3:12 -*E *S KotlinDebug *F + 1 2.kt _2Kt *L -6#1,3:12 -*E \ No newline at end of file +6#1:12,3 +*E diff --git a/compiler/testData/codegen/boxInline/smap/resolve/inlineIterator.kt b/compiler/testData/codegen/boxInline/smap/resolve/inlineIterator.kt index e2453a51e19..031109f2e5b 100644 --- a/compiler/testData/codegen/boxInline/smap/resolve/inlineIterator.kt +++ b/compiler/testData/codegen/boxInline/smap/resolve/inlineIterator.kt @@ -35,7 +35,6 @@ zzz/_1Kt *L 1#1,14:1 7#2:15 -*E *S KotlinDebug *F + 1 2.kt diff --git a/compiler/testData/codegen/boxInline/smap/smap.kt b/compiler/testData/codegen/boxInline/smap/smap.kt index 80b8b2f570a..ba121ab90b2 100644 --- a/compiler/testData/codegen/boxInline/smap/smap.kt +++ b/compiler/testData/codegen/boxInline/smap/smap.kt @@ -56,14 +56,13 @@ builders/_1Kt 1#1,22:1 11#1,3:23 7#1,2:26 -*E *S KotlinDebug *F + 1 1.kt builders/_1Kt *L -15#1,3:23 -19#1,2:26 +15#1:23,3 +19#1:26,2 *E // FILE: 2.smap @@ -96,26 +95,25 @@ builders/_1Kt 11#2,2:40 13#2:44 8#2:46 -*E *S KotlinDebug *F + 1 2.kt _2Kt *L -20#1,3:33 +20#1:33,3 20#1:38 -20#1,2:42 +20#1:42,2 20#1:45 20#1:47 9#1:26 9#1:27 10#1:28 -10#1,3:29 +10#1:29,3 9#1:32 20#1:36 20#1:37 20#1:39 -20#1,2:40 +20#1:40,2 20#1:44 20#1:46 -*E \ No newline at end of file +*E From 81fd8b5940957e6c0c80c8cc08e64529eeb40ab9 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Thu, 14 Jan 2021 14:31:09 +0300 Subject: [PATCH 117/212] [IR] Fix undeterministic order in signature clash reporting --- .../jvm/codegen/JvmSignatureClashDetector.kt | 8 ++++---- ...ticAccessorForPropertiesSignatureClash.out | 16 +++++++-------- ...icAccessorPropertyAndFunSignatureClash.out | 20 +++++++++---------- .../jvm/syntheticAccessorSignatureClash.out | 20 +++++++++---------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/JvmSignatureClashDetector.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/JvmSignatureClashDetector.kt index 7939eac6f85..e5a735952f6 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/JvmSignatureClashDetector.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/JvmSignatureClashDetector.kt @@ -22,8 +22,8 @@ class JvmSignatureClashDetector( private val type: Type, private val context: JvmBackendContext ) { - private val methodsBySignature = HashMap>() - private val fieldsBySignature = HashMap>() + private val methodsBySignature = LinkedHashMap>() + private val fieldsBySignature = LinkedHashMap>() fun trackField(irField: IrField, rawSignature: RawSignature) { fieldsBySignature.getOrPut(rawSignature) { SmartSet.create() }.add(irField) @@ -49,7 +49,7 @@ class JvmSignatureClashDetector( } private fun getOverriddenFunctions(irFunction: IrSimpleFunction): Set { - val result = HashSet() + val result = LinkedHashSet() collectOverridesOf(irFunction, result) return result } @@ -146,7 +146,7 @@ class JvmSignatureClashDetector( irDeclarations: Collection, conflictingJvmDeclarationsData: ConflictingJvmDeclarationsData ) { - val psiElements = irDeclarations.mapNotNullTo(HashSet()) { it.getElementForDiagnostics() } + val psiElements = irDeclarations.mapNotNullTo(LinkedHashSet()) { it.getElementForDiagnostics() } for (psiElement in psiElements) { context.psiErrorBuilder.at(psiElement) .report(diagnosticFactory1, conflictingJvmDeclarationsData) diff --git a/compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.out b/compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.out index a060e2b4509..28ecabd8855 100644 --- a/compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.out +++ b/compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.out @@ -1,6 +1,6 @@ -compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.kt:1:7: error: platform declaration clash: The following declarations have the same JVM signature (access$getFoo$cp()I): - fun `access$getFoo$cp`(): Int defined in A - fun `access$getFoo$cp`(): Int defined in A +compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.kt:1:7: error: platform declaration clash: The following declarations have the same JVM signature (access$getFoo$p(LA;)I): + fun `access$getFoo$p`(`$this`: A): Int defined in A + fun `access$getFoo$p`(a: A): Int defined in A class A { ^ compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.kt:1:7: error: platform declaration clash: The following declarations have the same JVM signature (access$setFoo$p(LA;I)V): @@ -8,16 +8,16 @@ compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.kt:1:7: e fun `access$setFoo$p`(a: A, d: Int): Unit defined in A class A { ^ +compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.kt:1:7: error: platform declaration clash: The following declarations have the same JVM signature (access$getFoo$cp()I): + fun `access$getFoo$cp`(): Int defined in A + fun `access$getFoo$cp`(): Int defined in A +class A { + ^ compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.kt:1:7: error: platform declaration clash: The following declarations have the same JVM signature (access$setFoo$cp(I)V): fun `access$setFoo$cp`(``: Int): Unit defined in A fun `access$setFoo$cp`(d: Int): Unit defined in A class A { ^ -compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.kt:1:7: error: platform declaration clash: The following declarations have the same JVM signature (access$getFoo$p(LA;)I): - fun `access$getFoo$p`(`$this`: A): Int defined in A - fun `access$getFoo$p`(a: A): Int defined in A -class A { - ^ compiler/testData/cli/jvm/syntheticAccessorForPropertiesSignatureClash.kt:5:5: error: platform declaration clash: The following declarations have the same JVM signature (access$getFoo$p(LA;)I): fun `access$getFoo$p`(`$this`: A): Int defined in A fun `access$getFoo$p`(a: A): Int defined in A diff --git a/compiler/testData/cli/jvm/syntheticAccessorPropertyAndFunSignatureClash.out b/compiler/testData/cli/jvm/syntheticAccessorPropertyAndFunSignatureClash.out index 1b132b195d9..623e736c7a2 100644 --- a/compiler/testData/cli/jvm/syntheticAccessorPropertyAndFunSignatureClash.out +++ b/compiler/testData/cli/jvm/syntheticAccessorPropertyAndFunSignatureClash.out @@ -1,3 +1,13 @@ +compiler/testData/cli/jvm/syntheticAccessorPropertyAndFunSignatureClash.kt:1:7: error: platform declaration clash: The following declarations have the same JVM signature (access$getFoo$p(LA;)I): + fun `access$getFoo$p`(`$this`: A): Int defined in A + fun `access$getFoo$p`(a: A): Int defined in A +class A { + ^ +compiler/testData/cli/jvm/syntheticAccessorPropertyAndFunSignatureClash.kt:1:7: error: platform declaration clash: The following declarations have the same JVM signature (access$setFoo$p(LA;I)V): + fun `access$setFoo$p`(`$this`: A, ``: Int): Unit defined in A + fun `access$setFoo$p`(a: A, d: Int): Unit defined in A +class A { + ^ compiler/testData/cli/jvm/syntheticAccessorPropertyAndFunSignatureClash.kt:1:7: error: platform declaration clash: The following declarations have the same JVM signature (access$getFoo(LA;)I): fun `access$getFoo`(`$this`: A): Int defined in A fun `access$getFoo`(a: A): Int defined in A @@ -8,16 +18,6 @@ compiler/testData/cli/jvm/syntheticAccessorPropertyAndFunSignatureClash.kt:1:7: fun `access$setFoo`(a: A, d: Int): Unit defined in A class A { ^ -compiler/testData/cli/jvm/syntheticAccessorPropertyAndFunSignatureClash.kt:1:7: error: platform declaration clash: The following declarations have the same JVM signature (access$setFoo$p(LA;I)V): - fun `access$setFoo$p`(`$this`: A, ``: Int): Unit defined in A - fun `access$setFoo$p`(a: A, d: Int): Unit defined in A -class A { - ^ -compiler/testData/cli/jvm/syntheticAccessorPropertyAndFunSignatureClash.kt:1:7: error: platform declaration clash: The following declarations have the same JVM signature (access$getFoo$p(LA;)I): - fun `access$getFoo$p`(`$this`: A): Int defined in A - fun `access$getFoo$p`(a: A): Int defined in A -class A { - ^ compiler/testData/cli/jvm/syntheticAccessorPropertyAndFunSignatureClash.kt:5:5: error: platform declaration clash: The following declarations have the same JVM signature (access$getFoo$p(LA;)I): fun `access$getFoo$p`(`$this`: A): Int defined in A fun `access$getFoo$p`(a: A): Int defined in A diff --git a/compiler/testData/cli/jvm/syntheticAccessorSignatureClash.out b/compiler/testData/cli/jvm/syntheticAccessorSignatureClash.out index c0adaf24f8b..af756588cfa 100644 --- a/compiler/testData/cli/jvm/syntheticAccessorSignatureClash.out +++ b/compiler/testData/cli/jvm/syntheticAccessorSignatureClash.out @@ -3,6 +3,16 @@ compiler/testData/cli/jvm/syntheticAccessorSignatureClash.kt:14:7: error: accide fun `access$foo`(`$this`: Derived): Unit defined in Derived class Derived : Base() { ^ +compiler/testData/cli/jvm/syntheticAccessorSignatureClash.kt:14:7: error: accidental override: The following declarations have the same JVM signature (access$getBar$p(LDerived;)I): + fun `access$getBar$p`(d: Derived): Int defined in Derived + fun `access$getBar$p`(`$this`: Derived): Int defined in Derived +class Derived : Base() { + ^ +compiler/testData/cli/jvm/syntheticAccessorSignatureClash.kt:14:7: error: accidental override: The following declarations have the same JVM signature (access$getBaz$p(LDerived;)I): + fun `access$getBaz$p`(d: Derived): Int defined in Derived + fun `access$getBaz$p`(`$this`: Derived): Int defined in Derived +class Derived : Base() { + ^ compiler/testData/cli/jvm/syntheticAccessorSignatureClash.kt:14:7: error: accidental override: The following declarations have the same JVM signature (access$getBoo$p(LDerived;)I): fun `access$getBoo$p`(d: Derived): Int defined in Derived fun `access$getBoo$p`(`$this`: Derived): Int defined in Derived @@ -13,19 +23,9 @@ compiler/testData/cli/jvm/syntheticAccessorSignatureClash.kt:14:7: error: accide fun `access$setBar$p`(`$this`: Derived, ``: Int): Unit defined in Derived class Derived : Base() { ^ -compiler/testData/cli/jvm/syntheticAccessorSignatureClash.kt:14:7: error: accidental override: The following declarations have the same JVM signature (access$getBar$p(LDerived;)I): - fun `access$getBar$p`(d: Derived): Int defined in Derived - fun `access$getBar$p`(`$this`: Derived): Int defined in Derived -class Derived : Base() { - ^ compiler/testData/cli/jvm/syntheticAccessorSignatureClash.kt:14:7: error: accidental override: The following declarations have the same JVM signature (access$setBar1$p(LDerived;I)V): fun `access$setBar1$p`(d: Derived, i: Int): Unit defined in Derived fun `access$setBar1$p`(`$this`: Derived, ``: Int): Unit defined in Derived class Derived : Base() { ^ -compiler/testData/cli/jvm/syntheticAccessorSignatureClash.kt:14:7: error: accidental override: The following declarations have the same JVM signature (access$getBaz$p(LDerived;)I): - fun `access$getBaz$p`(d: Derived): Int defined in Derived - fun `access$getBaz$p`(`$this`: Derived): Int defined in Derived -class Derived : Base() { - ^ COMPILATION_ERROR From ee1aff10128df312f696f34d5af0b6f139aa832e Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Thu, 14 Jan 2021 14:56:37 +0300 Subject: [PATCH 118/212] [Test] Update different testdata according to changes in sealed classes --- .../HiddenConstructorWithInlineClassParameters.txt | 2 +- .../testData/loadCompiledKotlin/class/SealedClass.txt | 2 +- .../testData/compileJavaAgainstKotlin/sealed/Derived.java | 2 +- compiler/testData/ir/irText/classes/sealedClasses.kt.txt | 2 +- compiler/testData/ir/irText/classes/sealedClasses.txt | 8 ++++---- .../declarations/multiplatform/expectedSealedClass.kt.txt | 4 ++-- .../declarations/multiplatform/expectedSealedClass.txt | 6 +++--- .../HiddenConstructorWithInlineClassParameters.txt | 2 +- .../loadJava/compiledKotlin/class/SealedClass.txt | 2 +- idea/testData/decompiler/stubBuilder/Sealed/Sealed.txt | 2 +- libraries/tools/kotlinp/testData/NestedClasses.txt | 2 +- 11 files changed, 17 insertions(+), 17 deletions(-) diff --git a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/classMembers/HiddenConstructorWithInlineClassParameters.txt b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/classMembers/HiddenConstructorWithInlineClassParameters.txt index 0abf465764c..08dd7c55828 100644 --- a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/classMembers/HiddenConstructorWithInlineClassParameters.txt +++ b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/annotations/classMembers/HiddenConstructorWithInlineClassParameters.txt @@ -12,7 +12,7 @@ public sealed class Sealed : R|kotlin/Any| { public final val z: R|test/Z| public get(): R|test/Z| - @R|test/Ann|() private constructor(@R|test/Ann|() z: R|test/Z|): R|test/Sealed| + @R|test/Ann|() internal constructor(@R|test/Ann|() z: R|test/Z|): R|test/Sealed| } diff --git a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/class/SealedClass.txt b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/class/SealedClass.txt index 53ae14787a1..7eb9f3de23d 100644 --- a/compiler/fir/analysis-tests/testData/loadCompiledKotlin/class/SealedClass.txt +++ b/compiler/fir/analysis-tests/testData/loadCompiledKotlin/class/SealedClass.txt @@ -14,7 +14,7 @@ public sealed class SealedClass : R|kotlin/Any| { } - private constructor(): R|test/SealedClass| + internal constructor(): R|test/SealedClass| } diff --git a/compiler/testData/compileJavaAgainstKotlin/sealed/Derived.java b/compiler/testData/compileJavaAgainstKotlin/sealed/Derived.java index bb17a9adc6b..f6c85d5b07f 100644 --- a/compiler/testData/compileJavaAgainstKotlin/sealed/Derived.java +++ b/compiler/testData/compileJavaAgainstKotlin/sealed/Derived.java @@ -3,4 +3,4 @@ package test; // It's not possible to inherit from Season (it's sealed in Kotlin) public class Derived extends Season { -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/classes/sealedClasses.kt.txt b/compiler/testData/ir/irText/classes/sealedClasses.kt.txt index 6478ced9ad6..bd162164659 100644 --- a/compiler/testData/ir/irText/classes/sealedClasses.kt.txt +++ b/compiler/testData/ir/irText/classes/sealedClasses.kt.txt @@ -1,5 +1,5 @@ sealed class Expr { - private constructor() /* primary */ { + internal constructor() /* primary */ { super/*Any*/() /* () */ diff --git a/compiler/testData/ir/irText/classes/sealedClasses.txt b/compiler/testData/ir/irText/classes/sealedClasses.txt index 5c1b2a0254b..f8234fa55d8 100644 --- a/compiler/testData/ir/irText/classes/sealedClasses.txt +++ b/compiler/testData/ir/irText/classes/sealedClasses.txt @@ -1,7 +1,7 @@ FILE fqName: fileName:/sealedClasses.kt CLASS CLASS name:Expr modality:SEALED visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Expr - CONSTRUCTOR visibility:private <> () returnType:.Expr [primary] + CONSTRUCTOR visibility:internal <> () returnType:.Expr [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Expr modality:SEALED visibility:public superTypes:[kotlin.Any]' @@ -10,7 +10,7 @@ FILE fqName: fileName:/sealedClasses.kt CONSTRUCTOR visibility:public <> (number:kotlin.Double) returnType:.Expr.Const [primary] VALUE_PARAMETER name:number index:0 type:kotlin.Double BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .Expr' + DELEGATING_CONSTRUCTOR_CALL 'internal constructor () [primary] declared in .Expr' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Const modality:FINAL visibility:public superTypes:[.Expr]' PROPERTY name:number visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:number type:kotlin.Double visibility:private [final] @@ -42,7 +42,7 @@ FILE fqName: fileName:/sealedClasses.kt VALUE_PARAMETER name:e1 index:0 type:.Expr VALUE_PARAMETER name:e2 index:1 type:.Expr BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .Expr' + DELEGATING_CONSTRUCTOR_CALL 'internal constructor () [primary] declared in .Expr' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Sum modality:FINAL visibility:public superTypes:[.Expr]' PROPERTY name:e1 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:e1 type:.Expr visibility:private [final] @@ -83,7 +83,7 @@ FILE fqName: fileName:/sealedClasses.kt $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Expr.NotANumber CONSTRUCTOR visibility:private <> () returnType:.Expr.NotANumber [primary] BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .Expr' + DELEGATING_CONSTRUCTOR_CALL 'internal constructor () [primary] declared in .Expr' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:NotANumber modality:FINAL visibility:public superTypes:[.Expr]' FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: diff --git a/compiler/testData/ir/irText/declarations/multiplatform/expectedSealedClass.kt.txt b/compiler/testData/ir/irText/declarations/multiplatform/expectedSealedClass.kt.txt index 6f95f6af0b4..8e4b78d0641 100644 --- a/compiler/testData/ir/irText/declarations/multiplatform/expectedSealedClass.kt.txt +++ b/compiler/testData/ir/irText/declarations/multiplatform/expectedSealedClass.kt.txt @@ -1,5 +1,5 @@ expect sealed class Ops { - private expect constructor() /* primary */ + internal expect constructor() /* primary */ } @@ -9,7 +9,7 @@ expect class Add : Ops { } sealed class Ops { - private constructor() /* primary */ { + internal constructor() /* primary */ { super/*Any*/() /* () */ diff --git a/compiler/testData/ir/irText/declarations/multiplatform/expectedSealedClass.txt b/compiler/testData/ir/irText/declarations/multiplatform/expectedSealedClass.txt index 77cb758d6ba..5d65736964f 100644 --- a/compiler/testData/ir/irText/declarations/multiplatform/expectedSealedClass.txt +++ b/compiler/testData/ir/irText/declarations/multiplatform/expectedSealedClass.txt @@ -1,7 +1,7 @@ FILE fqName: fileName:/expectedSealedClass.kt CLASS CLASS name:Ops modality:SEALED visibility:public [expect] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Ops - CONSTRUCTOR visibility:private <> () returnType:.Ops [primary,expect] + CONSTRUCTOR visibility:internal <> () returnType:.Ops [primary,expect] FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any @@ -33,7 +33,7 @@ FILE fqName: fileName:/expectedSealedClass.kt $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:Ops modality:SEALED visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Ops - CONSTRUCTOR visibility:private <> () returnType:.Ops [primary] + CONSTRUCTOR visibility:internal <> () returnType:.Ops [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Ops modality:SEALED visibility:public superTypes:[kotlin.Any]' @@ -54,7 +54,7 @@ FILE fqName: fileName:/expectedSealedClass.kt $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Add CONSTRUCTOR visibility:public <> () returnType:.Add [primary] BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'private constructor () [primary] declared in .Ops' + DELEGATING_CONSTRUCTOR_CALL 'internal constructor () [primary] declared in .Ops' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Add modality:FINAL visibility:public superTypes:[.Ops]' FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: diff --git a/compiler/testData/loadJava/compiledKotlin/annotations/classMembers/HiddenConstructorWithInlineClassParameters.txt b/compiler/testData/loadJava/compiledKotlin/annotations/classMembers/HiddenConstructorWithInlineClassParameters.txt index cbef850e2ac..50112e06d47 100644 --- a/compiler/testData/loadJava/compiledKotlin/annotations/classMembers/HiddenConstructorWithInlineClassParameters.txt +++ b/compiler/testData/loadJava/compiledKotlin/annotations/classMembers/HiddenConstructorWithInlineClassParameters.txt @@ -5,7 +5,7 @@ public final annotation class Ann : kotlin.Annotation { } public sealed class Sealed { - /*primary*/ @test.Ann private constructor Sealed(/*0*/ @test.Ann z: test.Z) + /*primary*/ @test.Ann internal constructor Sealed(/*0*/ @test.Ann z: test.Z) public final val z: test.Z public final fun (): test.Z diff --git a/compiler/testData/loadJava/compiledKotlin/class/SealedClass.txt b/compiler/testData/loadJava/compiledKotlin/class/SealedClass.txt index 0b47abf1626..af4e2a97b3e 100644 --- a/compiler/testData/loadJava/compiledKotlin/class/SealedClass.txt +++ b/compiler/testData/loadJava/compiledKotlin/class/SealedClass.txt @@ -9,7 +9,7 @@ public final class Inheritor3 : test.SealedClass { } public sealed class SealedClass { - /*primary*/ private constructor SealedClass() + /*primary*/ internal constructor SealedClass() public final class Inheritor1 : test.SealedClass { /*primary*/ public constructor Inheritor1() diff --git a/idea/testData/decompiler/stubBuilder/Sealed/Sealed.txt b/idea/testData/decompiler/stubBuilder/Sealed/Sealed.txt index 7fe2194334f..97af5678c57 100644 --- a/idea/testData/decompiler/stubBuilder/Sealed/Sealed.txt +++ b/idea/testData/decompiler/stubBuilder/Sealed/Sealed.txt @@ -5,7 +5,7 @@ PsiJetFileStubImpl[package=test] CLASS[fqName=test.Sealed, isEnumEntry=false, isInterface=false, isLocal=false, isTopLevel=true, name=Sealed, superNames=[]] MODIFIER_LIST[public sealed] PRIMARY_CONSTRUCTOR - MODIFIER_LIST[private] + MODIFIER_LIST[internal] VALUE_PARAMETER_LIST CLASS_BODY CLASS[fqName=test.Sealed.Nested, isEnumEntry=false, isInterface=false, isLocal=false, isTopLevel=false, name=Nested, superNames=[Sealed]] diff --git a/libraries/tools/kotlinp/testData/NestedClasses.txt b/libraries/tools/kotlinp/testData/NestedClasses.txt index 0b631ab866e..0e604d1bc9e 100644 --- a/libraries/tools/kotlinp/testData/NestedClasses.txt +++ b/libraries/tools/kotlinp/testData/NestedClasses.txt @@ -55,7 +55,7 @@ public final enum class A.D.E : kotlin/Enum { public sealed class A.D.F : kotlin/Any { // signature: ()V - private constructor() + internal constructor() // nested class: G From cd93b2f39bea8c97f48fbb4e1f4d37ff9a061e60 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Fri, 15 Jan 2021 10:01:15 +0300 Subject: [PATCH 119/212] Use old backend in script compilation context --- .../scripting/compiler/plugin/impl/compilationContext.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/scripting/scripting-compiler/src/org/jetbrains/kotlin/scripting/compiler/plugin/impl/compilationContext.kt b/plugins/scripting/scripting-compiler/src/org/jetbrains/kotlin/scripting/compiler/plugin/impl/compilationContext.kt index 7d132eefffd..e44fbe24eb7 100644 --- a/plugins/scripting/scripting-compiler/src/org/jetbrains/kotlin/scripting/compiler/plugin/impl/compilationContext.kt +++ b/plugins/scripting/scripting-compiler/src/org/jetbrains/kotlin/scripting/compiler/plugin/impl/compilationContext.kt @@ -140,7 +140,7 @@ internal fun createInitialConfigurations( createInitialCompilerConfiguration( scriptCompilationConfiguration, hostConfiguration, messageCollector, ignoredOptionsReportingState ) - + kotlinCompilerConfiguration.put(JVMConfigurationKeys.IR, false) val initialScriptCompilationConfiguration = scriptCompilationConfiguration.withUpdatesFromCompilerConfiguration(kotlinCompilerConfiguration) @@ -298,14 +298,15 @@ private fun CompilerConfiguration.updateWithRefinedConfigurations( messageCollector: ScriptDiagnosticsMessageCollector ) { val dependenciesProvider = ScriptDependenciesProvider.getInstance(context.environment.project) - val updatedCompilerOptions = sourceFiles.flatMap { + val updatedCompilerOptions = sourceFiles.flatMapTo(mutableListOf()) { dependenciesProvider?.getScriptConfiguration(it)?.configuration?.get( ScriptCompilationConfiguration.compilerOptions ) ?: emptyList() } + updatedCompilerOptions += "-Xuse-old-backend" if (updatedCompilerOptions.isNotEmpty() && updatedCompilerOptions != context.baseScriptCompilationConfiguration[ScriptCompilationConfiguration.compilerOptions] ) { updateWithCompilerOptions(updatedCompilerOptions, messageCollector, context.ignoredOptionsReportingState, true) } -} \ No newline at end of file +} From ffc585ad5ca8546fc34e479402430f735fadb906 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Fri, 15 Jan 2021 11:28:12 +0300 Subject: [PATCH 120/212] [Debugger] Fix compiler option for disabling IR backend in tests --- .../kotlin/idea/debugger/test/DebuggerTestCompilerFacility.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/DebuggerTestCompilerFacility.kt b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/DebuggerTestCompilerFacility.kt index d090288a18e..9fccf70d548 100644 --- a/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/DebuggerTestCompilerFacility.kt +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/DebuggerTestCompilerFacility.kt @@ -92,8 +92,8 @@ class DebuggerTestCompilerFacility( val options = mutableListOf("-jvm-target", jvmTarget.description) - if (useIrBackend) { - options.add("-Xuse-ir") + if (!useIrBackend) { + options.add("-Xuse-old-backend") } if (kotlin.isNotEmpty()) { From 64100eec07ea88c3bf112d729c4df6e22f30b646 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Fri, 15 Jan 2021 11:48:11 +0300 Subject: [PATCH 121/212] [Test] Add workaround for KT-44359 --- .../tests/org/jetbrains/kotlin/cli/WrongBytecodeVersionTest.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/tests/org/jetbrains/kotlin/cli/WrongBytecodeVersionTest.kt b/compiler/tests/org/jetbrains/kotlin/cli/WrongBytecodeVersionTest.kt index f353617c62f..8cfb6f663ca 100644 --- a/compiler/tests/org/jetbrains/kotlin/cli/WrongBytecodeVersionTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/cli/WrongBytecodeVersionTest.kt @@ -50,7 +50,8 @@ class WrongBytecodeVersionTest : KtUsefulTestCase() { val (output, exitCode) = AbstractCliTest.executeCompilerGrabOutput(K2JVMCompiler(), listOf( usageSource.path, "-classpath", tmpdir.path, - "-d", tmpdir.path + "-d", tmpdir.path, + "-Xuse-old-backend" )) assertEquals("Compilation error expected", ExitCode.COMPILATION_ERROR, exitCode) From 4f8b12c96fd6521224aac31fd8ddf8b5ddf5e772 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Fri, 15 Jan 2021 12:04:05 +0300 Subject: [PATCH 122/212] [Test] Fix various tests according to switching to kotlin 1.5 --- .../jvm/languageVersion/build.log.expected | 1 + .../ant/jvm/verbose/build.log.expected | 2 +- .../org/jetbrains/kotlin/cli/CustomCliTest.kt | 2 +- idea/testData/highlighter/DelegatingCtor.kt | 20 +++++++++---------- .../kotlin/jps/build/KotlinJpsBuildTest.kt | 2 +- .../jps/build/KotlinJpsBuildTest.kt.201 | 2 +- .../kotlin/gradle/dsl/KotlinCommonOptions.kt | 4 ++-- .../kotlin/gradle/KotlinGradlePluginIT.kt | 12 +++++------ .../org/jetbrains/kotlin/gradle/UpToDateIT.kt | 4 ++-- 9 files changed, 25 insertions(+), 24 deletions(-) diff --git a/compiler/testData/integration/ant/jvm/languageVersion/build.log.expected b/compiler/testData/integration/ant/jvm/languageVersion/build.log.expected index 3977f5a2854..a1349b956cb 100644 --- a/compiler/testData/integration/ant/jvm/languageVersion/build.log.expected +++ b/compiler/testData/integration/ant/jvm/languageVersion/build.log.expected @@ -3,6 +3,7 @@ Buildfile: [TestData]/build.xml build: [kotlinc] Compiling [[TestData]/main.kt] => [[Temp]/hello.jar] + [kotlinc] warning: language version 1.3 is deprecated and its support will be removed in a future version of Kotlin [kotlinc] [TestData]/main.kt:4:21: error: 'break' and 'continue' are not allowed in 'when' statements. Consider using labels to continue/break from the outer loop [kotlinc] true -> break [kotlinc] ^ diff --git a/compiler/testData/integration/ant/jvm/verbose/build.log.expected b/compiler/testData/integration/ant/jvm/verbose/build.log.expected index 663032953a2..66a43fb0592 100644 --- a/compiler/testData/integration/ant/jvm/verbose/build.log.expected +++ b/compiler/testData/integration/ant/jvm/verbose/build.log.expected @@ -4,7 +4,7 @@ Buildfile: [TestData]/build.xml build: [kotlinc] Compiling [[TestData]/hello.kt] => [[Temp]/hello.jar] [kotlinc] logging: using Kotlin home directory [KotlinProjectHome]/dist/kotlinc - [kotlinc] logging: using old JVM backend + [kotlinc] logging: using JVM IR backend [kotlinc] logging: configuring the compilation environment [kotlinc] logging: configure scripting: Added template org.jetbrains.kotlin.mainKts.MainKtsScript from [[CompilerLib]/kotlin-main-kts.jar, [CompilerLib]/kotlin-reflect.jar, [CompilerLib]/kotlin-script-runtime.jar, [CompilerLib]/kotlin-stdlib.jar] diff --git a/compiler/tests/org/jetbrains/kotlin/cli/CustomCliTest.kt b/compiler/tests/org/jetbrains/kotlin/cli/CustomCliTest.kt index 202af8b98fb..d97f3601d27 100644 --- a/compiler/tests/org/jetbrains/kotlin/cli/CustomCliTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/cli/CustomCliTest.kt @@ -16,7 +16,7 @@ private const val EMPTY_MAIN_FUN = "fun main() {}" class CustomCliTest : TestCaseWithTmpdir() { fun testArgfileWithNonTrivialWhitespaces() { - val text = "-include-runtime\r\n\t\t-language-version\n\t1.2\r\n-version" + val text = "-include-runtime\r\n\t\t-language-version\n\t1.5\r\n-version" val argfile = File(tmpdir, "argfile").apply { writeText(text, Charsets.UTF_8) } CompilerTestUtil.executeCompilerAssertSuccessful(K2JVMCompiler(), listOf("@" + argfile.absolutePath)) } diff --git a/idea/testData/highlighter/DelegatingCtor.kt b/idea/testData/highlighter/DelegatingCtor.kt index 8d795a2dba9..c99e4456a96 100644 --- a/idea/testData/highlighter/DelegatingCtor.kt +++ b/idea/testData/highlighter/DelegatingCtor.kt @@ -1,18 +1,18 @@ // IGNORE_FIR -open class Foo { - constructor(i: Int) +open class Foo { + constructor(i: Int) } -class Bar : Foo { - constructor(s: String) +class Bar : Foo { + constructor(s: String) } -class F(foo: String) { - constructor() {} +class F(foo: String) { + constructor() {} } -enum class E(val a: String) { - A; - constructor() -} \ No newline at end of file +enum class E(val a: String) { + A; + constructor() +} diff --git a/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTest.kt b/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTest.kt index 2d432cdf16f..28b46b667f4 100644 --- a/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTest.kt +++ b/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTest.kt @@ -458,7 +458,7 @@ open class KotlinJpsBuildTest : KotlinJpsBuildTestBase() { assertEquals(1, myProject.modules.size) val module = myProject.modules.first() val args = module.kotlinCompilerArguments - args.apiVersion = "1.2" + args.apiVersion = "1.4" myProject.kotlinCommonCompilerArguments = args buildAllModules().assertSuccessful() diff --git a/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTest.kt.201 b/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTest.kt.201 index 605d85bce34..82625bda9cf 100644 --- a/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTest.kt.201 +++ b/jps-plugin/jps-tests/test/org/jetbrains/kotlin/jps/build/KotlinJpsBuildTest.kt.201 @@ -458,7 +458,7 @@ open class KotlinJpsBuildTest : KotlinJpsBuildTestBase() { assertEquals(1, myProject.modules.size) val module = myProject.modules.first() val args = module.kotlinCompilerArguments - args.apiVersion = "1.2" + args.apiVersion = "1.4" myProject.kotlinCommonCompilerArguments = args buildAllModules().assertSuccessful() diff --git a/libraries/tools/kotlin-gradle-plugin-api/src/main/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinCommonOptions.kt b/libraries/tools/kotlin-gradle-plugin-api/src/main/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinCommonOptions.kt index 3ebb848ec74..4d083a238d5 100644 --- a/libraries/tools/kotlin-gradle-plugin-api/src/main/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinCommonOptions.kt +++ b/libraries/tools/kotlin-gradle-plugin-api/src/main/kotlin/org/jetbrains/kotlin/gradle/dsl/KotlinCommonOptions.kt @@ -6,14 +6,14 @@ interface KotlinCommonOptions : org.jetbrains.kotlin.gradle.dsl.KotlinCommonToo /** * Allow using declarations only from the specified version of bundled libraries - * Possible values: "1.2 (DEPRECATED)", "1.3", "1.4", "1.5 (EXPERIMENTAL)", "1.6 (EXPERIMENTAL)" + * Possible values: "1.3 (DEPRECATED)", "1.4", "1.5", "1.6 (EXPERIMENTAL)" * Default value: null */ var apiVersion: kotlin.String? /** * Provide source compatibility with the specified version of Kotlin - * Possible values: "1.2 (DEPRECATED)", "1.3", "1.4", "1.5 (EXPERIMENTAL)", "1.6 (EXPERIMENTAL)" + * Possible values: "1.3 (DEPRECATED)", "1.4", "1.5", "1.6 (EXPERIMENTAL)" * Default value: null */ var languageVersion: kotlin.String? diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/KotlinGradlePluginIT.kt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/KotlinGradlePluginIT.kt index 52152745c0e..2811bef9603 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/KotlinGradlePluginIT.kt +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/KotlinGradlePluginIT.kt @@ -467,18 +467,18 @@ class KotlinGradleIT : BaseGradleIT() { } // check the arguments are always passed if specified explicitly - updateBuildGradle("1.2", "1.2") + updateBuildGradle("1.4", "1.4") project.build("clean", "compileKotlin") { assertSuccessful() - assertContains("-language-version 1.2") - assertContains("-api-version 1.2") + assertContains("-language-version 1.4") + assertContains("-api-version 1.4") } - updateBuildGradle("1.3", "1.3") + updateBuildGradle("1.5", "1.5") project.build("clean", "compileKotlin") { assertSuccessful() - assertContains("-language-version 1.3") - assertContains("-api-version 1.3") + assertContains("-language-version 1.5") + assertContains("-api-version 1.5") } } diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/UpToDateIT.kt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/UpToDateIT.kt index d1519f0d513..4dbf47c60c1 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/UpToDateIT.kt +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/UpToDateIT.kt @@ -12,7 +12,7 @@ class UpToDateIT : BaseGradleIT() { testMutations( *propertyMutationChain( "compileKotlin.kotlinOptions.languageVersion", - "null", "'1.3'", "'1.2'", "null" + "null", "'1.5'", "'1.4'", "null" ) ) } @@ -22,7 +22,7 @@ class UpToDateIT : BaseGradleIT() { testMutations( *propertyMutationChain( "compileKotlin.kotlinOptions.apiVersion", - "null", "'1.3'", "'1.2'", "null" + "null", "'1.5'", "'1.4'", "null" ) ) } From e39bbcd937c772f1dd52afb6dd2f70f6e5dc7030 Mon Sep 17 00:00:00 2001 From: Victor Petukhov Date: Mon, 18 Jan 2021 14:49:11 +0300 Subject: [PATCH 123/212] Unmute test which checks the evaluation order of value arguments with varargs. The corresponding feature (UseCorrectExecutionOrderForVarargArguments) is enabled by default in 1.5. --- .../codegen/box/mixedNamedPosition/varargsEvaluationOrder.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/compiler/testData/codegen/box/mixedNamedPosition/varargsEvaluationOrder.kt b/compiler/testData/codegen/box/mixedNamedPosition/varargsEvaluationOrder.kt index 2202c7b0c4a..178ab0348a2 100644 --- a/compiler/testData/codegen/box/mixedNamedPosition/varargsEvaluationOrder.kt +++ b/compiler/testData/codegen/box/mixedNamedPosition/varargsEvaluationOrder.kt @@ -1,7 +1,6 @@ // DONT_TARGET_EXACT_BACKEND: WASM // WASM_MUTE_REASON: SPREAD_OPERATOR // !LANGUAGE: +NewInference +MixedNamedArgumentsInTheirOwnPosition -// IGNORE_BACKEND: JVM // See KT-17691: Wrong argument order in resolved call with varargs. (fixed in JVM_IR) var log = "" From af3eaf5d7107d7db2f5e458bc58cf170de47ea5b Mon Sep 17 00:00:00 2001 From: Victor Petukhov Date: Mon, 18 Jan 2021 14:50:47 +0300 Subject: [PATCH 124/212] Add explicit disabling `ProhibitVarargAsArrayAfterSamArgument` feature in tests as it's enabled by default in 1.5 --- .../testData/codegen/box/sam/arrayAsVarargAfterSamArgument.kt | 2 +- .../ir/irText/expressions/sam/arrayAsVarargAfterSamArgument.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/testData/codegen/box/sam/arrayAsVarargAfterSamArgument.kt b/compiler/testData/codegen/box/sam/arrayAsVarargAfterSamArgument.kt index 854cd21e04c..74841f034bf 100644 --- a/compiler/testData/codegen/box/sam/arrayAsVarargAfterSamArgument.kt +++ b/compiler/testData/codegen/box/sam/arrayAsVarargAfterSamArgument.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +NewInference +SamConversionForKotlinFunctions +SamConversionPerArgument +// !LANGUAGE: +NewInference +SamConversionForKotlinFunctions +SamConversionPerArgument -ProhibitVarargAsArrayAfterSamArgument // IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM diff --git a/compiler/testData/ir/irText/expressions/sam/arrayAsVarargAfterSamArgument.kt b/compiler/testData/ir/irText/expressions/sam/arrayAsVarargAfterSamArgument.kt index 1265dadb7d7..4a170af1377 100644 --- a/compiler/testData/ir/irText/expressions/sam/arrayAsVarargAfterSamArgument.kt +++ b/compiler/testData/ir/irText/expressions/sam/arrayAsVarargAfterSamArgument.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +NewInference +SamConversionPerArgument +SamConversionForKotlinFunctions +// !LANGUAGE: +NewInference +SamConversionPerArgument +SamConversionForKotlinFunctions -ProhibitVarargAsArrayAfterSamArgument // WITH_JDK // FILE: arrayAsVarargAfterSamArgument.kt From 670f029bdf218a7f9910d613180652725236ac64 Mon Sep 17 00:00:00 2001 From: Victor Petukhov Date: Tue, 19 Jan 2021 12:11:09 +0300 Subject: [PATCH 125/212] Allow passing non-spread arrays into a vararg parameter after sam properly, through propagating vararg element type to a sam adapter from the original parameter descriptor --- .../FirBlackBoxCodegenTestGenerated.java | 6 --- .../sam/JavaSingleAbstractMethodUtils.java | 29 ++++++++--- .../kotlin/synthetic/JavaSyntheticScopes.kt | 4 +- .../synthetic/SamAdapterFunctionsScope.kt | 50 +++++++++---------- .../calls/components/SamTypeConversions.kt | 5 +- ...rgumentWithoutSamConversionsPerArgument.kt | 41 --------------- .../arrayAsVarargAfterSamArgument.fir.kt | 18 +++---- .../arrayAsVarargAfterSamArgument.kt | 18 +++---- ...yAsVarargAfterSamArgumentProhibited.fir.kt | 2 +- ...arrayAsVarargAfterSamArgumentProhibited.kt | 2 +- ...entWithoutSamConversionsPerArgument.fir.kt | 2 +- ...rgumentWithoutSamConversionsPerArgument.kt | 2 +- .../codegen/BlackBoxCodegenTestGenerated.java | 6 --- .../IrBlackBoxCodegenTestGenerated.java | 6 --- .../LightAnalysisModeTestGenerated.java | 5 -- 15 files changed, 70 insertions(+), 126 deletions(-) delete mode 100644 compiler/testData/codegen/box/sam/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.kt diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java index 104d6713b71..7b8f5c62c04 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java @@ -34236,12 +34236,6 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/sam/arrayAsVarargAfterSamArgument.kt"); } - @Test - @TestMetadata("arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.kt") - public void testArrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument() throws Exception { - runTest("compiler/testData/codegen/box/sam/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.kt"); - } - @Test @TestMetadata("castFromAny.kt") public void testCastFromAny() throws Exception { diff --git a/compiler/frontend.java/src/org/jetbrains/kotlin/load/java/sam/JavaSingleAbstractMethodUtils.java b/compiler/frontend.java/src/org/jetbrains/kotlin/load/java/sam/JavaSingleAbstractMethodUtils.java index e1104e87ae5..a5c1fe7bb9b 100644 --- a/compiler/frontend.java/src/org/jetbrains/kotlin/load/java/sam/JavaSingleAbstractMethodUtils.java +++ b/compiler/frontend.java/src/org/jetbrains/kotlin/load/java/sam/JavaSingleAbstractMethodUtils.java @@ -63,7 +63,8 @@ public class JavaSingleAbstractMethodUtils { public static SamAdapterDescriptor createSamAdapterFunction( @NotNull JavaMethodDescriptor original, @NotNull SamConversionResolver samResolver, - @NotNull SamConversionOracle samConversionOracle + @NotNull SamConversionOracle samConversionOracle, + boolean allowNonSpreadArraysForVarargAfterSam ) { SamAdapterFunctionDescriptor result = new SamAdapterFunctionDescriptor(original); return initSamAdapter(original, result, new FunctionInitializer() { @@ -83,14 +84,15 @@ public class JavaSingleAbstractMethodUtils { original.getVisibility() ); } - }, samResolver, samConversionOracle); + }, samResolver, samConversionOracle, allowNonSpreadArraysForVarargAfterSam); } @NotNull public static SamAdapterDescriptor createSamAdapterConstructor( @NotNull JavaClassConstructorDescriptor original, @NotNull SamConversionResolver samResolver, - @NotNull SamConversionOracle samConversionOracle + @NotNull SamConversionOracle samConversionOracle, + boolean allowNonSpreadArraysForVarargAfterSam ) { SamAdapterClassConstructorDescriptor result = new SamAdapterClassConstructorDescriptor(original); return initSamAdapter(original, result, new FunctionInitializer() { @@ -103,7 +105,7 @@ public class JavaSingleAbstractMethodUtils { result.initialize(valueParameters, original.getVisibility()); result.setReturnType(returnType); } - }, samResolver, samConversionOracle); + }, samResolver, samConversionOracle, allowNonSpreadArraysForVarargAfterSam); } @NotNull @@ -112,7 +114,8 @@ public class JavaSingleAbstractMethodUtils { @NotNull SamAdapterDescriptor adapter, @NotNull FunctionInitializer initializer, @NotNull SamConversionResolver samResolver, - @NotNull SamConversionOracle samConversionOracle + @NotNull SamConversionOracle samConversionOracle, + boolean allowNonSpreadArraysForVarargAfterSam ) { SamConstructorTypeParameters typeParameters; if (adapter instanceof SamAdapterClassConstructorDescriptor) { @@ -131,7 +134,7 @@ public class JavaSingleAbstractMethodUtils { List valueParameters = - createValueParametersForSamAdapter(original, adapter, substitutor, samResolver, samConversionOracle); + createValueParametersForSamAdapter(original, adapter, substitutor, samResolver, samConversionOracle, allowNonSpreadArraysForVarargAfterSam); initializer.initialize(typeParameters.getDescriptors(), valueParameters, returnType); @@ -143,7 +146,8 @@ public class JavaSingleAbstractMethodUtils { @NotNull FunctionDescriptor samAdapter, @NotNull TypeSubstitutor substitutor, @NotNull SamConversionResolver samResolver, - @NotNull SamConversionOracle samConversionOracle + @NotNull SamConversionOracle samConversionOracle, + boolean allowNonSpreadArraysForVarargAfterSam ) { List originalValueParameters = original.getValueParameters(); List valueParameters = new ArrayList<>(originalValueParameters.size()); @@ -154,13 +158,22 @@ public class JavaSingleAbstractMethodUtils { KotlinType newType = substitutor.substitute(newTypeUnsubstituted, Variance.IN_VARIANCE); assert newType != null : "couldn't substitute type: " + newTypeUnsubstituted + ", substitutor = " + substitutor; + /* + * Before 1.5 we allowed passing non-spread arrays into vararg parameter, after sam conversion like: + * public static String foo1(Runnable r, String... strs) { } + * ... + * Test.foo1({}, arrayOf()) + * For that, we don't pass `varargElementType` from the original parameter descriptor. + */ + KotlinType varargElementType = allowNonSpreadArraysForVarargAfterSam ? null : originalParam.getVarargElementType(); + ValueParameterDescriptor newParam = new ValueParameterDescriptorImpl( samAdapter, null, originalParam.getIndex(), originalParam.getAnnotations(), originalParam.getName(), newType, /* declaresDefaultValue = */ false, /* isCrossinline = */ false, /* isNoinline = */ false, - null, SourceElement.NO_SOURCE + varargElementType, SourceElement.NO_SOURCE ); valueParameters.add(newParam); } diff --git a/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/JavaSyntheticScopes.kt b/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/JavaSyntheticScopes.kt index f22925b77c1..cf22491e400 100644 --- a/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/JavaSyntheticScopes.kt +++ b/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/JavaSyntheticScopes.kt @@ -69,7 +69,7 @@ class JavaSyntheticScopes( deprecationResolver, lookupTracker, samViaSyntheticScopeDisabled = samConversionPerArgumentIsEnabled, - shouldGenerateCandidateForVarargAfterSam = !languageVersionSettings.supportsFeature( + allowNonSpreadArraysForVarargAfterSam = !languageVersionSettings.supportsFeature( LanguageFeature.ProhibitVarargAsArrayAfterSamArgument ) ) @@ -87,7 +87,7 @@ class JavaSyntheticScopes( deprecationResolver, lookupTracker, samViaSyntheticScopeDisabled = false, - shouldGenerateCandidateForVarargAfterSam = false + allowNonSpreadArraysForVarargAfterSam = false ) scopesWithForceEnabledSamAdapters = 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 dea3e03870f..64695784db1 100644 --- a/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/SamAdapterFunctionsScope.kt +++ b/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/SamAdapterFunctionsScope.kt @@ -59,10 +59,8 @@ class SamAdapterFunctionsScope( private val deprecationResolver: DeprecationResolver, private val lookupTracker: LookupTracker, private val samViaSyntheticScopeDisabled: Boolean, - private val shouldGenerateCandidateForVarargAfterSam: Boolean + private val allowNonSpreadArraysForVarargAfterSam: Boolean ) : SyntheticScope.Default() { - private val shouldGenerateAdditionalSamCandidate = !samViaSyntheticScopeDisabled || shouldGenerateCandidateForVarargAfterSam - private val extensionForFunction = storageManager.createMemoizedFunctionWithNullableValues { function -> extensionForFunctionNotCached(function) @@ -70,8 +68,12 @@ class SamAdapterFunctionsScope( private val samAdapterForStaticFunction = storageManager.createMemoizedFunction> { function -> - JavaSingleAbstractMethodUtils - .createSamAdapterFunction(function, samResolver, samConversionOracle) + JavaSingleAbstractMethodUtils.createSamAdapterFunction( + function, + samResolver, + samConversionOracle, + allowNonSpreadArraysForVarargAfterSam + ) } private val samConstructorForClassifier = @@ -81,8 +83,12 @@ class SamAdapterFunctionsScope( private val samConstructorForJavaConstructor = storageManager.createMemoizedFunction { constructor -> - JavaSingleAbstractMethodUtils - .createSamAdapterConstructor(constructor, samResolver, samConversionOracle) as ClassConstructorDescriptor + JavaSingleAbstractMethodUtils.createSamAdapterConstructor( + constructor, + samResolver, + samConversionOracle, + allowNonSpreadArraysForVarargAfterSam + ) as ClassConstructorDescriptor } private val samConstructorForTypeAliasConstructor = @@ -96,7 +102,12 @@ class SamAdapterFunctionsScope( if (!JavaSingleAbstractMethodUtils.isSamAdapterNecessary(function)) return null if (function.returnType == null) return null if (deprecationResolver.isHiddenInResolution(function)) return null - return SamAdapterExtensionFunctionDescriptorImpl.create(function, samResolver, samConversionOracle) + return SamAdapterExtensionFunctionDescriptorImpl.create( + function, + samResolver, + samConversionOracle, + allowNonSpreadArraysForVarargAfterSam + ) } override fun getSyntheticMemberFunctions( @@ -104,8 +115,6 @@ class SamAdapterFunctionsScope( name: Name, location: LookupLocation ): Collection { - if (!shouldGenerateAdditionalSamCandidate) return emptyList() - var result: SmartList? = null for (type in receiverTypes) { for (function in type.memberScope.getContributedFunctions(name, location)) { @@ -143,7 +152,7 @@ class SamAdapterFunctionsScope( } private val FunctionDescriptor.shouldGenerateCandidateForVarargAfterSamAndHasVararg - get() = shouldGenerateCandidateForVarargAfterSam && valueParameters.lastOrNull()?.isVararg == true + get() = allowNonSpreadArraysForVarargAfterSam && valueParameters.lastOrNull()?.isVararg == true private val FunctionDescriptor.hasNothingTypeInParameters get() = valueParameters.any { it.type.isNothing() && !it.original.type.isNothing() } @@ -161,8 +170,6 @@ class SamAdapterFunctionsScope( } override fun getSyntheticMemberFunctions(receiverTypes: Collection): Collection { - if (!shouldGenerateAdditionalSamCandidate) return emptyList() - return receiverTypes.flatMapTo(LinkedHashSet()) { type -> type.memberScope.getContributedDescriptors(DescriptorKindFilter.FUNCTIONS) .filterIsInstance() @@ -179,8 +186,6 @@ class SamAdapterFunctionsScope( contributedFunctions: Collection, location: LookupLocation ): Collection { - if (!shouldGenerateAdditionalSamCandidate) return emptyList() - return getSamFunctions(contributedFunctions, location) } @@ -190,8 +195,6 @@ class SamAdapterFunctionsScope( ): Collection { recordSamLookupsToClassifier(contributedClassifier, location) - if (!shouldGenerateAdditionalSamCandidate) return listOfNotNull(getSamConstructor(contributedClassifier)) - return getAllSamConstructors(contributedClassifier) } @@ -204,16 +207,12 @@ class SamAdapterFunctionsScope( } override fun getSyntheticStaticFunctions(functionDescriptors: Collection): Collection { - if (!shouldGenerateAdditionalSamCandidate) return emptyList() - return getSamFunctions(functionDescriptors, location = null) } override fun getSyntheticConstructors(classifierDescriptors: Collection): Collection { val classifiers = classifierDescriptors.filterIsInstance() - if (!shouldGenerateAdditionalSamCandidate) return classifiers.mapNotNull { getSamConstructor(it) } - return classifiers.flatMap { getAllSamConstructors(it) } } @@ -242,8 +241,6 @@ class SamAdapterFunctionsScope( functions: Collection, location: LookupLocation? ): List> { - if (!shouldGenerateAdditionalSamCandidate) return emptyList() - return functions.mapNotNull { function -> if (function !is JavaMethodDescriptor) return@mapNotNull null if (function.dispatchReceiverParameter != null) return@mapNotNull null // consider only statics @@ -263,7 +260,7 @@ class SamAdapterFunctionsScope( } private fun getSamAdaptersFromConstructors(classifier: ClassifierDescriptor): MutableList { - if (!shouldGenerateAdditionalSamCandidate || classifier !is JavaClassDescriptor) return SmartList() + if (classifier !is JavaClassDescriptor) return SmartList() return SmartList().apply { for (constructor in classifier.constructors) { @@ -313,7 +310,8 @@ class SamAdapterFunctionsScope( fun create( sourceFunction: FunctionDescriptor, samResolver: SamConversionResolver, - samConversionOracle: SamConversionOracle + samConversionOracle: SamConversionOracle, + allowNonSpreadArraysForVarargAfterSam: Boolean ): SamAdapterExtensionFunctionDescriptorImpl { val descriptor = SamAdapterExtensionFunctionDescriptorImpl( sourceFunction.containingDeclaration, @@ -334,7 +332,7 @@ class SamAdapterFunctionsScope( val returnType = typeSubstitutor.safeSubstitute(sourceFunction.returnType!!, Variance.INVARIANT) val valueParameters = JavaSingleAbstractMethodUtils.createValueParametersForSamAdapter( - sourceFunction, descriptor, typeSubstitutor, samResolver, samConversionOracle + sourceFunction, descriptor, typeSubstitutor, samResolver, samConversionOracle, allowNonSpreadArraysForVarargAfterSam ) val visibility = syntheticVisibility(sourceFunction, isUsedForExtension = false) diff --git a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/SamTypeConversions.kt b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/SamTypeConversions.kt index b67663d9f15..ce7ac60415e 100644 --- a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/SamTypeConversions.kt +++ b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/components/SamTypeConversions.kt @@ -24,11 +24,8 @@ object SamTypeConversions : ParameterTypeConversion { expectedParameterType: UnwrappedType ): Boolean { val callComponents = candidate.callComponents - val generatingAdditionalSamCandidateIsEnabled = - !callComponents.languageVersionSettings.supportsFeature(LanguageFeature.SamConversionPerArgument) && - !callComponents.languageVersionSettings.supportsFeature(LanguageFeature.ProhibitVarargAsArrayAfterSamArgument) - if (generatingAdditionalSamCandidateIsEnabled) return true + if (!callComponents.languageVersionSettings.supportsFeature(LanguageFeature.SamConversionPerArgument)) return true if (expectedParameterType.isNothing()) return true if (expectedParameterType.isFunctionType) return true diff --git a/compiler/testData/codegen/box/sam/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.kt b/compiler/testData/codegen/box/sam/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.kt deleted file mode 100644 index 7d62833348a..00000000000 --- a/compiler/testData/codegen/box/sam/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.kt +++ /dev/null @@ -1,41 +0,0 @@ -// !LANGUAGE: +NewInference +SamConversionForKotlinFunctions -SamConversionPerArgument -// IGNORE_BACKEND_FIR: JVM_IR -// TARGET_BACKEND: JVM - -// FILE: Test.java -public class Test { - public static String foo1(Runnable r, String... strs) { - return null; - } - public String foo2(Runnable r1, Runnable r2, String... strs) { - return null; - } - public Test(Runnable r, String... strs) {} - public Test(Runnable r1, Runnable r2, String... strs) {} -} - -// FILE: main.kt -fun box(): String { - val x1 = {} - val x2: Runnable = Runnable { } - val x3 = arrayOf() - - Test.foo1({}, arrayOf()) - Test.foo1({}, arrayOf("")) - - Test.foo1(x1, arrayOf()) - Test.foo1(x2, *arrayOf()) - - Test.foo1(x1, x3) - Test.foo1(x2, *arrayOf("")) - - val i1 = Test({}, arrayOf()) - val i3 = Test({}, x3) - val i4 = Test({}, arrayOf("")) - val i6 = Test({}, {}, arrayOf()) - - i1.foo2({}, {}, arrayOf()) - i1.foo2({}, {}, arrayOf("")) - - return "OK" -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgument.fir.kt b/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgument.fir.kt index 7b117600a13..cbab12a2f2b 100644 --- a/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgument.fir.kt +++ b/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgument.fir.kt @@ -12,7 +12,7 @@ public class Test { return null; } public Test(Runnable r, String... strs) {} - public Test(Runnable r, Runnable r, String... strs) {} + public Test(Runnable r1, Runnable r2, String... strs) {} } // FILE: main.kt @@ -42,13 +42,13 @@ fun main(x2: Runnable) { val i5 = Test({}, {}, *arrayOf("")) val i6 = Test({}, {}, arrayOf()) - i1.foo2({}, {}, arrayOf()) - i1.foo2({}, {}, *arrayOf()) - i1.foo2({}, x2, arrayOf()) - i1.foo2(x2, {}, *arrayOf()) + i2.foo2({}, {}, arrayOf()) + i2.foo2({}, {}, *arrayOf()) + i2.foo2({}, x2, arrayOf()) + i2.foo2(x2, {}, *arrayOf()) - i1.foo2({}, {}, arrayOf("")) - i1.foo2({}, {}, *x3) - i1.foo2({}, x2, x3) - i1.foo2(x2, {}, *arrayOf("")) + i2.foo2({}, {}, arrayOf("")) + i2.foo2({}, {}, *x3) + i2.foo2({}, x2, x3) + i2.foo2(x2, {}, *arrayOf("")) } diff --git a/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgument.kt b/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgument.kt index 27064b74806..914565f6f7c 100644 --- a/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgument.kt +++ b/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgument.kt @@ -12,7 +12,7 @@ public class Test { return null; } public Test(Runnable r, String... strs) {} - public Test(Runnable r, Runnable r, String... strs) {} + public Test(Runnable r1, Runnable r2, String... strs) {} } // FILE: main.kt @@ -42,13 +42,13 @@ fun main(x2: Runnable) { val i5 = Test({}, {}, *arrayOf("")) val i6 = Test({}, {}, arrayOf()) - i1.foo2({}, {}, arrayOf()) - i1.foo2({}, {}, *arrayOf()) - i1.foo2({}, x2, arrayOf()) - i1.foo2(x2, {}, *arrayOf()) + i2.foo2({}, {}, arrayOf()) + i2.foo2({}, {}, *arrayOf()) + i2.foo2({}, x2, arrayOf()) + i2.foo2(x2, {}, *arrayOf()) - i1.foo2({}, {}, arrayOf("")) - i1.foo2({}, {}, *x3) - i1.foo2({}, x2, x3) - i1.foo2(x2, {}, *arrayOf("")) + i2.foo2({}, {}, arrayOf("")) + i2.foo2({}, {}, *x3) + i2.foo2({}, x2, x3) + i2.foo2(x2, {}, *arrayOf("")) } diff --git a/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentProhibited.fir.kt b/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentProhibited.fir.kt index c793fba46ee..56210493208 100644 --- a/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentProhibited.fir.kt +++ b/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentProhibited.fir.kt @@ -12,7 +12,7 @@ public class Test { return null; } public Test(Runnable r, String... strs) {} - public Test(Runnable r, Runnable r, String... strs) {} + public Test(Runnable r1, Runnable r2, String... strs) {} } // FILE: main.kt diff --git a/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentProhibited.kt b/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentProhibited.kt index 61f1ca77387..b592083563c 100644 --- a/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentProhibited.kt +++ b/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentProhibited.kt @@ -12,7 +12,7 @@ public class Test { return null; } public Test(Runnable r, String... strs) {} - public Test(Runnable r, Runnable r, String... strs) {} + public Test(Runnable r1, Runnable r2, String... strs) {} } // FILE: main.kt diff --git a/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.fir.kt b/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.fir.kt index bd59ac25695..04bf1ebba3b 100644 --- a/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.fir.kt +++ b/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.fir.kt @@ -12,7 +12,7 @@ public class Test { return null; } public Test(Runnable r, String... strs) {} - public Test(Runnable r, Runnable r, String... strs) {} + public Test(Runnable r1, Runnable r2, String... strs) {} } // FILE: main.kt diff --git a/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.kt b/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.kt index 367682d7cdb..55ea9d953c3 100644 --- a/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.kt +++ b/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.kt @@ -12,7 +12,7 @@ public class Test { return null; } public Test(Runnable r, String... strs) {} - public Test(Runnable r, Runnable r, String... strs) {} + public Test(Runnable r1, Runnable r2, String... strs) {} } // FILE: main.kt diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index c7258387bd5..a2e3a1b2235 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -34436,12 +34436,6 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/sam/arrayAsVarargAfterSamArgument.kt"); } - @Test - @TestMetadata("arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.kt") - public void testArrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument() throws Exception { - runTest("compiler/testData/codegen/box/sam/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.kt"); - } - @Test @TestMetadata("castFromAny.kt") public void testCastFromAny() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index 3ab6cebe6fc..c3c4540ed55 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -34236,12 +34236,6 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/sam/arrayAsVarargAfterSamArgument.kt"); } - @Test - @TestMetadata("arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.kt") - public void testArrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument() throws Exception { - runTest("compiler/testData/codegen/box/sam/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.kt"); - } - @Test @TestMetadata("castFromAny.kt") public void testCastFromAny() throws Exception { diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index b5ddf119858..b7aaedc80d1 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -28085,11 +28085,6 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/sam/arrayAsVarargAfterSamArgument.kt"); } - @TestMetadata("arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.kt") - public void testArrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument() throws Exception { - runTest("compiler/testData/codegen/box/sam/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.kt"); - } - @TestMetadata("castFromAny.kt") public void testCastFromAny() throws Exception { runTest("compiler/testData/codegen/box/sam/castFromAny.kt"); From ba44ad1aa3116acf1d379fce18b4f9f97ccb53c3 Mon Sep 17 00:00:00 2001 From: Victor Petukhov Date: Fri, 25 Sep 2020 16:11:27 +0300 Subject: [PATCH 126/212] Approximate anonymous return types for private inline functions to explicit supertype or Any (KT-33917) --- ...irOldFrontendDiagnosticsTestGenerated.java | 6 +++ .../rendering/DefaultErrorMessages.java | 3 +- .../kotlin/resolve/DescriptorResolver.java | 14 +++-- .../VariableTypeAndInitializerResolver.kt | 8 ++- ...nctionsReturningAnonymousObjectsChecker.kt | 5 +- ...approximateReturnedAnonymousObjects.fir.kt | 52 +++++++++++++++++++ .../approximateReturnedAnonymousObjects.kt | 52 +++++++++++++++++++ .../approximateReturnedAnonymousObjects.txt | 22 ++++++++ .../inline/returnedAnonymousObjects.fir.kt | 51 ++++++++++++++++-- .../tests/inline/returnedAnonymousObjects.kt | 51 ++++++++++++++++-- .../tests/inline/returnedAnonymousObjects.txt | 22 +++++++- .../test/runners/DiagnosticTestGenerated.java | 6 +++ .../LightAnalysisModeTestGenerated.java | 10 ++-- .../kotlin/config/LanguageVersionSettings.kt | 2 +- 14 files changed, 276 insertions(+), 28 deletions(-) create mode 100644 compiler/testData/diagnostics/tests/inline/approximateReturnedAnonymousObjects.fir.kt create mode 100644 compiler/testData/diagnostics/tests/inline/approximateReturnedAnonymousObjects.kt create mode 100644 compiler/testData/diagnostics/tests/inline/approximateReturnedAnonymousObjects.txt diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java index 5749ee5d155..ff5f288d125 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java @@ -14317,6 +14317,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti runTest("compiler/testData/diagnostics/tests/inline/anonymousObjects.kt"); } + @Test + @TestMetadata("approximateReturnedAnonymousObjects.kt") + public void testApproximateReturnedAnonymousObjects() throws Exception { + runTest("compiler/testData/diagnostics/tests/inline/approximateReturnedAnonymousObjects.kt"); + } + @Test @TestMetadata("assignment.kt") public void testAssignment() throws Exception { diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java index 4d5c0410f94..6647df6c551 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java @@ -1027,8 +1027,7 @@ public class DefaultErrorMessages { MAP.put(PROTECTED_CALL_FROM_PUBLIC_INLINE_ERROR, "Protected function call from public-API inline function is prohibited", NAME); MAP.put(INVALID_DEFAULT_FUNCTIONAL_PARAMETER_FOR_INLINE, "Invalid default value for inline parameter: ''{0}''. Only lambdas, anonymous functions, and callable references are supported", ELEMENT_TEXT, SHORT_NAMES_IN_TYPES); MAP.put(NOT_SUPPORTED_INLINE_PARAMETER_IN_INLINE_PARAMETER_DEFAULT_VALUE, "Usage of inline parameter ''{0}'' in default value for another inline parameter is not supported", ELEMENT_TEXT, SHORT_NAMES_IN_TYPES); - MAP.put(PRIVATE_INLINE_FUNCTIONS_RETURNING_ANONYMOUS_OBJECTS, "Return type of the private inline function can't be anonymous. It will be approximated to Any in 1.5." + - "See https://youtrack.jetbrains.com/issue/KT-33917 for more details"); + MAP.put(PRIVATE_INLINE_FUNCTIONS_RETURNING_ANONYMOUS_OBJECTS, "Return type of the private inline function can't be anonymous. It will be approximated to Any in a future release. See KT-33917 for more details"); //Inline non locals MAP.put(NON_LOCAL_RETURN_NOT_ALLOWED, "Can''t inline ''{0}'' here: it may contain non-local returns. Add ''crossinline'' modifier to parameter declaration ''{0}''", ELEMENT_TEXT); MAP.put(INLINE_CALL_CYCLE, "The ''{0}'' invocation is a part of inline cycle", NAME); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/DescriptorResolver.java b/compiler/frontend/src/org/jetbrains/kotlin/resolve/DescriptorResolver.java index ac2ed637f87..3e5126207e1 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/DescriptorResolver.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/DescriptorResolver.java @@ -1024,7 +1024,8 @@ public class DescriptorResolver { @NotNull KtDeclaration declaration, @NotNull KotlinType type, @NotNull BindingTrace trace, - @NotNull Iterable anonymousTypeTransformers + @NotNull Iterable anonymousTypeTransformers, + @NotNull LanguageVersionSettings languageVersionSettings ) { for (DeclarationSignatureAnonymousTypeTransformer transformer : anonymousTypeTransformers) { KotlinType transformedType = transformer.transformAnonymousType(descriptor, type); @@ -1038,7 +1039,12 @@ public class DescriptorResolver { return type; } - if (!DescriptorVisibilities.isPrivate(descriptor.getVisibility())) { + boolean isPrivate = DescriptorVisibilities.isPrivate(descriptor.getVisibility()); + boolean isInlineFunction = descriptor instanceof SimpleFunctionDescriptor && ((SimpleFunctionDescriptor) descriptor).isInline(); + boolean isAnonymousReturnTypesInPrivateInlineFunctionsForbidden = + languageVersionSettings.supportsFeature(LanguageFeature.ApproximateAnonymousReturnTypesInPrivateInlineFunctions); + + if (!isPrivate || (isInlineFunction && isAnonymousReturnTypesInPrivateInlineFunctionsForbidden)) { if (type.getConstructor().getSupertypes().size() == 1) { return type.getConstructor().getSupertypes().iterator().next(); } @@ -1221,7 +1227,9 @@ public class DescriptorResolver { return wrappedTypeFactory.createRecursionIntolerantDeferredType(trace, () -> { PreliminaryDeclarationVisitor.Companion.createForDeclaration(function, trace, languageVersionSettings); KotlinType type = expressionTypingServices.getBodyExpressionType(trace, scope, dataFlowInfo, function, functionDescriptor); - KotlinType publicType = transformAnonymousTypeIfNeeded(functionDescriptor, function, type, trace, anonymousTypeTransformers); + KotlinType publicType = transformAnonymousTypeIfNeeded( + functionDescriptor, function, type, trace, anonymousTypeTransformers, languageVersionSettings + ); UnwrappedType approximatedType = typeApproximator.approximateDeclarationType(publicType, false, languageVersionSettings); KotlinType sanitizedType = declarationReturnTypeSanitizer.sanitizeReturnType(approximatedType, wrappedTypeFactory, trace, languageVersionSettings); functionsTypingVisitor.checkTypesForReturnStatements(function, trace, sanitizedType); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/VariableTypeAndInitializerResolver.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/VariableTypeAndInitializerResolver.kt index 7d715c66848..7ea99f687a2 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/VariableTypeAndInitializerResolver.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/VariableTypeAndInitializerResolver.kt @@ -91,7 +91,9 @@ class VariableTypeAndInitializerResolver( val initializerType = resolveInitializerType( scopeForInitializer, variable.initializer!!, dataFlowInfo, inferenceSession, trace, local ) - transformAnonymousTypeIfNeeded(variableDescriptor, variable, initializerType, trace, anonymousTypeTransformers) + transformAnonymousTypeIfNeeded( + variableDescriptor, variable, initializerType, trace, anonymousTypeTransformers, languageVersionSettings + ) } else -> resolveInitializerType(scopeForInitializer, variable.initializer!!, dataFlowInfo, inferenceSession, trace, local) @@ -157,7 +159,9 @@ class VariableTypeAndInitializerResolver( val delegatedType = getterReturnType?.let { approximateType(it, local) } ?: ErrorUtils.createErrorType("Type from delegate") - transformAnonymousTypeIfNeeded(variableDescriptor, property, delegatedType, trace, anonymousTypeTransformers) + transformAnonymousTypeIfNeeded( + variableDescriptor, property, delegatedType, trace, anonymousTypeTransformers, languageVersionSettings + ) } private fun resolveInitializerType( diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/checkers/PrivateInlineFunctionsReturningAnonymousObjectsChecker.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/checkers/PrivateInlineFunctionsReturningAnonymousObjectsChecker.kt index 5fc1e415886..884007277f0 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/checkers/PrivateInlineFunctionsReturningAnonymousObjectsChecker.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/checkers/PrivateInlineFunctionsReturningAnonymousObjectsChecker.kt @@ -10,16 +10,15 @@ import org.jetbrains.kotlin.descriptors.* import org.jetbrains.kotlin.diagnostics.Errors import org.jetbrains.kotlin.psi.KtDeclaration import org.jetbrains.kotlin.psi.KtNamedFunction -import org.jetbrains.kotlin.psi.psiUtil.isPrivate import org.jetbrains.kotlin.resolve.DescriptorUtils import org.jetbrains.kotlin.types.typeUtil.isAnyOrNullableAny object PrivateInlineFunctionsReturningAnonymousObjectsChecker : DeclarationChecker { override fun check(declaration: KtDeclaration, descriptor: DeclarationDescriptor, context: DeclarationCheckerContext) { - if (context.languageVersionSettings.supportsFeature(LanguageFeature.ForbidAnonymousReturnTypesInPrivateInlineFunctions)) + if (context.languageVersionSettings.supportsFeature(LanguageFeature.ApproximateAnonymousReturnTypesInPrivateInlineFunctions)) return - if (descriptor !is SimpleFunctionDescriptor || !descriptor.isInline || !declaration.isPrivate() || declaration !is KtNamedFunction) + if (descriptor !is SimpleFunctionDescriptor || !descriptor.isInline || !DescriptorVisibilities.isPrivate(descriptor.visibility) || declaration !is KtNamedFunction) return val returnTypeConstructor = descriptor.returnType?.constructor ?: return diff --git a/compiler/testData/diagnostics/tests/inline/approximateReturnedAnonymousObjects.fir.kt b/compiler/testData/diagnostics/tests/inline/approximateReturnedAnonymousObjects.fir.kt new file mode 100644 index 00000000000..e5a992792f2 --- /dev/null +++ b/compiler/testData/diagnostics/tests/inline/approximateReturnedAnonymousObjects.fir.kt @@ -0,0 +1,52 @@ +// !LANGUAGE: +ApproximateAnonymousReturnTypesInPrivateInlineFunctions + +private inline fun foo1(crossinline f: () -> Int) = object { + fun bar(): Int = f() +} + +interface I1 +interface I2 + +private inline fun foo2(crossinline f: () -> Int) = object : I1 { + fun bar(): Int = f() +} + +private inline fun foo3(crossinline f: () -> Int) = object : I1, I2 { + fun bar(): Int = f() +} + +private fun foo4(f: () -> Int) = object { + fun bar(): Int = f() +} + +fun test1(b: Boolean) { + var x = ")!>foo1 { 1 } + if (b) { + x = ")!>foo1 { 2 } + } + x.bar() +} + +fun test2(b: Boolean) { + var x = foo2 { 1 } + if (b) { + x = foo2 { 2 } + } + x.bar() +} + +fun test3(b: Boolean) { + var x = | { super() } public final fun bar(): R|kotlin/Int| { ^bar R|/f|.R|SubstitutionOverride|() }}")!>foo3 { 1 } + if (b) { + x = | { super() } public final fun bar(): R|kotlin/Int| { ^bar R|/f|.R|SubstitutionOverride|() }}")!>foo3 { 2 } + } + x.bar() +} + +fun test4(b: Boolean) { + var x = ")!>foo4 { 1 } + if (b) { + x = ")!>foo4 { 2 } + } + x.bar() +} diff --git a/compiler/testData/diagnostics/tests/inline/approximateReturnedAnonymousObjects.kt b/compiler/testData/diagnostics/tests/inline/approximateReturnedAnonymousObjects.kt new file mode 100644 index 00000000000..7c57464c732 --- /dev/null +++ b/compiler/testData/diagnostics/tests/inline/approximateReturnedAnonymousObjects.kt @@ -0,0 +1,52 @@ +// !LANGUAGE: +ApproximateAnonymousReturnTypesInPrivateInlineFunctions + +private inline fun foo1(crossinline f: () -> Int) = object { + fun bar(): Int = f() +} + +interface I1 +interface I2 + +private inline fun foo2(crossinline f: () -> Int) = object : I1 { + fun bar(): Int = f() +} + +private inline fun foo3(crossinline f: () -> Int) = object : I1, I2 { + fun bar(): Int = f() +} + +private fun foo4(f: () -> Int) = object { + fun bar(): Int = f() +} + +fun test1(b: Boolean) { + var x = foo1 { 1 } + if (b) { + x = foo1 { 2 } + } + x.bar() +} + +fun test2(b: Boolean) { + var x = foo2 { 1 } + if (b) { + x = foo2 { 2 } + } + x.bar() +} + +fun test3(b: Boolean) { + var x = ")!>foo3 { 1 } + if (b) { + x = ")!>foo3 { 2 } + } + x.bar() +} + +fun test4(b: Boolean) { + var x = ")!>foo4 { 1 } + if (b) { + x = ")!>foo4 { 2 } + } + x.bar() +} diff --git a/compiler/testData/diagnostics/tests/inline/approximateReturnedAnonymousObjects.txt b/compiler/testData/diagnostics/tests/inline/approximateReturnedAnonymousObjects.txt new file mode 100644 index 00000000000..29a27873fcb --- /dev/null +++ b/compiler/testData/diagnostics/tests/inline/approximateReturnedAnonymousObjects.txt @@ -0,0 +1,22 @@ +package + +private inline fun foo1(/*0*/ crossinline f: () -> kotlin.Int): kotlin.Any +private inline fun foo2(/*0*/ crossinline f: () -> kotlin.Int): I1 +private inline fun foo3(/*0*/ crossinline f: () -> kotlin.Int): foo3. +private fun foo4(/*0*/ f: () -> kotlin.Int): foo4. +public fun test1(/*0*/ b: kotlin.Boolean): kotlin.Unit +public fun test2(/*0*/ b: kotlin.Boolean): kotlin.Unit +public fun test3(/*0*/ b: kotlin.Boolean): kotlin.Unit +public fun test4(/*0*/ b: kotlin.Boolean): kotlin.Unit + +public interface I1 { + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public interface I2 { + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/testData/diagnostics/tests/inline/returnedAnonymousObjects.fir.kt b/compiler/testData/diagnostics/tests/inline/returnedAnonymousObjects.fir.kt index b7f01aac27d..7e3dfc4bb9a 100644 --- a/compiler/testData/diagnostics/tests/inline/returnedAnonymousObjects.fir.kt +++ b/compiler/testData/diagnostics/tests/inline/returnedAnonymousObjects.fir.kt @@ -1,11 +1,52 @@ -private inline fun foo(crossinline f: () -> Int) = object { +// !LANGUAGE: -ApproximateAnonymousReturnTypesInPrivateInlineFunctions + +private inline fun foo1(crossinline f: () -> Int) = object { fun bar(): Int = f() } -fun test(b: Boolean) { - var x = foo { 1 } +interface I1 +interface I2 + +private inline fun foo2(crossinline f: () -> Int) = object : I1 { + fun bar(): Int = f() +} + +private inline fun foo3(crossinline f: () -> Int) = object : I1, I2 { + fun bar(): Int = f() +} + +private fun foo4(f: () -> Int) = object { + fun bar(): Int = f() +} + +fun test1(b: Boolean) { + var x = ")!>foo1 { 1 } if (b) { - x = foo { 2 } + x = ")!>foo1 { 2 } } x.bar() -} \ No newline at end of file +} + +fun test2(b: Boolean) { + var x = foo2 { 1 } + if (b) { + x = foo2 { 2 } + } + x.bar() +} + +fun test3(b: Boolean) { + var x = | { super() } public final fun bar(): R|kotlin/Int| { ^bar R|/f|.R|SubstitutionOverride|() }}")!>foo3 { 1 } + if (b) { + x = | { super() } public final fun bar(): R|kotlin/Int| { ^bar R|/f|.R|SubstitutionOverride|() }}")!>foo3 { 2 } + } + x.bar() +} + +fun test4(b: Boolean) { + var x = ")!>foo4 { 1 } + if (b) { + x = ")!>foo4 { 2 } + } + x.bar() +} diff --git a/compiler/testData/diagnostics/tests/inline/returnedAnonymousObjects.kt b/compiler/testData/diagnostics/tests/inline/returnedAnonymousObjects.kt index 8a5b43e9f76..a82a5f52719 100644 --- a/compiler/testData/diagnostics/tests/inline/returnedAnonymousObjects.kt +++ b/compiler/testData/diagnostics/tests/inline/returnedAnonymousObjects.kt @@ -1,11 +1,52 @@ -private inline fun foo(crossinline f: () -> Int) = object { +// !LANGUAGE: -ApproximateAnonymousReturnTypesInPrivateInlineFunctions + +private inline fun foo1(crossinline f: () -> Int) = object { fun bar(): Int = f() } -fun test(b: Boolean) { - var x = foo { 1 } +interface I1 +interface I2 + +private inline fun foo2(crossinline f: () -> Int) = object : I1 { + fun bar(): Int = f() +} + +private inline fun foo3(crossinline f: () -> Int) = object : I1, I2 { + fun bar(): Int = f() +} + +private fun foo4(f: () -> Int) = object { + fun bar(): Int = f() +} + +fun test1(b: Boolean) { + var x = ")!>foo1 { 1 } if (b) { - x = foo { 2 } + x = ")!>foo1 { 2 } } x.bar() -} \ No newline at end of file +} + +fun test2(b: Boolean) { + var x = ")!>foo2 { 1 } + if (b) { + x = ")!>foo2 { 2 } + } + x.bar() +} + +fun test3(b: Boolean) { + var x = ")!>foo3 { 1 } + if (b) { + x = ")!>foo3 { 2 } + } + x.bar() +} + +fun test4(b: Boolean) { + var x = ")!>foo4 { 1 } + if (b) { + x = ")!>foo4 { 2 } + } + x.bar() +} diff --git a/compiler/testData/diagnostics/tests/inline/returnedAnonymousObjects.txt b/compiler/testData/diagnostics/tests/inline/returnedAnonymousObjects.txt index df3a53f2a39..d16f56e2003 100644 --- a/compiler/testData/diagnostics/tests/inline/returnedAnonymousObjects.txt +++ b/compiler/testData/diagnostics/tests/inline/returnedAnonymousObjects.txt @@ -1,4 +1,22 @@ package -private inline fun foo(/*0*/ crossinline f: () -> kotlin.Int): foo. -public fun test(/*0*/ b: kotlin.Boolean): kotlin.Unit +private inline fun foo1(/*0*/ crossinline f: () -> kotlin.Int): foo1. +private inline fun foo2(/*0*/ crossinline f: () -> kotlin.Int): foo2. +private inline fun foo3(/*0*/ crossinline f: () -> kotlin.Int): foo3. +private fun foo4(/*0*/ f: () -> kotlin.Int): foo4. +public fun test1(/*0*/ b: kotlin.Boolean): kotlin.Unit +public fun test2(/*0*/ b: kotlin.Boolean): kotlin.Unit +public fun test3(/*0*/ b: kotlin.Boolean): kotlin.Unit +public fun test4(/*0*/ b: kotlin.Boolean): kotlin.Unit + +public interface I1 { + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public interface I2 { + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java index f5f0983cb1b..378bdfa2eff 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java @@ -14323,6 +14323,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/inline/anonymousObjects.kt"); } + @Test + @TestMetadata("approximateReturnedAnonymousObjects.kt") + public void testApproximateReturnedAnonymousObjects() throws Exception { + runTest("compiler/testData/diagnostics/tests/inline/approximateReturnedAnonymousObjects.kt"); + } + @Test @TestMetadata("assignment.kt") public void testAssignment() throws Exception { diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index b7aaedc80d1..f0760698a5d 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -18723,11 +18723,6 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class MixedNamedPosition extends AbstractLightAnalysisModeTest { - @TestMetadata("varargsEvaluationOrder.kt") - public void ignoreVarargsEvaluationOrder() throws Exception { - runTest("compiler/testData/codegen/box/mixedNamedPosition/varargsEvaluationOrder.kt"); - } - private void runTest(String testDataFilePath) throws Exception { KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } @@ -18750,6 +18745,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes public void testVarargs() throws Exception { runTest("compiler/testData/codegen/box/mixedNamedPosition/varargs.kt"); } + + @TestMetadata("varargsEvaluationOrder.kt") + public void testVarargsEvaluationOrder() throws Exception { + runTest("compiler/testData/codegen/box/mixedNamedPosition/varargsEvaluationOrder.kt"); + } } @TestMetadata("compiler/testData/codegen/box/multiDecl") diff --git a/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt b/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt index 47c8028d712..1fd27a05cc3 100644 --- a/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt +++ b/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt @@ -137,7 +137,7 @@ enum class LanguageFeature( AdaptedCallableReferenceAgainstReflectiveType(KOTLIN_1_5, defaultState = LanguageFeature.State.DISABLED), InferenceCompatibility(KOTLIN_1_5, kind = BUG_FIX), RequiredPrimaryConstructorDelegationCallInEnums(KOTLIN_1_5, kind = BUG_FIX), - ForbidAnonymousReturnTypesInPrivateInlineFunctions(KOTLIN_1_5, kind = BUG_FIX), + ApproximateAnonymousReturnTypesInPrivateInlineFunctions(KOTLIN_1_5, kind = BUG_FIX), ForbidReferencingToUnderscoreNamedParameterOfCatchBlock(KOTLIN_1_5, kind = BUG_FIX), UseCorrectExecutionOrderForVarargArguments(KOTLIN_1_5, kind = BUG_FIX), JvmRecordSupport(KOTLIN_1_5), From 2c3031f981d781994b5961e2e29cba2a3e1b5eec Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Thu, 21 Jan 2021 12:40:42 +0300 Subject: [PATCH 127/212] [Test] Mute IC with circular dependencies with JVM IR backend --- tests/mute-common.csv | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/mute-common.csv b/tests/mute-common.csv index 7e6f8f3ad87..197a21c11e1 100644 --- a/tests/mute-common.csv +++ b/tests/mute-common.csv @@ -81,3 +81,23 @@ org.jetbrains.kotlin.idea.caches.resolve.IdeLightClassTestGenerated.CompilationE org.jetbrains.uast.test.kotlin.SimpleKotlinRenderLogTest.testReceiverFun, Analysing of facade annotation with receiver site is broken (connected with KT-40403),, org.jetbrains.kotlin.checkers.FirPsiCheckerTestGenerated.Regression.testJet53,,, FLAKY org.jetbrains.kotlin.idea.caches.resolve.MultiModuleHighlightingTest.testLanguageVersionsViaFacets,,, FLAKY +org.jetbrains.kotlin.jps.build.IncrementalJvmJpsTestGenerated.Jvm.testCircular, Temporary muted due to problems with IC and JVM IR backend,, +org.jetbrains.kotlin.jps.build.IncrementalJvmJpsTestGenerated.Jvm.testCircularDependencyClasses, Temporary muted due to problems with IC and JVM IR backend,, +org.jetbrains.kotlin.jps.build.IncrementalJvmJpsTestGenerated.Jvm.testCircularDependencySamePackageUnchanged, Temporary muted due to problems with IC and JVM IR backend,, +org.jetbrains.kotlin.jps.build.IncrementalJvmJpsTestGenerated.Jvm.testCircularDependencyTopLevelFunctions, Temporary muted due to problems with IC and JVM IR backend,, +org.jetbrains.kotlin.jps.build.IncrementalJvmJpsTestGenerated.Jvm.testCircularDependencyWithAccessToInternal, Temporary muted due to problems with IC and JVM IR backend,, +org.jetbrains.kotlin.jps.build.IncrementalJvmJpsTestGenerated.WithJava.Other.testMultifileClassAddTopLevelFunWithDefault, Temporary muted due to problems with IC and JVM IR backend,, +org.jetbrains.kotlin.jps.build.IncrementalJvmJpsTestGenerated.WithJava.Other.testMultifileClassFileAdded, Temporary muted due to problems with IC and JVM IR backend,, +org.jetbrains.kotlin.jps.build.IncrementalJvmJpsTestGenerated.WithJava.Other.testMultifileClassFileChanged, Temporary muted due to problems with IC and JVM IR backend,, +org.jetbrains.kotlin.jps.build.IncrementalJvmJpsTestGenerated.WithJava.Other.testMultifilePackagePartMethodAdded, Temporary muted due to problems with IC and JVM IR backend,, +org.jetbrains.kotlin.jps.build.IncrementalJvmJpsTestGenerated.WithJava.Other.testMultifilePartsWithProperties, Temporary muted due to problems with IC and JVM IR backend,, +org.jetbrains.kotlin.jps.build.KotlinJpsBuildTest.testCircularDependenciesDifferentPackages, Temporary muted due to problems with IC and JVM IR backend,, +org.jetbrains.kotlin.jps.build.KotlinJpsBuildTest.testCircularDependenciesSamePackage, Temporary muted due to problems with IC and JVM IR backend,, +org.jetbrains.kotlin.jps.build.KotlinJpsBuildTest.testCircularDependenciesSamePackageWithTests, Temporary muted due to problems with IC and JVM IR backend,, +org.jetbrains.kotlin.jps.build.KotlinJpsBuildTest.testCircularDependenciesWrongInternalFromTests, Temporary muted due to problems with IC and JVM IR backend,, +org.jetbrains.kotlin.jps.build.KotlinJpsBuildTest.testCircularDependencyWithReferenceToOldVersionLib, Temporary muted due to problems with IC and JVM IR backend,, +org.jetbrains.kotlin.jps.build.KotlinJpsBuildTestIncremental.testCircularDependenciesDifferentPackages, Temporary muted due to problems with IC and JVM IR backend,, +org.jetbrains.kotlin.jps.build.KotlinJpsBuildTestIncremental.testCircularDependenciesSamePackage, Temporary muted due to problems with IC and JVM IR backend,, +org.jetbrains.kotlin.jps.build.KotlinJpsBuildTestIncremental.testCircularDependenciesSamePackageWithTests, Temporary muted due to problems with IC and JVM IR backend,, +org.jetbrains.kotlin.jps.build.KotlinJpsBuildTestIncremental.testCircularDependenciesWrongInternalFromTests, Temporary muted due to problems with IC and JVM IR backend,, +org.jetbrains.kotlin.jps.build.KotlinJpsBuildTestIncremental.testCircularDependencyWithReferenceToOldVersionLib, Temporary muted due to problems with IC and JVM IR backend,, From 3b97835b742eedb0bd02ecf43fae0ed5755508ef Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Thu, 21 Jan 2021 12:42:40 +0300 Subject: [PATCH 128/212] Disable `-Werror` for :compiler:cli module This is needed because we should compile cli with target version (which is deprecated now) for compatibility with gradle --- build.gradle.kts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.gradle.kts b/build.gradle.kts index ab24ecc1260..62639e4c355 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -325,11 +325,13 @@ extra["tasksWithWarnings"] = listOf( ":kotlin-stdlib:compileTestKotlin", ":kotlin-stdlib-jdk7:compileTestKotlin", ":kotlin-stdlib-jdk8:compileTestKotlin", + ":compiler:cli:compileKotlin", ":compiler:frontend:compileKotlin", ":compiler:fir:tree:compileKotlin", ":compiler:fir:resolve:compileKotlin", ":compiler:fir:checkers:compileKotlin", ":compiler:fir:java:compileKotlin", + ":kotlin-scripting-compiler:compileKotlin", ":plugins:uast-kotlin:compileKotlin", ":plugins:uast-kotlin:compileTestKotlin", ":plugins:uast-kotlin-idea:compileKotlin" From 95aa8dc85a014aeb4deeea677423702c4d11a1b5 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Thu, 21 Jan 2021 13:00:47 +0300 Subject: [PATCH 129/212] Fix detecting of non-physical files in ClassFileFactory --- .../src/org/jetbrains/kotlin/codegen/ClassFileFactory.java | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/ClassFileFactory.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/ClassFileFactory.java index b8b156c1ca2..80edfb9bf18 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/ClassFileFactory.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/ClassFileFactory.java @@ -272,6 +272,7 @@ public class ClassFileFactory implements OutputFileCollection { private static List toIoFilesIgnoringNonPhysical(@NotNull Collection psiFiles) { List result = new ArrayList<>(psiFiles.size()); for (PsiFile psiFile : psiFiles) { + if (psiFile == null) continue; VirtualFile virtualFile = psiFile.getVirtualFile(); // We ignore non-physical files here, because this code is needed to tell the make what inputs affect which outputs // a non-physical file cannot be processed by make From c0bc4920299003508927a2d2ecebd8a28168e4a5 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Thu, 21 Jan 2021 13:58:23 +0300 Subject: [PATCH 130/212] Mute some script tests according to KT-44471 --- .../kotlin/cli/LauncherScriptTest.kt | 20 +++++++++---------- .../jsr223/test/KotlinJsr223ScriptEngineIT.kt | 8 ++++---- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/compiler/tests/org/jetbrains/kotlin/cli/LauncherScriptTest.kt b/compiler/tests/org/jetbrains/kotlin/cli/LauncherScriptTest.kt index 4d02055430f..1521c342c19 100644 --- a/compiler/tests/org/jetbrains/kotlin/cli/LauncherScriptTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/cli/LauncherScriptTest.kt @@ -237,16 +237,16 @@ class LauncherScriptTest : TestCaseWithTmpdir() { } fun testScriptWithXArguments() { - runProcess( - "kotlin", "$testDataDirectory/funWithResultReturn.kts", - expectedExitCode = 1, - expectedStderr = """error: 'kotlin.Result' cannot be used as a return type (funWithResultReturn.kts:2:11) -compiler/testData/launcher/funWithResultReturn.kts:2:11: error: 'kotlin.Result' cannot be used as a return type -fun f() : Result = Result.success(42) - ^ -""" - ) - runProcess("kotlin", "-Xallow-result-return-type", "$testDataDirectory/funWithResultReturn.kts", expectedStdout = "42\n") +// runProcess( +// "kotlin", "$testDataDirectory/funWithResultReturn.kts", +// expectedExitCode = 1, +// expectedStderr = """error: 'kotlin.Result' cannot be used as a return type (funWithResultReturn.kts:2:11) +//compiler/testData/launcher/funWithResultReturn.kts:2:11: error: 'kotlin.Result' cannot be used as a return type +//fun f() : Result = Result.success(42) +// ^ +//""" +// ) +// runProcess("kotlin", "-Xallow-result-return-type", "$testDataDirectory/funWithResultReturn.kts", expectedStdout = "42\n") } fun testNoStdLib() { diff --git a/libraries/scripting/jsr223-test/test/kotlin/script/experimental/jsr223/test/KotlinJsr223ScriptEngineIT.kt b/libraries/scripting/jsr223-test/test/kotlin/script/experimental/jsr223/test/KotlinJsr223ScriptEngineIT.kt index 9ed9afbb973..c79dc4bbab1 100644 --- a/libraries/scripting/jsr223-test/test/kotlin/script/experimental/jsr223/test/KotlinJsr223ScriptEngineIT.kt +++ b/libraries/scripting/jsr223-test/test/kotlin/script/experimental/jsr223/test/KotlinJsr223ScriptEngineIT.kt @@ -321,10 +321,10 @@ obj scriptEngine.put("aValue", 3) - val res1 = scriptEngine.eval(script1) - Assert.assertEquals(1, res1) - val res2 = scriptEngine.eval(script2) - Assert.assertEquals(2, res2) +// val res1 = scriptEngine.eval(script1) +// Assert.assertEquals(1, res1) +// val res2 = scriptEngine.eval(script2) +// Assert.assertEquals(2, res2) } @Test From a253b9508eebd759d707dc846fd67ceff791845d Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Thu, 21 Jan 2021 14:15:08 +0300 Subject: [PATCH 131/212] Mute some ultra light classes tests according to KT-44472 --- tests/mute-common.csv | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/mute-common.csv b/tests/mute-common.csv index 197a21c11e1..fa22ea62e40 100644 --- a/tests/mute-common.csv +++ b/tests/mute-common.csv @@ -101,3 +101,10 @@ org.jetbrains.kotlin.jps.build.KotlinJpsBuildTestIncremental.testCircularDepende org.jetbrains.kotlin.jps.build.KotlinJpsBuildTestIncremental.testCircularDependenciesSamePackageWithTests, Temporary muted due to problems with IC and JVM IR backend,, org.jetbrains.kotlin.jps.build.KotlinJpsBuildTestIncremental.testCircularDependenciesWrongInternalFromTests, Temporary muted due to problems with IC and JVM IR backend,, org.jetbrains.kotlin.jps.build.KotlinJpsBuildTestIncremental.testCircularDependencyWithReferenceToOldVersionLib, Temporary muted due to problems with IC and JVM IR backend,, +org.jetbrains.kotlin.idea.caches.resolve.IdeCompiledLightClassTestGenerated.NullabilityAnnotations.testClass, KT-44472,, +org.jetbrains.kotlin.idea.caches.resolve.IdeCompiledLightClassTestGenerated.NullabilityAnnotations.testClassObjectField, KT-44472,, +org.jetbrains.kotlin.idea.caches.resolve.IdeCompiledLightClassTestGenerated.NullabilityAnnotations.testFileFacade, KT-44472,, +org.jetbrains.kotlin.idea.caches.resolve.IdeCompiledLightClassTestGenerated.Script.testHelloWorld, KT-44472,, +org.jetbrains.kotlin.idea.caches.resolve.IdeCompiledLightClassTestGenerated.Script.testInnerClasses, KT-44472,, +org.jetbrains.kotlin.idea.caches.resolve.IdeCompiledLightClassTestGenerated.testDelegatedNested, KT-44472,, +org.jetbrains.kotlin.idea.caches.resolve.IdeCompiledLightClassTestGenerated.testDelegation, KT-44472,, From 299272fa6df24537cc802af1441d13314343fd80 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Thu, 21 Jan 2021 17:56:32 +0300 Subject: [PATCH 132/212] [Test] Update diagnostics testdata according to allowed suspend fun interfaces --- .../tests/funInterface/funInterfaceDeclarationCheck.kt | 2 +- .../tests/funInterface/suspendFunInterfaceConversion.kt | 2 +- .../chainedFunSuspendConversionForSimpleExpression.kt | 2 +- .../suspendConversion/suspendAndFunConversionInDisabledMode.kt | 2 +- .../suspendConversion/suspendConversionWithFunInterfaces.kt | 2 +- .../tests/unitConversion/chainedFunSuspendUnitConversion.kt | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/compiler/testData/diagnostics/tests/funInterface/funInterfaceDeclarationCheck.kt b/compiler/testData/diagnostics/tests/funInterface/funInterfaceDeclarationCheck.kt index bda27bd3ca9..18071309679 100644 --- a/compiler/testData/diagnostics/tests/funInterface/funInterfaceDeclarationCheck.kt +++ b/compiler/testData/diagnostics/tests/funInterface/funInterfaceDeclarationCheck.kt @@ -71,7 +71,7 @@ interface BaseWithGeneric { fun interface GoodExtensionGeneric : GoodGeneric fun interface GoodSuspend { - suspend fun invoke() + suspend fun invoke() } class WithNestedFun { diff --git a/compiler/testData/diagnostics/tests/funInterface/suspendFunInterfaceConversion.kt b/compiler/testData/diagnostics/tests/funInterface/suspendFunInterfaceConversion.kt index 8faa36cc9db..8c60a7b0cfd 100644 --- a/compiler/testData/diagnostics/tests/funInterface/suspendFunInterfaceConversion.kt +++ b/compiler/testData/diagnostics/tests/funInterface/suspendFunInterfaceConversion.kt @@ -2,7 +2,7 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -NOTHING_TO_INLINE fun interface SuspendRunnable { - suspend fun invoke() + suspend fun invoke() } fun run(r: SuspendRunnable) {} diff --git a/compiler/testData/diagnostics/tests/suspendConversion/chainedFunSuspendConversionForSimpleExpression.kt b/compiler/testData/diagnostics/tests/suspendConversion/chainedFunSuspendConversionForSimpleExpression.kt index 9c19df99408..aaf124a2478 100644 --- a/compiler/testData/diagnostics/tests/suspendConversion/chainedFunSuspendConversionForSimpleExpression.kt +++ b/compiler/testData/diagnostics/tests/suspendConversion/chainedFunSuspendConversionForSimpleExpression.kt @@ -2,7 +2,7 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER fun interface SuspendRunnable { - suspend fun invoke() + suspend fun invoke() } fun foo(s: SuspendRunnable) {} diff --git a/compiler/testData/diagnostics/tests/suspendConversion/suspendAndFunConversionInDisabledMode.kt b/compiler/testData/diagnostics/tests/suspendConversion/suspendAndFunConversionInDisabledMode.kt index f7fffebc507..295d4282553 100644 --- a/compiler/testData/diagnostics/tests/suspendConversion/suspendAndFunConversionInDisabledMode.kt +++ b/compiler/testData/diagnostics/tests/suspendConversion/suspendAndFunConversionInDisabledMode.kt @@ -2,7 +2,7 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION fun interface SuspendRunnable { - suspend fun run() + suspend fun run() } object Test1 { diff --git a/compiler/testData/diagnostics/tests/suspendConversion/suspendConversionWithFunInterfaces.kt b/compiler/testData/diagnostics/tests/suspendConversion/suspendConversionWithFunInterfaces.kt index d36d390e226..9737580400a 100644 --- a/compiler/testData/diagnostics/tests/suspendConversion/suspendConversionWithFunInterfaces.kt +++ b/compiler/testData/diagnostics/tests/suspendConversion/suspendConversionWithFunInterfaces.kt @@ -2,7 +2,7 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER fun interface SuspendRunnable { - suspend fun invoke() + suspend fun invoke() } fun foo1(s: SuspendRunnable) {} diff --git a/compiler/testData/diagnostics/tests/unitConversion/chainedFunSuspendUnitConversion.kt b/compiler/testData/diagnostics/tests/unitConversion/chainedFunSuspendUnitConversion.kt index 6815b33cf66..00306a46ef8 100644 --- a/compiler/testData/diagnostics/tests/unitConversion/chainedFunSuspendUnitConversion.kt +++ b/compiler/testData/diagnostics/tests/unitConversion/chainedFunSuspendUnitConversion.kt @@ -2,7 +2,7 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION fun interface SuspendRunnable { - suspend fun run() + suspend fun run() } fun foo(r: SuspendRunnable) {} From f3364ec602f0b886f17f7af075573c63ceca03a5 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Tue, 26 Jan 2021 17:05:43 +0300 Subject: [PATCH 133/212] [TD] Update testdata according to KT-44546 --- .../inference/lambdaParameterTypeInElvis.fir.kt | 14 ++++++++++++++ .../tests/inference/lambdaParameterTypeInElvis.kt | 3 +-- 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 compiler/testData/diagnostics/tests/inference/lambdaParameterTypeInElvis.fir.kt diff --git a/compiler/testData/diagnostics/tests/inference/lambdaParameterTypeInElvis.fir.kt b/compiler/testData/diagnostics/tests/inference/lambdaParameterTypeInElvis.fir.kt new file mode 100644 index 00000000000..08cdc63c5a2 --- /dev/null +++ b/compiler/testData/diagnostics/tests/inference/lambdaParameterTypeInElvis.fir.kt @@ -0,0 +1,14 @@ +// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -UNREACHABLE_CODE + +interface Some { + fun method(): Unit +} + +fun elvis(nullable: S?, notNullable: S): S = TODO() + +fun Some.doWithPredicate(predicate: (R) -> Unit): R? = TODO() + +fun test(derived: Some) { + val expected: Some = derived.doWithPredicate { it.method() } ?: TODO() + val expected2: Some = elvis(derived.doWithPredicate { it.method() }, TODO()) +} diff --git a/compiler/testData/diagnostics/tests/inference/lambdaParameterTypeInElvis.kt b/compiler/testData/diagnostics/tests/inference/lambdaParameterTypeInElvis.kt index a365e67ebef..1c4ce614a63 100644 --- a/compiler/testData/diagnostics/tests/inference/lambdaParameterTypeInElvis.kt +++ b/compiler/testData/diagnostics/tests/inference/lambdaParameterTypeInElvis.kt @@ -1,4 +1,3 @@ -// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -UNREACHABLE_CODE interface Some { @@ -11,5 +10,5 @@ fun Some.doWithPredicate(predicate: (R) -> Unit): R? = TODO() fun test(derived: Some) { val expected: Some = derived.doWithPredicate { it.method() } ?: TODO() - val expected2: Some = elvis(derived.doWithPredicate { it.method() }, TODO()) + val expected2: Some = elvis(derived.doWithPredicate { it.method() }, TODO()) } From 1300ec3e453aa07336bf263eb0d624da5e3f15e5 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Tue, 26 Jan 2021 17:17:03 +0300 Subject: [PATCH 134/212] Revert "Build: enable -Werror in stdlib/core/compiler/plugins modules" This reverts commit 3be62dfc --- build.gradle.kts | 34 ------------------- compiler/build.gradle.kts | 12 ------- compiler/cli/build.gradle.kts | 2 +- libraries/commonConfiguration.gradle | 10 ------ .../scripting-compiler/build.gradle.kts | 2 +- 5 files changed, 2 insertions(+), 58 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 62639e4c355..b7e4f0a0c5e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -320,25 +320,6 @@ extra["compilerModulesForJps"] = listOf( ":compiler:compiler.version" ) -// TODO: fix remaining warnings and remove this property. -extra["tasksWithWarnings"] = listOf( - ":kotlin-stdlib:compileTestKotlin", - ":kotlin-stdlib-jdk7:compileTestKotlin", - ":kotlin-stdlib-jdk8:compileTestKotlin", - ":compiler:cli:compileKotlin", - ":compiler:frontend:compileKotlin", - ":compiler:fir:tree:compileKotlin", - ":compiler:fir:resolve:compileKotlin", - ":compiler:fir:checkers:compileKotlin", - ":compiler:fir:java:compileKotlin", - ":kotlin-scripting-compiler:compileKotlin", - ":plugins:uast-kotlin:compileKotlin", - ":plugins:uast-kotlin:compileTestKotlin", - ":plugins:uast-kotlin-idea:compileKotlin" -) - -val tasksWithWarnings: List by extra - val coreLibProjects = listOfNotNull( ":kotlin-stdlib", ":kotlin-stdlib-common", @@ -472,21 +453,6 @@ allprojects { } } - if (!kotlinBuildProperties.isInJpsBuildIdeaSync && !kotlinBuildProperties.useFir) { - // For compiler and stdlib, allWarningsAsErrors is configured in the corresponding "root" projects - // (compiler/build.gradle.kts and libraries/commonConfiguration.gradle). - val projectsWithWarningsAsErrors = listOf("core", "plugins").map { File(it).absoluteFile } - if (projectsWithWarningsAsErrors.any(projectDir::startsWith)) { - tasks.withType { - if (path !in tasksWithWarnings) { - kotlinOptions { - allWarningsAsErrors = true - } - } - } - } - } - tasks.withType(VerificationTask::class.java as Class) { (this as VerificationTask).ignoreFailures = ignoreTestFailures } diff --git a/compiler/build.gradle.kts b/compiler/build.gradle.kts index 19e9a8649c0..4afd3561e5e 100644 --- a/compiler/build.gradle.kts +++ b/compiler/build.gradle.kts @@ -10,8 +10,6 @@ plugins { val compilerModules: Array by rootProject.extra val otherCompilerModules = compilerModules.filter { it != path } -val tasksWithWarnings: List by rootProject.extra - val effectSystemEnabled: Boolean by rootProject.extra val newInferenceEnabled: Boolean by rootProject.extra @@ -87,16 +85,6 @@ if (kotlinBuildProperties.isInJpsBuildIdeaSync) { idea { this.module.generatedSourceDirs.add(generationRoot) } -} else { - allprojects { - tasks.withType> { - if (path !in tasksWithWarnings) { - kotlinOptions { - allWarningsAsErrors = true - } - } - } - } } projectTest(parallel = true) { diff --git a/compiler/cli/build.gradle.kts b/compiler/cli/build.gradle.kts index a450e082560..5605a840822 100644 --- a/compiler/cli/build.gradle.kts +++ b/compiler/cli/build.gradle.kts @@ -57,7 +57,7 @@ tasks.withType> { kotlinOptions { languageVersion = "1.3" apiVersion = "1.3" - freeCompilerArgs = freeCompilerArgs - "-progressive" + "-Xskip-prerelease-check" + freeCompilerArgs += "-Xskip-prerelease-check" } } diff --git a/libraries/commonConfiguration.gradle b/libraries/commonConfiguration.gradle index 456b15caa6b..fad6c58bdb2 100644 --- a/libraries/commonConfiguration.gradle +++ b/libraries/commonConfiguration.gradle @@ -9,8 +9,6 @@ ext.configureJavaOnlyJvm6Project = { Project project -> } } -List tasksWithWarnings = (List) rootProject.ext.get("tasksWithWarnings") - ext.configureJvm6Project = { Project project -> project.configure(project) { configurations { @@ -36,14 +34,6 @@ ext.configureJvm6Project = { Project project -> executable = "$JDK_16/bin/java" } } - - project.tasks.withType(org.jetbrains.kotlin.gradle.dsl.KotlinCompile.class) { task -> - if (!tasksWithWarnings.contains(task.path)) { - task.kotlinOptions { - allWarningsAsErrors = true - } - } - } } ext.compileJava9Sources = { Project project, String moduleName, Collection moduleOutputs = [project.sourceSets.main.output] -> diff --git a/plugins/scripting/scripting-compiler/build.gradle.kts b/plugins/scripting/scripting-compiler/build.gradle.kts index 128a2797476..e04a46c3399 100644 --- a/plugins/scripting/scripting-compiler/build.gradle.kts +++ b/plugins/scripting/scripting-compiler/build.gradle.kts @@ -47,7 +47,7 @@ tasks.withType> { kotlinOptions { languageVersion = "1.3" apiVersion = "1.3" - freeCompilerArgs = freeCompilerArgs - "-progressive" + "-Xskip-metadata-version-check" + freeCompilerArgs += "-Xskip-metadata-version-check" } } From bc3b791cd833c83a51c0b09723acf6f8521007ac Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Tue, 26 Jan 2021 17:21:44 +0300 Subject: [PATCH 135/212] [TMP] Remove :kotlin-coroutines-experimental-compat module --- build.gradle.kts | 6 +- .../forTestCompile/ForTestCompileRuntime.java | 5 - ...bstractCompileKotlinAgainstKotlinTest.java | 5 +- .../kotlin/codegen/CodegenTestCase.java | 16 - .../jetbrains/kotlin/test/KotlinBaseTest.kt | 7 - idea/idea-gradle/build.gradle.kts | 3 +- ...thJdkAndRuntimeLightProjectDescriptor.java | 3 +- .../coroutines-experimental/build.gradle.kts | 101 ------ .../experimental/SafeContinuationJvm.kt | 81 ----- .../experimental/intrinsics/IntrinsicsJvm.kt | 119 ------- .../jvm/internal/CoroutineImpl.kt | 61 ---- .../jvm/internal/CoroutineIntrinsics.kt | 23 -- .../migration/CoroutinesMigration.kt | 144 --------- .../jvm/test/CoroutineContextTest.kt | 163 ---------- .../jvm/test/CoroutinesReferenceValuesTest.kt | 60 ---- .../jvm/test/SequenceBuilderTest.kt | 295 ------------------ .../coroutines-experimental/jvm/test/utils.kt | 15 - .../experimental/ContinuationInterceptor.kt | 30 -- .../experimental/CoroutineContext.kt | 79 ----- .../experimental/CoroutineContextImpl.kt | 88 ------ .../coroutines/experimental/Coroutines.kt | 38 --- .../experimental/CoroutinesExperimentalH.kt | 21 -- .../CoroutinesIntrinsicsExperimentalH.kt | 44 --- .../experimental/CoroutinesLibrary.kt | 117 ------- .../experimental/SequenceBuilder.kt | 177 ----------- .../experimental/intrinsics/Intrinsics.kt | 61 ---- libraries/stdlib/jdk7/build.gradle | 1 - libraries/stdlib/jdk8/build.gradle | 1 - libraries/stdlib/jvm/build.gradle | 1 - .../coroutines/CoroutinesMigrationTest.kt | 54 ---- .../build.gradle | 1 - .../RuntimePublicAPITest.kt | 5 - prepare/compiler/build.gradle.kts | 4 +- prepare/idea-plugin/build.gradle.kts | 1 - settings.gradle | 2 - 35 files changed, 6 insertions(+), 1826 deletions(-) delete mode 100644 libraries/stdlib/coroutines-experimental/build.gradle.kts delete mode 100644 libraries/stdlib/coroutines-experimental/jvm/src/kotlin/coroutines/experimental/SafeContinuationJvm.kt delete mode 100644 libraries/stdlib/coroutines-experimental/jvm/src/kotlin/coroutines/experimental/intrinsics/IntrinsicsJvm.kt delete mode 100644 libraries/stdlib/coroutines-experimental/jvm/src/kotlin/coroutines/experimental/jvm/internal/CoroutineImpl.kt delete mode 100644 libraries/stdlib/coroutines-experimental/jvm/src/kotlin/coroutines/experimental/jvm/internal/CoroutineIntrinsics.kt delete mode 100644 libraries/stdlib/coroutines-experimental/jvm/src/kotlin/coroutines/experimental/migration/CoroutinesMigration.kt delete mode 100644 libraries/stdlib/coroutines-experimental/jvm/test/CoroutineContextTest.kt delete mode 100644 libraries/stdlib/coroutines-experimental/jvm/test/CoroutinesReferenceValuesTest.kt delete mode 100644 libraries/stdlib/coroutines-experimental/jvm/test/SequenceBuilderTest.kt delete mode 100644 libraries/stdlib/coroutines-experimental/jvm/test/utils.kt delete mode 100644 libraries/stdlib/coroutines-experimental/src/kotlin/coroutines/experimental/ContinuationInterceptor.kt delete mode 100644 libraries/stdlib/coroutines-experimental/src/kotlin/coroutines/experimental/CoroutineContext.kt delete mode 100644 libraries/stdlib/coroutines-experimental/src/kotlin/coroutines/experimental/CoroutineContextImpl.kt delete mode 100644 libraries/stdlib/coroutines-experimental/src/kotlin/coroutines/experimental/Coroutines.kt delete mode 100644 libraries/stdlib/coroutines-experimental/src/kotlin/coroutines/experimental/CoroutinesExperimentalH.kt delete mode 100644 libraries/stdlib/coroutines-experimental/src/kotlin/coroutines/experimental/CoroutinesIntrinsicsExperimentalH.kt delete mode 100644 libraries/stdlib/coroutines-experimental/src/kotlin/coroutines/experimental/CoroutinesLibrary.kt delete mode 100644 libraries/stdlib/coroutines-experimental/src/kotlin/coroutines/experimental/SequenceBuilder.kt delete mode 100644 libraries/stdlib/coroutines-experimental/src/kotlin/coroutines/experimental/intrinsics/Intrinsics.kt delete mode 100644 libraries/stdlib/jvm/test/coroutines/CoroutinesMigrationTest.kt diff --git a/build.gradle.kts b/build.gradle.kts index b7e4f0a0c5e..bd6351e925b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -333,8 +333,7 @@ val coreLibProjects = listOfNotNull( ":kotlin-test:kotlin-test-junit5", ":kotlin-test:kotlin-test-testng", ":kotlin-test:kotlin-test-js".takeIf { !kotlinBuildProperties.isInJpsBuildIdeaSync }, - ":kotlin-reflect", - ":kotlin-coroutines-experimental-compat" + ":kotlin-reflect" ) val gradlePluginProjects = listOf( @@ -944,8 +943,7 @@ tasks { ":kotlin-reflect:publish", ":kotlin-main-kts:publish", ":kotlin-stdlib-js:publish", - ":kotlin-test:kotlin-test-js:publish", - ":kotlin-coroutines-experimental-compat:publish" + ":kotlin-test:kotlin-test-js:publish" ) } } diff --git a/compiler/test-infrastructure-utils/tests/org/jetbrains/kotlin/codegen/forTestCompile/ForTestCompileRuntime.java b/compiler/test-infrastructure-utils/tests/org/jetbrains/kotlin/codegen/forTestCompile/ForTestCompileRuntime.java index 9aacf91e1b5..13d69085b66 100644 --- a/compiler/test-infrastructure-utils/tests/org/jetbrains/kotlin/codegen/forTestCompile/ForTestCompileRuntime.java +++ b/compiler/test-infrastructure-utils/tests/org/jetbrains/kotlin/codegen/forTestCompile/ForTestCompileRuntime.java @@ -100,11 +100,6 @@ public class ForTestCompileRuntime { return assertExists(new File("dist/kotlinc/lib/kotlin-annotations-android.jar")); } - @NotNull - public static File coroutinesCompatForTests() { - return assertExists(new File("dist/kotlinc/lib/kotlin-coroutines-experimental-compat.jar")); - } - @NotNull private static File assertExists(@NotNull File file) { if (!file.exists()) { diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractCompileKotlinAgainstKotlinTest.java b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractCompileKotlinAgainstKotlinTest.java index d52ba5ffc9f..3ab66e720f3 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractCompileKotlinAgainstKotlinTest.java +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractCompileKotlinAgainstKotlinTest.java @@ -93,10 +93,7 @@ public abstract class AbstractCompileKotlinAgainstKotlinTest extends CodegenTest @NotNull private URLClassLoader createGeneratedClassLoader() throws Exception { return new URLClassLoader( - new URL[]{ - bDir.toURI().toURL(), aDir.toURI().toURL(), - ForTestCompileRuntime.coroutinesCompatForTests().toURI().toURL() - }, + new URL[]{bDir.toURI().toURL(), aDir.toURI().toURL()}, ForTestCompileRuntime.runtimeAndReflectJarClassLoader() ); } diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/CodegenTestCase.java b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/CodegenTestCase.java index 6417bfe459e..383b6e5e941 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/CodegenTestCase.java +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/CodegenTestCase.java @@ -235,7 +235,6 @@ public abstract class CodegenTestCase extends KotlinBaseTest getExtraDependenciesFromKotlinCompileClasspath() { - List includeFromCompileClasspath = CollectionsKt.listOf( - ForTestCompileRuntime.coroutinesCompatForTests() - ); - List compileClasspath = - CollectionsKt.map( - CollectionsKt.filterIsInstance( - myEnvironment.getConfiguration().get(CLIConfigurationKeys.CONTENT_ROOTS), - JvmClasspathRoot.class), - JvmClasspathRoot::getFile); - return CollectionsKt.intersect(compileClasspath, includeFromCompileClasspath); - } - - @NotNull protected String generateToText() { return generateToText(null); @@ -483,7 +468,6 @@ public abstract class CodegenTestCase extends KotlinBaseTest : KtUsefulTestCase() usePreparsedDirectives: Boolean ) { var explicitLanguageVersionSettings: LanguageVersionSettings? = null - var includeCompatExperimentalCoroutines = false val kotlinConfigurationFlags: MutableList = ArrayList(0) for (testFile in testFilesWithConfigurationDirectives) { val content = testFile.content @@ -171,18 +170,12 @@ abstract class KotlinBaseTest : KtUsefulTestCase() """.trimIndent() ) } - if (content.contains(StandardNames.COROUTINES_PACKAGE_FQ_NAME_EXPERIMENTAL.asString())) { - includeCompatExperimentalCoroutines = true - } val fileLanguageVersionSettings: LanguageVersionSettings? = parseLanguageVersionSettings(directives) if (fileLanguageVersionSettings != null) { assert(explicitLanguageVersionSettings == null) { "Should not specify !LANGUAGE directive twice" } explicitLanguageVersionSettings = fileLanguageVersionSettings } } - if (includeCompatExperimentalCoroutines) { - configuration.addJvmClasspathRoot(ForTestCompileRuntime.coroutinesCompatForTests()) - } if (explicitLanguageVersionSettings != null) { configuration.languageVersionSettings = explicitLanguageVersionSettings } diff --git a/idea/idea-gradle/build.gradle.kts b/idea/idea-gradle/build.gradle.kts index 5220535504b..0a54813ac45 100644 --- a/idea/idea-gradle/build.gradle.kts +++ b/idea/idea-gradle/build.gradle.kts @@ -24,7 +24,6 @@ dependencies { compileOnly(intellijPluginDep("Groovy")) compileOnly(intellijPluginDep("junit")) compileOnly(intellijPluginDep("testng")) - runtimeOnly(project(":kotlin-coroutines-experimental-compat")) compileOnly(project(":kotlin-gradle-statistics")) @@ -125,4 +124,4 @@ if (Ide.AS41.orHigher()) { getOrCreateTask("test") { setExcludes(listOf("**")) } -} \ No newline at end of file +} diff --git a/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinWithJdkAndRuntimeLightProjectDescriptor.java b/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinWithJdkAndRuntimeLightProjectDescriptor.java index 16a1fc22ded..f2a6dc345e8 100644 --- a/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinWithJdkAndRuntimeLightProjectDescriptor.java +++ b/idea/idea-test-framework/test/org/jetbrains/kotlin/idea/test/KotlinWithJdkAndRuntimeLightProjectDescriptor.java @@ -40,8 +40,7 @@ public class KotlinWithJdkAndRuntimeLightProjectDescriptor extends KotlinJdkAndL @NotNull public static final KotlinWithJdkAndRuntimeLightProjectDescriptor INSTANCE = new KotlinWithJdkAndRuntimeLightProjectDescriptor( - Arrays.asList(ForTestCompileRuntime.runtimeJarForTests(), - ForTestCompileRuntime.coroutinesCompatForTests()) + Arrays.asList(ForTestCompileRuntime.runtimeJarForTests()) ); public static KotlinWithJdkAndRuntimeLightProjectDescriptor getInstance(LanguageLevel level) { diff --git a/libraries/stdlib/coroutines-experimental/build.gradle.kts b/libraries/stdlib/coroutines-experimental/build.gradle.kts deleted file mode 100644 index 58cbeb5a486..00000000000 --- a/libraries/stdlib/coroutines-experimental/build.gradle.kts +++ /dev/null @@ -1,101 +0,0 @@ -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile - -plugins { - kotlin("jvm") -} - -publish() - -description = "Kotlin pre 1.3 experimental coroutines compatibility library" - -jvmTarget = "1.6" -javaHome = rootProject.extra["JDK_16"] as String - - -sourceSets { - "main" { - java.srcDirs("src", "jvm/src") - } - "test" { - java.srcDirs("jvm/test") - } - "migrationTest" { - if(!kotlinBuildProperties.isInIdeaSync) - java.srcDirs("jvm/test") - } -} -val migrationTestSourceSet = sourceSets["migrationTest"] - -configurations { - "migrationTestImplementation" { - extendsFrom(testImplementation.get()) - } -} - -dependencies { - api(kotlinStdlib()) - testImplementation(project(":kotlin-test:kotlin-test-junit")) - "migrationTestImplementation"(sourceSets.main.get().output) -} - -tasks { - val compileKotlin by existing(KotlinCompile::class) { - kotlinOptions { - languageVersion = "1.3" - apiVersion = "1.3" - freeCompilerArgs = listOf( - "-Xmulti-platform", - "-Xallow-kotlin-package", - "-Xmultifile-parts-inherit", - "-Xopt-in=kotlin.RequiresOptIn", - "-Xopt-in=kotlin.contracts.ExperimentalContracts", - "-Xcoroutines=enable", - "-XXLanguage:-ReleaseCoroutines", - "-Xno-use-ir", - "-Xuse-old-backend" - ) - moduleName = "kotlin-coroutines-experimental-compat" - } - } - val compileTestKotlin by existing(KotlinCompile::class) { - kotlinOptions { - languageVersion = "1.2" - apiVersion = "1.2" - freeCompilerArgs = listOf( - "-Xcoroutines=enable", - "-Xno-use-ir", - "-Xuse-old-backend" - ) - } - } - val compileMigrationTestKotlin by existing(KotlinCompile::class) { - kotlinOptions { - languageVersion = "1.3" - apiVersion = "1.3" - freeCompilerArgs = listOf( - "-Xno-use-ir", - "-Xuse-old-backend" - ) - } - } - - val migrationTestClasses by existing - val migrationTest by creating(Test::class) { - dependsOn(migrationTestClasses) - group = "verification" - testClassesDirs = migrationTestSourceSet.output.classesDirs - classpath = migrationTestSourceSet.runtimeClasspath - } - - val check by existing { - dependsOn(migrationTest) - } - - - val jar by existing(Jar::class) { - callGroovy("manifestAttributes", manifest, project, "Main") - } -} - -sourcesJar() -javadocJar() diff --git a/libraries/stdlib/coroutines-experimental/jvm/src/kotlin/coroutines/experimental/SafeContinuationJvm.kt b/libraries/stdlib/coroutines-experimental/jvm/src/kotlin/coroutines/experimental/SafeContinuationJvm.kt deleted file mode 100644 index 2a6cfb915d8..00000000000 --- a/libraries/stdlib/coroutines-experimental/jvm/src/kotlin/coroutines/experimental/SafeContinuationJvm.kt +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package kotlin.coroutines.experimental - -import java.util.concurrent.atomic.AtomicReferenceFieldUpdater -import kotlin.coroutines.experimental.intrinsics.COROUTINE_SUSPENDED - -@PublishedApi -internal actual class SafeContinuation -internal actual constructor( - private val delegate: Continuation, - initialResult: Any? -) : Continuation { - - @PublishedApi - internal actual constructor(delegate: Continuation) : this(delegate, UNDECIDED) - - public actual override val context: CoroutineContext - get() = delegate.context - - @Volatile - private var result: Any? = initialResult - - companion object { - private val UNDECIDED: Any? = Any() - private val RESUMED: Any? = Any() - - @Suppress("UNCHECKED_CAST") - @JvmStatic - private val RESULT = AtomicReferenceFieldUpdater.newUpdater, Any?>( - SafeContinuation::class.java, Any::class.java as Class, "result" - ) - } - - private class Fail(val exception: Throwable) - - actual override fun resume(value: T) { - while (true) { // lock-free loop - val result = this.result // atomic read - when { - result === UNDECIDED -> if (RESULT.compareAndSet(this, UNDECIDED, value)) return - result === COROUTINE_SUSPENDED -> if (RESULT.compareAndSet(this, COROUTINE_SUSPENDED, RESUMED)) { - delegate.resume(value) - return - } - else -> throw IllegalStateException("Already resumed") - } - } - } - - actual override fun resumeWithException(exception: Throwable) { - while (true) { // lock-free loop - val result = this.result // atomic read - when { - result === UNDECIDED -> if (RESULT.compareAndSet(this, UNDECIDED, Fail(exception))) return - result === COROUTINE_SUSPENDED -> if (RESULT.compareAndSet(this, COROUTINE_SUSPENDED, RESUMED)) { - delegate.resumeWithException(exception) - return - } - else -> throw IllegalStateException("Already resumed") - } - } - } - - @PublishedApi - internal actual fun getResult(): Any? { - var result = this.result // atomic read - if (result === UNDECIDED) { - if (RESULT.compareAndSet(this, UNDECIDED, COROUTINE_SUSPENDED)) return COROUTINE_SUSPENDED - result = this.result // reread volatile var - } - when { - result === RESUMED -> return COROUTINE_SUSPENDED // already called continuation, indicate COROUTINE_SUSPENDED upstream - result is Fail -> throw result.exception - else -> return result // either COROUTINE_SUSPENDED or data - } - } -} diff --git a/libraries/stdlib/coroutines-experimental/jvm/src/kotlin/coroutines/experimental/intrinsics/IntrinsicsJvm.kt b/libraries/stdlib/coroutines-experimental/jvm/src/kotlin/coroutines/experimental/intrinsics/IntrinsicsJvm.kt deleted file mode 100644 index e9a5d9296ed..00000000000 --- a/libraries/stdlib/coroutines-experimental/jvm/src/kotlin/coroutines/experimental/intrinsics/IntrinsicsJvm.kt +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -@file:kotlin.jvm.JvmName("IntrinsicsKt") -@file:kotlin.jvm.JvmMultifileClass -@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") - -package kotlin.coroutines.experimental.intrinsics - -import kotlin.coroutines.experimental.* - -/** - * Starts unintercepted coroutine without receiver and with result type [T] and executes it until its first suspension. - * Returns the result of the coroutine or throws its exception if it does not suspend or [COROUTINE_SUSPENDED] if it suspends. - * In the latter case, the [completion] continuation is invoked when coroutine completes with result or exception. - * This function is designed to be used from inside of [suspendCoroutineOrReturn] to resume the execution of a suspended - * coroutine using a reference to the suspending function. - */ -@SinceKotlin("1.1") -@Suppress("UNCHECKED_CAST") -@kotlin.internal.InlineOnly -public actual inline fun (suspend () -> T).startCoroutineUninterceptedOrReturn( - completion: Continuation -): Any? = (this as Function1, Any?>).invoke(completion) - -/** - * Starts unintercepted coroutine with receiver type [R] and result type [T] and executes it until its first suspension. - * Returns the result of the coroutine or throws its exception if it does not suspend or [COROUTINE_SUSPENDED] if it suspends. - * In the latter case, the [completion] continuation is invoked when coroutine completes with result or exception. - * This function is designed to be used from inside of [suspendCoroutineOrReturn] to resume the execution of a suspended - * coroutine using a reference to the suspending function. - */ -@SinceKotlin("1.1") -@Suppress("UNCHECKED_CAST") -@kotlin.internal.InlineOnly -public actual inline fun (suspend R.() -> T).startCoroutineUninterceptedOrReturn( - receiver: R, - completion: Continuation -): Any? = (this as Function2, Any?>).invoke(receiver, completion) - - -// JVM declarations - -/** - * Creates a coroutine without receiver and with result type [T]. - * This function creates a new, fresh instance of suspendable computation every time it is invoked. - * - * To start executing the created coroutine, invoke `resume(Unit)` on the returned [Continuation] instance. - * The [completion] continuation is invoked when coroutine completes with result or exception. - * - * This function is _unchecked_. Repeated invocation of any resume function on the resulting continuation corrupts the - * state machine of the coroutine and may result in arbitrary behaviour or exception. - */ -@SinceKotlin("1.1") -public actual fun (suspend () -> T).createCoroutineUnchecked( - completion: Continuation -): Continuation = - if (this !is kotlin.coroutines.experimental.jvm.internal.CoroutineImpl) - buildContinuationByInvokeCall(completion) { - @Suppress("UNCHECKED_CAST") - (this as Function1, Any?>).invoke(completion) - } - else - (this.create(completion) as kotlin.coroutines.experimental.jvm.internal.CoroutineImpl).facade - -/** - * Creates a coroutine with receiver type [R] and result type [T]. - * This function creates a new, fresh instance of suspendable computation every time it is invoked. - * - * To start executing the created coroutine, invoke `resume(Unit)` on the returned [Continuation] instance. - * The [completion] continuation is invoked when coroutine completes with result or exception. - * - * This function is _unchecked_. Repeated invocation of any resume function on the resulting continuation corrupts the - * state machine of the coroutine and may result in arbitrary behaviour or exception. - */ -@SinceKotlin("1.1") -public actual fun (suspend R.() -> T).createCoroutineUnchecked( - receiver: R, - completion: Continuation -): Continuation = - if (this !is kotlin.coroutines.experimental.jvm.internal.CoroutineImpl) - buildContinuationByInvokeCall(completion) { - @Suppress("UNCHECKED_CAST") - (this as Function2, Any?>).invoke(receiver, completion) - } - else - (this.create(receiver, completion) as kotlin.coroutines.experimental.jvm.internal.CoroutineImpl).facade - -// INTERNAL DEFINITIONS - -private inline fun buildContinuationByInvokeCall( - completion: Continuation, - crossinline block: () -> Any? -): Continuation { - val continuation = - object : Continuation { - override val context: CoroutineContext - get() = completion.context - - override fun resume(value: Unit) { - processBareContinuationResume(completion, block) - } - - override fun resumeWithException(exception: Throwable) { - completion.resumeWithException(exception) - } - } - - return kotlin.coroutines.experimental.jvm.internal.interceptContinuationIfNeeded(completion.context, continuation) -} - -/** - * This value is used as a return value of [suspendCoroutineOrReturn] `block` argument to state that - * the execution was suspended and will not return any result immediately. - */ -@SinceKotlin("1.1") -public actual val COROUTINE_SUSPENDED: Any get() = kotlin.coroutines.intrinsics.COROUTINE_SUSPENDED diff --git a/libraries/stdlib/coroutines-experimental/jvm/src/kotlin/coroutines/experimental/jvm/internal/CoroutineImpl.kt b/libraries/stdlib/coroutines-experimental/jvm/src/kotlin/coroutines/experimental/jvm/internal/CoroutineImpl.kt deleted file mode 100644 index 4c4d01fc82b..00000000000 --- a/libraries/stdlib/coroutines-experimental/jvm/src/kotlin/coroutines/experimental/jvm/internal/CoroutineImpl.kt +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package kotlin.coroutines.experimental.jvm.internal - -import java.lang.IllegalStateException -import kotlin.coroutines.experimental.Continuation -import kotlin.coroutines.experimental.CoroutineContext -import kotlin.coroutines.experimental.processBareContinuationResume -import kotlin.jvm.internal.Lambda - -/** - * @suppress - */ -abstract class CoroutineImpl( - arity: Int, - @JvmField - protected var completion: Continuation? -) : Lambda(arity), Continuation { - - // label == -1 when coroutine cannot be started (it is just a factory object) or has already finished execution - // label == 0 in initial part of the coroutine - @JvmField - protected var label: Int = if (completion != null) 0 else -1 - - private val _context: CoroutineContext? = completion?.context - - override val context: CoroutineContext - get() = _context!! - - private var _facade: Continuation? = null - - val facade: Continuation get() { - if (_facade == null) _facade = interceptContinuationIfNeeded(_context!!, this) - return _facade!! - } - - override fun resume(value: Any?) { - processBareContinuationResume(completion!!) { - doResume(value, null) - } - } - - override fun resumeWithException(exception: Throwable) { - processBareContinuationResume(completion!!) { - doResume(null, exception) - } - } - - protected abstract fun doResume(data: Any?, exception: Throwable?): Any? - - open fun create(completion: Continuation<*>): Continuation { - throw IllegalStateException("create(Continuation) has not been overridden") - } - - open fun create(value: Any?, completion: Continuation<*>): Continuation { - throw IllegalStateException("create(Any?;Continuation) has not been overridden") - } -} diff --git a/libraries/stdlib/coroutines-experimental/jvm/src/kotlin/coroutines/experimental/jvm/internal/CoroutineIntrinsics.kt b/libraries/stdlib/coroutines-experimental/jvm/src/kotlin/coroutines/experimental/jvm/internal/CoroutineIntrinsics.kt deleted file mode 100644 index b33c822c318..00000000000 --- a/libraries/stdlib/coroutines-experimental/jvm/src/kotlin/coroutines/experimental/jvm/internal/CoroutineIntrinsics.kt +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -@file:JvmName("CoroutineIntrinsics") - -package kotlin.coroutines.experimental.jvm.internal - -import kotlin.coroutines.experimental.Continuation -import kotlin.coroutines.experimental.ContinuationInterceptor -import kotlin.coroutines.experimental.CoroutineContext - -/** - * @suppress - */ -fun normalizeContinuation(continuation: Continuation): Continuation = - (continuation as? CoroutineImpl)?.facade ?: continuation - -internal fun interceptContinuationIfNeeded( - context: CoroutineContext, - continuation: Continuation -) = context[ContinuationInterceptor]?.interceptContinuation(continuation) ?: continuation diff --git a/libraries/stdlib/coroutines-experimental/jvm/src/kotlin/coroutines/experimental/migration/CoroutinesMigration.kt b/libraries/stdlib/coroutines-experimental/jvm/src/kotlin/coroutines/experimental/migration/CoroutinesMigration.kt deleted file mode 100644 index e719df918b6..00000000000 --- a/libraries/stdlib/coroutines-experimental/jvm/src/kotlin/coroutines/experimental/migration/CoroutinesMigration.kt +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package kotlin.coroutines.experimental.migration - -import kotlin.coroutines.experimental.Continuation as ExperimentalContinuation -import kotlin.coroutines.experimental.CoroutineContext as ExperimentalCoroutineContext -import kotlin.coroutines.experimental.AbstractCoroutineContextElement as ExperimentalAbstractCoroutineContextElement -import kotlin.coroutines.experimental.EmptyCoroutineContext as ExperimentalEmptyCoroutineContext -import kotlin.coroutines.experimental.ContinuationInterceptor as ExperimentalContinuationInterceptor -import kotlin.coroutines.* -import kotlin.coroutines.intrinsics.* - - -/** - * Converts [Continuation] to [ExperimentalContinuation]. - */ -@SinceKotlin("1.3") -public fun Continuation.toExperimentalContinuation(): ExperimentalContinuation = - (this as? ContinuationMigration)?.continuation ?: ExperimentalContinuationMigration(this) - -/** - * Converts [ExperimentalContinuation] to [Continuation]. - */ -@SinceKotlin("1.3") -public fun ExperimentalContinuation.toContinuation(): Continuation = - (this as? ExperimentalContinuationMigration)?.continuation ?: ContinuationMigration(this) - -/** - * Converts [CoroutineContext] to [ExperimentalCoroutineContext]. - */ -@SinceKotlin("1.3") -public fun CoroutineContext.toExperimentalCoroutineContext(): ExperimentalCoroutineContext { - val interceptor = get(ContinuationInterceptor.Key) - val migration = get(ContextMigration.Key) - val remainder = minusKey(ContinuationInterceptor.Key).minusKey(ContextMigration.Key) - val original = migration?.context ?: ExperimentalEmptyCoroutineContext - val result = if (remainder === EmptyCoroutineContext) original else original + ExperimentalContextMigration(remainder) - return if (interceptor == null) result else result + interceptor.toExperimentalContinuationInterceptor() -} - -/** - * Converts [ExperimentalCoroutineContext] to [CoroutineContext]. - */ -@SinceKotlin("1.3") -public fun ExperimentalCoroutineContext.toCoroutineContext(): CoroutineContext { - val interceptor = get(ExperimentalContinuationInterceptor.Key) - val migration = get(ExperimentalContextMigration.Key) - val remainder = minusKey(ExperimentalContinuationInterceptor.Key).minusKey(ExperimentalContextMigration.Key) - val original = migration?.context ?: EmptyCoroutineContext - val result = if (remainder === ExperimentalEmptyCoroutineContext) original else original + ContextMigration(remainder) - return if (interceptor == null) result else result + interceptor.toContinuationInterceptor() -} - -/** - * Converts [ContinuationInterceptor] to [ExperimentalContinuationInterceptor]. - */ -@SinceKotlin("1.3") -public fun ContinuationInterceptor.toExperimentalContinuationInterceptor(): ExperimentalContinuationInterceptor = - (this as? ContinuationInterceptorMigration)?.interceptor ?: ExperimentalContinuationInterceptorMigration(this) - -/** - * Converts [ExperimentalContinuationInterceptor] to [ContinuationInterceptor]. - */ -@SinceKotlin("1.3") -public fun ExperimentalContinuationInterceptor.toContinuationInterceptor(): ContinuationInterceptor = - (this as? ExperimentalContinuationInterceptorMigration)?.interceptor ?: ContinuationInterceptorMigration(this) - -// ------------------ converter classes ------------------ -// Their name starts with "Experimental" if they implement the corresponding Experimental interfaces - -private class ExperimentalContinuationMigration(val continuation: Continuation): ExperimentalContinuation { - override val context = continuation.context.toExperimentalCoroutineContext() - override fun resume(value: T) = continuation.resume(value) - override fun resumeWithException(exception: Throwable) = continuation.resumeWithException(exception) -} - -private class ContinuationMigration(val continuation: ExperimentalContinuation): Continuation { - override val context: CoroutineContext = continuation.context.toCoroutineContext() - override fun resumeWith(result: Result) { - result - .onSuccess { continuation.resume(it) } - .onFailure { continuation.resumeWithException(it) } - } -} - -private class ExperimentalContextMigration(val context: CoroutineContext): ExperimentalAbstractCoroutineContextElement(Key) { - companion object Key : ExperimentalCoroutineContext.Key -} - -private class ContextMigration(val context: ExperimentalCoroutineContext): AbstractCoroutineContextElement(Key) { - companion object Key : CoroutineContext.Key -} - -private class ExperimentalContinuationInterceptorMigration(val interceptor: ContinuationInterceptor) : ExperimentalContinuationInterceptor { - override val key: ExperimentalCoroutineContext.Key<*> - get() = ExperimentalContinuationInterceptor.Key - - override fun interceptContinuation(continuation: ExperimentalContinuation): ExperimentalContinuation = - interceptor.interceptContinuation(continuation.toContinuation()).toExperimentalContinuation() -} - -private class ContinuationInterceptorMigration(val interceptor: ExperimentalContinuationInterceptor) : ContinuationInterceptor { - override val key: CoroutineContext.Key<*> - get() = ContinuationInterceptor.Key - - override fun interceptContinuation(continuation: Continuation): Continuation = - interceptor.interceptContinuation(continuation.toExperimentalContinuation()).toContinuation() -} - -internal fun ((Continuation) -> Any?).toExperimentalSuspendFunction(): (ExperimentalContinuation) -> Any? = - ExperimentalSuspendFunction0Migration(this) - -internal fun ((T1, Continuation) -> Any?).toExperimentalSuspendFunction(): (T1, ExperimentalContinuation) -> Any? = - ExperimentalSuspendFunction1Migration(this) - -internal fun ((T1, T2, Continuation) -> Any?).toExperimentalSuspendFunction(): (T1, T2, ExperimentalContinuation) -> Any? = - ExperimentalSuspendFunction2Migration(this) - -private class ExperimentalSuspendFunction0Migration( - val function: (Continuation) -> Any? -) : (ExperimentalContinuation) -> Any? { - override fun invoke(continuation: ExperimentalContinuation): Any? { - return function(continuation.toContinuation()) - } -} - -private class ExperimentalSuspendFunction1Migration( - val function: (T1, Continuation) -> Any? -) : (T1, ExperimentalContinuation) -> Any? { - override fun invoke(t1: T1, continuation: ExperimentalContinuation): Any? { - return function(t1, continuation.toContinuation()) - } -} - -private class ExperimentalSuspendFunction2Migration( - val function: (T1, T2, Continuation) -> Any? -) : (T1, T2, ExperimentalContinuation) -> Any? { - override fun invoke(t1: T1, t2: T2, continuation: ExperimentalContinuation): Any? { - return function(t1, t2, continuation.toContinuation()) - } -} diff --git a/libraries/stdlib/coroutines-experimental/jvm/test/CoroutineContextTest.kt b/libraries/stdlib/coroutines-experimental/jvm/test/CoroutineContextTest.kt deleted file mode 100644 index f441dbbff2f..00000000000 --- a/libraries/stdlib/coroutines-experimental/jvm/test/CoroutineContextTest.kt +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package test.coroutines - -import kotlin.test.* -import kotlin.coroutines.experimental.* - -class CoroutineContextTest { - data class CtxA(val i: Int) : AbstractCoroutineContextElement(CtxA) { - companion object Key : CoroutineContext.Key - } - - data class CtxB(val i: Int) : AbstractCoroutineContextElement(CtxB) { - companion object Key : CoroutineContext.Key - } - - data class CtxC(val i: Int) : AbstractCoroutineContextElement(CtxC) { - companion object Key : CoroutineContext.Key - } - - object Disp1 : AbstractCoroutineContextElement(ContinuationInterceptor), ContinuationInterceptor { - override fun interceptContinuation(continuation: Continuation): Continuation = continuation - override fun toString(): String = "Disp1" - } - - object Disp2 : AbstractCoroutineContextElement(ContinuationInterceptor), ContinuationInterceptor { - override fun interceptContinuation(continuation: Continuation): Continuation = continuation - override fun toString(): String = "Disp2" - } - - @Test - fun testGetPlusFold() { - var ctx: CoroutineContext = EmptyCoroutineContext - assertContents(ctx) - assertEquals("EmptyCoroutineContext", ctx.toString()) - - ctx += CtxA(1) - assertContents(ctx, CtxA(1)) - assertEquals("CtxA(i=1)", ctx.toString()) - assertEquals(CtxA(1), ctx[CtxA]) - assertEquals(null, ctx[CtxB]) - assertEquals(null, ctx[CtxC]) - - ctx += CtxB(2) - assertContents(ctx, CtxA(1), CtxB(2)) - assertEquals("[CtxA(i=1), CtxB(i=2)]", ctx.toString()) - assertEquals(CtxA(1), ctx[CtxA]) - assertEquals(CtxB(2), ctx[CtxB]) - assertEquals(null, ctx[CtxC]) - - ctx += CtxC(3) - assertContents(ctx, CtxA(1), CtxB(2), CtxC(3)) - assertEquals("[CtxA(i=1), CtxB(i=2), CtxC(i=3)]", ctx.toString()) - assertEquals(CtxA(1), ctx[CtxA]) - assertEquals(CtxB(2), ctx[CtxB]) - assertEquals(CtxC(3), ctx[CtxC]) - - ctx += CtxB(4) - assertContents(ctx, CtxA(1), CtxC(3), CtxB(4)) - assertEquals("[CtxA(i=1), CtxC(i=3), CtxB(i=4)]", ctx.toString()) - assertEquals(CtxA(1), ctx[CtxA]) - assertEquals(CtxB(4), ctx[CtxB]) - assertEquals(CtxC(3), ctx[CtxC]) - - ctx += CtxA(5) - assertContents(ctx, CtxC(3), CtxB(4), CtxA(5)) - assertEquals("[CtxC(i=3), CtxB(i=4), CtxA(i=5)]", ctx.toString()) - assertEquals(CtxA(5), ctx[CtxA]) - assertEquals(CtxB(4), ctx[CtxB]) - assertEquals(CtxC(3), ctx[CtxC]) - } - - @Test - fun testMinusKey() { - var ctx: CoroutineContext = CtxA(1) + CtxB(2) + CtxC(3) - assertContents(ctx, CtxA(1), CtxB(2), CtxC(3)) - assertEquals("[CtxA(i=1), CtxB(i=2), CtxC(i=3)]", ctx.toString()) - - ctx = ctx.minusKey(CtxA) - assertContents(ctx, CtxB(2), CtxC(3)) - assertEquals("[CtxB(i=2), CtxC(i=3)]", ctx.toString()) - assertEquals(null, ctx[CtxA]) - assertEquals(CtxB(2), ctx[CtxB]) - assertEquals(CtxC(3), ctx[CtxC]) - - ctx = ctx.minusKey(CtxC) - assertContents(ctx, CtxB(2)) - assertEquals("CtxB(i=2)", ctx.toString()) - assertEquals(null, ctx[CtxA]) - assertEquals(CtxB(2), ctx[CtxB]) - assertEquals(null, ctx[CtxC]) - - ctx = ctx.minusKey(CtxC) - assertContents(ctx, CtxB(2)) - assertEquals("CtxB(i=2)", ctx.toString()) - assertEquals(null, ctx[CtxA]) - assertEquals(CtxB(2), ctx[CtxB]) - assertEquals(null, ctx[CtxC]) - - ctx = ctx.minusKey(CtxB) - assertContents(ctx) - assertEquals("EmptyCoroutineContext", ctx.toString()) - assertEquals(null, ctx[CtxA]) - assertEquals(null, ctx[CtxB]) - assertEquals(null, ctx[CtxC]) - - assertEquals(EmptyCoroutineContext, ctx) - } - - @Test - fun testPlusCombined() { - val ctx1 = CtxA(1) + CtxB(2) - val ctx2 = CtxB(3) + CtxC(4) - val ctx = ctx1 + ctx2 - assertContents(ctx, CtxA(1), CtxB(3), CtxC(4)) - assertEquals("[CtxA(i=1), CtxB(i=3), CtxC(i=4)]", ctx.toString()) - assertEquals(CtxA(1), ctx[CtxA]) - assertEquals(CtxB(3), ctx[CtxB]) - assertEquals(CtxC(4), ctx[CtxC]) - } - - @Test - fun testLastDispatcher() { - var ctx: CoroutineContext = EmptyCoroutineContext - assertContents(ctx) - ctx += CtxA(1) - assertContents(ctx, CtxA(1)) - ctx += Disp1 - assertContents(ctx, CtxA(1), Disp1) - ctx += CtxA(2) - assertContents(ctx, CtxA(2), Disp1) - ctx += CtxB(3) - assertContents(ctx, CtxA(2), CtxB(3), Disp1) - ctx += Disp2 - assertContents(ctx, CtxA(2), CtxB(3), Disp2) - ctx += (CtxB(4) + CtxC(5)) - assertContents(ctx, CtxA(2), CtxB(4), CtxC(5), Disp2) - } - - @Test - fun testEquals() { - val ctx1 = CtxA(1) + CtxB(2) + CtxC(3) - val ctx2 = CtxB(2) + CtxC(3) + CtxA(1) // same - val ctx3 = CtxC(3) + CtxA(1) + CtxB(2) // same - val ctx4 = CtxA(1) + CtxB(2) + CtxC(4) // different - assertEquals(ctx1, ctx2) - assertEquals(ctx1, ctx3) - assertEquals(ctx2, ctx3) - assertNotEquals(ctx1, ctx4) - assertNotEquals(ctx2, ctx4) - assertNotEquals(ctx3, ctx4) - } - - private fun assertContents(ctx: CoroutineContext, vararg elements: CoroutineContext.Element) { - val set = ctx.fold(setOf()) { a, b -> a + b } - assertEquals(listOf(*elements), set.toList()) - for (elem in elements) - assertTrue(ctx[elem.key] == elem) - } -} diff --git a/libraries/stdlib/coroutines-experimental/jvm/test/CoroutinesReferenceValuesTest.kt b/libraries/stdlib/coroutines-experimental/jvm/test/CoroutinesReferenceValuesTest.kt deleted file mode 100644 index 2fecc0446fb..00000000000 --- a/libraries/stdlib/coroutines-experimental/jvm/test/CoroutinesReferenceValuesTest.kt +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package test.coroutines - -import test.assertStaticAndRuntimeTypeIs -import kotlin.test.* -import kotlin.coroutines.experimental.* - -/** - * Test to ensure that coroutine machinery does not call equals/hashCode/toString anywhere. - */ -class CoroutinesReferenceValuesTest { - class BadClass { - override fun equals(other: Any?): Boolean = error("equals") - override fun hashCode(): Int = error("hashCode") - override fun toString(): String = error("toString") - } - - var counter = 0 - - // tail-suspend function via suspendCoroutine (test SafeContinuation) - suspend fun getBadClassViaSuspend(): BadClass = suspendCoroutine { cont -> - counter++ - cont.resume(BadClass()) - } - - // state machine - suspend fun checkBadClassTwice() { - assertStaticAndRuntimeTypeIs(getBadClassViaSuspend()) - assertStaticAndRuntimeTypeIs(getBadClassViaSuspend()) - } - - fun suspend(block: suspend () -> T) = block - - @Test - fun testBadClass() { - val bad = suspend { - checkBadClassTwice() - getBadClassViaSuspend() - } - var result: BadClass? = null - bad.startCoroutine(object : Continuation { - override val context: CoroutineContext = EmptyCoroutineContext - - override fun resume(value: BadClass) { - assertTrue(result == null) - result = value - } - - override fun resumeWithException(exception: Throwable) { - throw exception - } - }) - assertTrue(result is BadClass) - assertEquals(3, counter) - } -} \ No newline at end of file diff --git a/libraries/stdlib/coroutines-experimental/jvm/test/SequenceBuilderTest.kt b/libraries/stdlib/coroutines-experimental/jvm/test/SequenceBuilderTest.kt deleted file mode 100644 index e0ddceffc96..00000000000 --- a/libraries/stdlib/coroutines-experimental/jvm/test/SequenceBuilderTest.kt +++ /dev/null @@ -1,295 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -@file:Suppress("ObsoleteExperimentalCoroutines", "DEPRECATION") - -package test.coroutines - -import kotlin.test.* -import kotlin.coroutines.experimental.buildSequence -import kotlin.coroutines.experimental.buildIterator - -class SequenceBuilderTest { - @Test - fun testSimple() { - val result = buildSequence { - for (i in 1..3) { - yield(2 * i) - } - } - - assertEquals(listOf(2, 4, 6), result.toList()) - // Repeated calls also work - assertEquals(listOf(2, 4, 6), result.toList()) - } - - @Test - fun testCallHasNextSeveralTimes() { - val result = buildSequence { - yield(1) - } - - val iterator = result.iterator() - - assertTrue(iterator.hasNext()) - assertTrue(iterator.hasNext()) - assertTrue(iterator.hasNext()) - - assertEquals(1, iterator.next()) - - assertFalse(iterator.hasNext()) - assertFalse(iterator.hasNext()) - assertFalse(iterator.hasNext()) - - assertFailsWith { iterator.next() } - } - - @Test - fun testManualIteration() { - val result = buildSequence { - yield(1) - yield(2) - yield(3) - } - - val iterator = result.iterator() - - assertTrue(iterator.hasNext()) - assertTrue(iterator.hasNext()) - assertEquals(1, iterator.next()) - - assertTrue(iterator.hasNext()) - assertTrue(iterator.hasNext()) - assertEquals(2, iterator.next()) - - assertEquals(3, iterator.next()) - - assertFalse(iterator.hasNext()) - assertFalse(iterator.hasNext()) - - assertFailsWith { iterator.next() } - - assertEquals(1, result.iterator().next()) - } - - @Test - fun testEmptySequence() { - val result = buildSequence {} - val iterator = result.iterator() - - assertFalse(iterator.hasNext()) - assertFalse(iterator.hasNext()) - - assertFailsWith { iterator.next() } - } - - @Test - fun testLaziness() { - var sharedVar = -2 - val result = buildSequence { - while (true) { - when (sharedVar) { - -1 -> return@buildSequence - -2 -> error("Invalid state: -2") - else -> yield(sharedVar) - } - } - } - - val iterator = result.iterator() - - sharedVar = 1 - assertTrue(iterator.hasNext()) - assertEquals(1, iterator.next()) - - sharedVar = 2 - assertTrue(iterator.hasNext()) - assertEquals(2, iterator.next()) - - sharedVar = 3 - assertTrue(iterator.hasNext()) - assertEquals(3, iterator.next()) - - sharedVar = -1 - assertFalse(iterator.hasNext()) - assertFailsWith { iterator.next() } - } - - @Test - fun testExceptionInCoroutine() { - var sharedVar = -2 - val result = buildSequence { - while (true) { - when (sharedVar) { - -1 -> return@buildSequence - -2 -> throw UnsupportedOperationException("-2 is unsupported") - else -> yield(sharedVar) - } - } - } - - val iterator = result.iterator() - - sharedVar = 1 - assertEquals(1, iterator.next()) - - sharedVar = -2 - assertFailsWith { iterator.hasNext() } - assertFailsWith { iterator.hasNext() } - assertFailsWith { iterator.next() } - } - - @Test - fun testParallelIteration() { - var inc = 0 - val result = buildSequence { - for (i in 1..3) { - inc++ - yield(inc * i) - } - } - - assertEquals(listOf(Pair(1, 2), Pair(6, 8), Pair(15, 18)), result.zip(result).toList()) - } - - @Test - fun testYieldAllIterator() { - val result = buildSequence { - yieldAll(listOf(1, 2, 3).iterator()) - } - assertEquals(listOf(1, 2, 3), result.toList()) - } - - @Test - fun testYieldAllSequence() { - val result = buildSequence { - yieldAll(sequenceOf(1, 2, 3)) - } - assertEquals(listOf(1, 2, 3), result.toList()) - } - - @Test - fun testYieldAllCollection() { - val result = buildSequence { - yieldAll(listOf(1, 2, 3)) - } - assertEquals(listOf(1, 2, 3), result.toList()) - } - - @Test - fun testYieldAllCollectionMixedFirst() { - val result = buildSequence { - yield(0) - yieldAll(listOf(1, 2, 3)) - } - assertEquals(listOf(0, 1, 2, 3), result.toList()) - } - - @Test - fun testYieldAllCollectionMixedLast() { - val result = buildSequence { - yieldAll(listOf(1, 2, 3)) - yield(4) - } - assertEquals(listOf(1, 2, 3, 4), result.toList()) - } - - @Test - fun testYieldAllCollectionMixedBoth() { - val result = buildSequence { - yield(0) - yieldAll(listOf(1, 2, 3)) - yield(4) - } - assertEquals(listOf(0, 1, 2, 3, 4), result.toList()) - } - - @Test - fun testYieldAllCollectionMixedLong() { - val result = buildSequence { - yield(0) - yieldAll(listOf(1, 2, 3)) - yield(4) - yield(5) - yieldAll(listOf(6)) - yield(7) - yieldAll(listOf()) - yield(8) - } - assertEquals(listOf(0, 1, 2, 3, 4, 5, 6, 7, 8), result.toList()) - } - - @Test - fun testYieldAllCollectionOneEmpty() { - val result = buildSequence { - yieldAll(listOf()) - } - assertEquals(listOf(), result.toList()) - } - - @Test - fun testYieldAllCollectionManyEmpty() { - val result = buildSequence { - yieldAll(listOf()) - yieldAll(listOf()) - yieldAll(listOf()) - } - assertEquals(listOf(), result.toList()) - } - - @Test - fun testYieldAllSideEffects() { - val effects = arrayListOf() - val result = buildSequence { - effects.add("a") - yieldAll(listOf(1, 2)) - effects.add("b") - yieldAll(listOf()) - effects.add("c") - yieldAll(listOf(3)) - effects.add("d") - yield(4) - effects.add("e") - yieldAll(listOf()) - effects.add("f") - yield(5) - } - - for (res in result) { - effects.add("(") // marks step start - effects.add(res) - effects.add(")") // marks step end - } - assertEquals( - listOf( - "a", - "(", 1, ")", - "(", 2, ")", - "b", "c", - "(", 3, ")", - "d", - "(", 4, ")", - "e", "f", - "(", 5, ")" - ), - effects.toList() - ) - } - - @Test - fun testInfiniteYieldAll() { - val values = buildIterator { - while (true) { - yieldAll((1..5).map { it }) - } - } - - var sum = 0 - repeat(10) { - sum += values.next() //.also(::println) - } - assertEquals(30, sum) - } -} diff --git a/libraries/stdlib/coroutines-experimental/jvm/test/utils.kt b/libraries/stdlib/coroutines-experimental/jvm/test/utils.kt deleted file mode 100644 index d83a4ebe5d9..00000000000 --- a/libraries/stdlib/coroutines-experimental/jvm/test/utils.kt +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package test - -import kotlin.test.* - -inline fun assertStaticAndRuntimeTypeIs(value: T) { - @Suppress("USELESS_CAST") - if ((value as Any?) !is T) { - fail("Expected value $value to have ${T::class} type") - } -} \ No newline at end of file diff --git a/libraries/stdlib/coroutines-experimental/src/kotlin/coroutines/experimental/ContinuationInterceptor.kt b/libraries/stdlib/coroutines-experimental/src/kotlin/coroutines/experimental/ContinuationInterceptor.kt deleted file mode 100644 index bf082e3072e..00000000000 --- a/libraries/stdlib/coroutines-experimental/src/kotlin/coroutines/experimental/ContinuationInterceptor.kt +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package kotlin.coroutines.experimental - -/** - * Marks coroutine context element that intercepts coroutine continuations. - * The coroutines framework uses [ContinuationInterceptor.Key] to retrieve the interceptor and - * intercepts all coroutine continuations with [interceptContinuation] invocations. - */ -@SinceKotlin("1.1") -public interface ContinuationInterceptor : CoroutineContext.Element { - /** - * The key that defines *the* context interceptor. - */ - companion object Key : CoroutineContext.Key - - /** - * Returns continuation that wraps the original [continuation], thus intercepting all resumptions. - * This function is invoked by coroutines framework when needed and the resulting continuations are - * cached internally per each instance of the original [continuation]. - * - * By convention, implementations that install themselves as *the* interceptor in the context with - * the [Key] shall also scan the context for other element that implement [ContinuationInterceptor] interface - * and use their [interceptContinuation] functions, too. - */ - public fun interceptContinuation(continuation: Continuation): Continuation -} diff --git a/libraries/stdlib/coroutines-experimental/src/kotlin/coroutines/experimental/CoroutineContext.kt b/libraries/stdlib/coroutines-experimental/src/kotlin/coroutines/experimental/CoroutineContext.kt deleted file mode 100644 index 2891e9cb03a..00000000000 --- a/libraries/stdlib/coroutines-experimental/src/kotlin/coroutines/experimental/CoroutineContext.kt +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package kotlin.coroutines.experimental - -/** - * Persistent context for the coroutine. It is an indexed set of [Element] instances. - * An indexed set is a mix between a set and a map. - * Every element in this set has a unique [Key]. Keys are compared _by reference_. - */ -@SinceKotlin("1.1") -public interface CoroutineContext { - /** - * Returns the element with the given [key] from this context or `null`. - * Keys are compared _by reference_, that is to get an element from the context the reference to its actual key - * object must be presented to this function. - */ - public operator fun get(key: Key): E? - - /** - * Accumulates entries of this context starting with [initial] value and applying [operation] - * from left to right to current accumulator value and each element of this context. - */ - public fun fold(initial: R, operation: (R, Element) -> R): R - - /** - * Returns a context containing elements from this context and elements from other [context]. - * The elements from this context with the same key as in the other one are dropped. - */ - public operator fun plus(context: CoroutineContext): CoroutineContext = - if (context === EmptyCoroutineContext) this else // fast path -- avoid lambda creation - context.fold(this) { acc, element -> - val removed = acc.minusKey(element.key) - if (removed === EmptyCoroutineContext) element else { - // make sure interceptor is always last in the context (and thus is fast to get when present) - val interceptor = removed[ContinuationInterceptor] - if (interceptor == null) CombinedContext(removed, element) else { - val left = removed.minusKey(ContinuationInterceptor) - if (left === EmptyCoroutineContext) CombinedContext(element, interceptor) else - CombinedContext(CombinedContext(left, element), interceptor) - } - } - } - - /** - * Returns a context containing elements from this context, but without an element with - * the specified [key]. Keys are compared _by reference_, that is to remove an element from the context - * the reference to its actual key object must be presented to this function. - */ - public fun minusKey(key: Key<*>): CoroutineContext - - /** - * An element of the [CoroutineContext]. An element of the coroutine context is a singleton context by itself. - */ - public interface Element : CoroutineContext { - /** - * A key of this coroutine context element. - */ - public val key: Key<*> - - @Suppress("UNCHECKED_CAST") - public override operator fun get(key: Key): E? = - if (this.key === key) this as E else null - - public override fun fold(initial: R, operation: (R, Element) -> R): R = - operation(initial, this) - - public override fun minusKey(key: Key<*>): CoroutineContext = - if (this.key === key) EmptyCoroutineContext else this - } - - /** - * Key for the elements of [CoroutineContext]. [E] is a type of element with this key. - * Keys in the context are compared _by reference_. - */ - public interface Key -} diff --git a/libraries/stdlib/coroutines-experimental/src/kotlin/coroutines/experimental/CoroutineContextImpl.kt b/libraries/stdlib/coroutines-experimental/src/kotlin/coroutines/experimental/CoroutineContextImpl.kt deleted file mode 100644 index ce34fd7437d..00000000000 --- a/libraries/stdlib/coroutines-experimental/src/kotlin/coroutines/experimental/CoroutineContextImpl.kt +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package kotlin.coroutines.experimental - -import kotlin.coroutines.experimental.CoroutineContext.* - -/** - * Base class for [CoroutineContext.Element] implementations. - */ -@SinceKotlin("1.1") -public abstract class AbstractCoroutineContextElement(public override val key: Key<*>) : Element - -/** - * An empty coroutine context. - */ -@SinceKotlin("1.1") -public object EmptyCoroutineContext : CoroutineContext { - public override fun get(key: Key): E? = null - public override fun fold(initial: R, operation: (R, Element) -> R): R = initial - public override fun plus(context: CoroutineContext): CoroutineContext = context - public override fun minusKey(key: Key<*>): CoroutineContext = this - public override fun hashCode(): Int = 0 - public override fun toString(): String = "EmptyCoroutineContext" -} - -//--------------------- internal impl --------------------- - -// this class is not exposed, but is hidden inside implementations -// this is a left-biased list, so that `plus` works naturally -internal class CombinedContext(val left: CoroutineContext, val element: Element) : CoroutineContext { - override fun get(key: Key): E? { - var cur = this - while (true) { - cur.element[key]?.let { return it } - val next = cur.left - if (next is CombinedContext) { - cur = next - } else { - return next[key] - } - } - } - - public override fun fold(initial: R, operation: (R, Element) -> R): R = - operation(left.fold(initial, operation), element) - - public override fun minusKey(key: Key<*>): CoroutineContext { - element[key]?.let { return left } - val newLeft = left.minusKey(key) - return when { - newLeft === left -> this - newLeft === EmptyCoroutineContext -> element - else -> CombinedContext(newLeft, element) - } - } - - private fun size(): Int = - if (left is CombinedContext) left.size() + 1 else 2 - - private fun contains(element: Element): Boolean = - get(element.key) == element - - private fun containsAll(context: CombinedContext): Boolean { - var cur = context - while (true) { - if (!contains(cur.element)) return false - val next = cur.left - if (next is CombinedContext) { - cur = next - } else { - return contains(next as Element) - } - } - } - - override fun equals(other: Any?): Boolean = - this === other || other is CombinedContext && other.size() == size() && other.containsAll(this) - - override fun hashCode(): Int = left.hashCode() + element.hashCode() - - override fun toString(): String = - "[" + fold("") { acc, element -> - if (acc.isEmpty()) element.toString() else acc + ", " + element - } + "]" -} diff --git a/libraries/stdlib/coroutines-experimental/src/kotlin/coroutines/experimental/Coroutines.kt b/libraries/stdlib/coroutines-experimental/src/kotlin/coroutines/experimental/Coroutines.kt deleted file mode 100644 index 0238a465183..00000000000 --- a/libraries/stdlib/coroutines-experimental/src/kotlin/coroutines/experimental/Coroutines.kt +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package kotlin.coroutines.experimental - -/** - * Interface representing a continuation after a suspension point that returns value of type `T`. - */ -@SinceKotlin("1.1") -public interface Continuation { - /** - * Context of the coroutine that corresponds to this continuation. - */ - public val context: CoroutineContext - - /** - * Resumes the execution of the corresponding coroutine passing [value] as the return value of the last suspension point. - */ - public fun resume(value: T) - - /** - * Resumes the execution of the corresponding coroutine so that the [exception] is re-thrown right after the - * last suspension point. - */ - public fun resumeWithException(exception: Throwable) -} - -/** - * Classes and interfaces marked with this annotation are restricted when used as receivers for extension - * `suspend` functions. These `suspend` extensions can only invoke other member or extension `suspend` functions on this particular - * receiver only and are restricted from calling arbitrary suspension functions. - */ -@SinceKotlin("1.1") -@Target(AnnotationTarget.CLASS) -@Retention(AnnotationRetention.BINARY) -public annotation class RestrictsSuspension diff --git a/libraries/stdlib/coroutines-experimental/src/kotlin/coroutines/experimental/CoroutinesExperimentalH.kt b/libraries/stdlib/coroutines-experimental/src/kotlin/coroutines/experimental/CoroutinesExperimentalH.kt deleted file mode 100644 index ca614d7f794..00000000000 --- a/libraries/stdlib/coroutines-experimental/src/kotlin/coroutines/experimental/CoroutinesExperimentalH.kt +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package kotlin.coroutines.experimental - -@PublishedApi -internal expect class SafeContinuation : Continuation { - internal constructor(delegate: Continuation, initialResult: Any?) - - @PublishedApi - internal constructor(delegate: Continuation) - - @PublishedApi - internal fun getResult(): Any? - - override val context: CoroutineContext - override fun resume(value: T): Unit - override fun resumeWithException(exception: Throwable): Unit -} diff --git a/libraries/stdlib/coroutines-experimental/src/kotlin/coroutines/experimental/CoroutinesIntrinsicsExperimentalH.kt b/libraries/stdlib/coroutines-experimental/src/kotlin/coroutines/experimental/CoroutinesIntrinsicsExperimentalH.kt deleted file mode 100644 index 99f319b1d72..00000000000 --- a/libraries/stdlib/coroutines-experimental/src/kotlin/coroutines/experimental/CoroutinesIntrinsicsExperimentalH.kt +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -package kotlin.coroutines.experimental.intrinsics - -import kotlin.coroutines.experimental.Continuation - -/** - * Starts unintercepted coroutine without receiver and with result type [T] and executes it until its first suspension. - * Returns the result of the coroutine or throws its exception if it does not suspend or [COROUTINE_SUSPENDED] if it suspends. - * In the latter case, the [completion] continuation is invoked when coroutine completes with result or exception. - * This function is designed to be used from inside of [suspendCoroutineOrReturn] to resume the execution of a suspended - * coroutine using a reference to the suspending function. - */ -@SinceKotlin("1.1") -public expect inline fun (suspend () -> T).startCoroutineUninterceptedOrReturn( - completion: Continuation -): Any? - -/** - * Starts unintercepted coroutine with receiver type [R] and result type [T] and executes it until its first suspension. - * Returns the result of the coroutine or throws its exception if it does not suspend or [COROUTINE_SUSPENDED] if it suspends. - * In the latter case, the [completion] continuation is invoked when coroutine completes with result or exception. - * This function is designed to be used from inside of [suspendCoroutineOrReturn] to resume the execution of a suspended - * coroutine using a reference to the suspending function. - */ -@SinceKotlin("1.1") -public expect inline fun (suspend R.() -> T).startCoroutineUninterceptedOrReturn( - receiver: R, - completion: Continuation -): Any? - -@SinceKotlin("1.1") -public expect fun (suspend () -> T).createCoroutineUnchecked( - completion: Continuation -): Continuation - -@SinceKotlin("1.1") -public expect fun (suspend R.() -> T).createCoroutineUnchecked( - receiver: R, - completion: Continuation -): Continuation diff --git a/libraries/stdlib/coroutines-experimental/src/kotlin/coroutines/experimental/CoroutinesLibrary.kt b/libraries/stdlib/coroutines-experimental/src/kotlin/coroutines/experimental/CoroutinesLibrary.kt deleted file mode 100644 index 6a98802904b..00000000000 --- a/libraries/stdlib/coroutines-experimental/src/kotlin/coroutines/experimental/CoroutinesLibrary.kt +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -@file:kotlin.jvm.JvmName("CoroutinesKt") -@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") - -package kotlin.coroutines.experimental - -import kotlin.coroutines.experimental.intrinsics.COROUTINE_SUSPENDED -import kotlin.coroutines.experimental.intrinsics.createCoroutineUnchecked -import kotlin.coroutines.experimental.intrinsics.suspendCoroutineOrReturn -import kotlin.internal.InlineOnly - -/** - * Starts coroutine with receiver type [R] and result type [T]. - * This function creates and start a new, fresh instance of suspendable computation every time it is invoked. - * The [completion] continuation is invoked when coroutine completes with result or exception. - */ -@SinceKotlin("1.1") -@Suppress("UNCHECKED_CAST") -public fun (suspend R.() -> T).startCoroutine( - receiver: R, - completion: Continuation -) { - createCoroutineUnchecked(receiver, completion).resume(Unit) -} - -/** - * Starts coroutine without receiver and with result type [T]. - * This function creates and start a new, fresh instance of suspendable computation every time it is invoked. - * The [completion] continuation is invoked when coroutine completes with result or exception. - */ -@SinceKotlin("1.1") -@Suppress("UNCHECKED_CAST") -public fun (suspend () -> T).startCoroutine( - completion: Continuation -) { - createCoroutineUnchecked(completion).resume(Unit) -} - -/** - * Creates a coroutine with receiver type [R] and result type [T]. - * This function creates a new, fresh instance of suspendable computation every time it is invoked. - * - * To start executing the created coroutine, invoke `resume(Unit)` on the returned [Continuation] instance. - * The [completion] continuation is invoked when coroutine completes with result or exception. - * Repeated invocation of any resume function on the resulting continuation produces [IllegalStateException]. - */ -@SinceKotlin("1.1") -@Suppress("UNCHECKED_CAST") -public fun (suspend R.() -> T).createCoroutine( - receiver: R, - completion: Continuation -): Continuation = SafeContinuation(createCoroutineUnchecked(receiver, completion), COROUTINE_SUSPENDED) - -/** - * Creates a coroutine without receiver and with result type [T]. - * This function creates a new, fresh instance of suspendable computation every time it is invoked. - * - * To start executing the created coroutine, invoke `resume(Unit)` on the returned [Continuation] instance. - * The [completion] continuation is invoked when coroutine completes with result or exception. - * Repeated invocation of any resume function on the resulting continuation produces [IllegalStateException]. - */ -@SinceKotlin("1.1") -@Suppress("UNCHECKED_CAST") -public fun (suspend () -> T).createCoroutine( - completion: Continuation -): Continuation = SafeContinuation(createCoroutineUnchecked(completion), COROUTINE_SUSPENDED) - -/** - * Obtains the current continuation instance inside suspend functions and suspends - * currently running coroutine. - * - * In this function both [Continuation.resume] and [Continuation.resumeWithException] can be used either synchronously in - * the same stack-frame where suspension function is run or asynchronously later in the same thread or - * from a different thread of execution. Repeated invocation of any resume function produces [IllegalStateException]. - */ -@SinceKotlin("1.1") -public suspend inline fun suspendCoroutine(crossinline block: (Continuation) -> Unit): T = - suspendCoroutineOrReturn { c: Continuation -> - val safe = SafeContinuation(c) - block(safe) - safe.getResult() - } - -/** - * Continuation context of current coroutine. - * - * This allows the user code to not pass an extra [CoroutineContext] parameter in basic coroutine builders - * like [launch](https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/launch.html) - * and [async](https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental/async.html), - * but still provide easy access to coroutine context. - */ -@SinceKotlin("1.2") -@Suppress("WRONG_MODIFIER_TARGET") -@InlineOnly -public suspend inline val coroutineContext: CoroutineContext - get() { - throw NotImplementedError("Implemented as intrinsic") - } - -// INTERNAL DECLARATIONS - -@kotlin.internal.InlineOnly -internal inline fun processBareContinuationResume(completion: Continuation<*>, block: () -> Any?) { - try { - val result = block() - if (result !== COROUTINE_SUSPENDED) { - @Suppress("UNCHECKED_CAST") - (completion as Continuation).resume(result) - } - } catch (t: Throwable) { - completion.resumeWithException(t) - } -} diff --git a/libraries/stdlib/coroutines-experimental/src/kotlin/coroutines/experimental/SequenceBuilder.kt b/libraries/stdlib/coroutines-experimental/src/kotlin/coroutines/experimental/SequenceBuilder.kt deleted file mode 100644 index 495e6137aec..00000000000 --- a/libraries/stdlib/coroutines-experimental/src/kotlin/coroutines/experimental/SequenceBuilder.kt +++ /dev/null @@ -1,177 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -@file:kotlin.jvm.JvmMultifileClass -@file:kotlin.jvm.JvmName("SequenceBuilderKt") -@file:OptIn(ExperimentalTypeInference::class) - -package kotlin.coroutines.experimental - -import kotlin.coroutines.experimental.intrinsics.* -import kotlin.experimental.ExperimentalTypeInference - -/** - * Builds a [Sequence] lazily yielding values one by one. - * - * Since Kotlin 1.3 use [kotlin.sequences.sequence] instead. - * - * @see kotlin.sequences.generateSequence - * @see kotlin.sequences.sequence - */ -@SinceKotlin("1.1") -public fun buildSequence(@BuilderInference builderAction: suspend SequenceBuilder.() -> Unit): Sequence = Sequence { buildIterator(builderAction) } - -/** - * Builds an [Iterator] lazily yielding values one by one. - * - * Since Kotlin 1.3 use [kotlin.sequences.iterator] instead. - * - * @see kotlin.sequences.iterator - */ -@SinceKotlin("1.1") -public fun buildIterator(@BuilderInference builderAction: suspend SequenceBuilder.() -> Unit): Iterator { - val iterator = SequenceBuilderIterator() - iterator.nextStep = builderAction.createCoroutineUnchecked(receiver = iterator, completion = iterator) - return iterator -} - -/** - * Builder for a [Sequence] or an [Iterator], provides [yield] and [yieldAll] suspension functions. - * - * Since Kotlin 1.3 use [kotlin.sequences.SequenceScope] instead. - * - * @see buildSequence - * @see buildIterator - * @see kotlin.sequences.SequenceScope - */ -@RestrictsSuspension -@SinceKotlin("1.1") -public abstract class SequenceBuilder internal constructor() { - /** - * Yields a value to the [Iterator] being built. - */ - public abstract suspend fun yield(value: T) - - /** - * Yields all values from the `iterator` to the [Iterator] being built. - * - * The sequence of values returned by the given iterator can be potentially infinite. - */ - public abstract suspend fun yieldAll(iterator: Iterator) - - /** - * Yields a collections of values to the [Iterator] being built. - */ - public suspend fun yieldAll(elements: Iterable) { - if (elements is Collection && elements.isEmpty()) return - return yieldAll(elements.iterator()) - } - - /** - * Yields potentially infinite sequence of values to the [Iterator] being built. - * - * The sequence can be potentially infinite. - */ - public suspend fun yieldAll(sequence: Sequence) = yieldAll(sequence.iterator()) -} - -private typealias State = Int - -private const val State_NotReady: State = 0 -private const val State_ManyNotReady: State = 1 -private const val State_ManyReady: State = 2 -private const val State_Ready: State = 3 -private const val State_Done: State = 4 -private const val State_Failed: State = 5 - -private class SequenceBuilderIterator : SequenceBuilder(), Iterator, Continuation { - private var state = State_NotReady - private var nextValue: T? = null - private var nextIterator: Iterator? = null - var nextStep: Continuation? = null - - override fun hasNext(): Boolean { - while (true) { - when (state) { - State_NotReady -> {} - State_ManyNotReady -> - if (nextIterator!!.hasNext()) { - state = State_ManyReady - return true - } else { - nextIterator = null - } - State_Done -> return false - State_Ready, State_ManyReady -> return true - else -> throw exceptionalState() - } - - state = State_Failed - val step = nextStep!! - nextStep = null - step.resume(Unit) - } - } - - override fun next(): T { - when (state) { - State_NotReady, State_ManyNotReady -> return nextNotReady() - State_ManyReady -> { - state = State_ManyNotReady - return nextIterator!!.next() - } - State_Ready -> { - state = State_NotReady - @Suppress("UNCHECKED_CAST") - val result = nextValue as T - nextValue = null - return result - } - else -> throw exceptionalState() - } - } - - private fun nextNotReady(): T { - if (!hasNext()) throw NoSuchElementException() else return next() - } - - private fun exceptionalState(): Throwable = when (state) { - State_Done -> NoSuchElementException() - State_Failed -> IllegalStateException("Iterator has failed.") - else -> IllegalStateException("Unexpected state of the iterator: $state") - } - - - suspend override fun yield(value: T) { - nextValue = value - state = State_Ready - return suspendCoroutineOrReturn { c -> - nextStep = c - COROUTINE_SUSPENDED - } - } - - suspend override fun yieldAll(iterator: Iterator) { - if (!iterator.hasNext()) return - nextIterator = iterator - state = State_ManyReady - return suspendCoroutineOrReturn { c -> - nextStep = c - COROUTINE_SUSPENDED - } - } - - // Completion continuation implementation - override fun resume(value: Unit) { - state = State_Done - } - - override fun resumeWithException(exception: Throwable) { - throw exception // just rethrow - } - - override val context: CoroutineContext - get() = EmptyCoroutineContext -} diff --git a/libraries/stdlib/coroutines-experimental/src/kotlin/coroutines/experimental/intrinsics/Intrinsics.kt b/libraries/stdlib/coroutines-experimental/src/kotlin/coroutines/experimental/intrinsics/Intrinsics.kt deleted file mode 100644 index 0e32b31549d..00000000000 --- a/libraries/stdlib/coroutines-experimental/src/kotlin/coroutines/experimental/intrinsics/Intrinsics.kt +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -@file:kotlin.jvm.JvmName("IntrinsicsKt") -@file:kotlin.jvm.JvmMultifileClass -@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") -package kotlin.coroutines.experimental.intrinsics - -import kotlin.coroutines.experimental.* - -/** - * Obtains the current continuation instance inside suspend functions and either suspends - * currently running coroutine or returns result immediately without suspension. - * - * If the [block] returns the special [COROUTINE_SUSPENDED] value, it means that suspend function did suspend the execution and will - * not return any result immediately. In this case, the [Continuation] provided to the [block] shall be invoked at some moment in the - * future when the result becomes available to resume the computation. - * - * Otherwise, the return value of the [block] must have a type assignable to [T] and represents the result of this suspend function. - * It means that the execution was not suspended and the [Continuation] provided to the [block] shall not be invoked. - * As the result type of the [block] is declared as `Any?` and cannot be correctly type-checked, - * its proper return type remains on the conscience of the suspend function's author. - * - * Note that it is not recommended to call either [Continuation.resume] nor [Continuation.resumeWithException] functions synchronously - * in the same stackframe where suspension function is run. Use [suspendCoroutine] as a safer way to obtain current - * continuation instance. - */ -@SinceKotlin("1.1") -@kotlin.internal.InlineOnly -@Suppress("UNUSED_PARAMETER") -public suspend inline fun suspendCoroutineOrReturn(crossinline block: (Continuation) -> Any?): T = - suspendCoroutineUninterceptedOrReturn { cont -> block(cont.intercepted()) } - -/** - * Obtains the current continuation instance inside suspend functions and either suspends - * currently running coroutine or returns result immediately without suspension. - * - * Unlike [suspendCoroutineOrReturn] it does not intercept continuation. - */ -@SinceKotlin("1.2") -@kotlin.internal.InlineOnly -@Suppress("UNUSED_PARAMETER", "RedundantSuspendModifier") -public suspend inline fun suspendCoroutineUninterceptedOrReturn(crossinline block: (Continuation) -> Any?): T = - throw NotImplementedError("Implementation of suspendCoroutineUninterceptedOrReturn is intrinsic") - -/** - * Intercept continuation with [ContinuationInterceptor]. - */ -@SinceKotlin("1.2") -@kotlin.internal.InlineOnly -public inline fun Continuation.intercepted(): Continuation = - throw NotImplementedError("Implementation of intercepted is intrinsic") - -/** - * This value is used as a return value of [suspendCoroutineOrReturn] `block` argument to state that - * the execution was suspended and will not return any result immediately. - */ -@SinceKotlin("1.1") -public expect val COROUTINE_SUSPENDED: Any // get() = CoroutineSuspendedMarker diff --git a/libraries/stdlib/jdk7/build.gradle b/libraries/stdlib/jdk7/build.gradle index 361e0fda382..9828cfd9148 100644 --- a/libraries/stdlib/jdk7/build.gradle +++ b/libraries/stdlib/jdk7/build.gradle @@ -44,7 +44,6 @@ configurations { dependencies { compile project(':kotlin-stdlib') testCompile project(':kotlin-test:kotlin-test-junit') - testCompile project(':kotlin-coroutines-experimental-compat') } jar { diff --git a/libraries/stdlib/jdk8/build.gradle b/libraries/stdlib/jdk8/build.gradle index a5e45269b44..0d8f659fe60 100644 --- a/libraries/stdlib/jdk8/build.gradle +++ b/libraries/stdlib/jdk8/build.gradle @@ -14,7 +14,6 @@ dependencies { compile project(':kotlin-stdlib') compile project(':kotlin-stdlib-jdk7') testCompile project(':kotlin-test:kotlin-test-junit') - testCompile project(':kotlin-coroutines-experimental-compat') } sourceSets { diff --git a/libraries/stdlib/jvm/build.gradle b/libraries/stdlib/jvm/build.gradle index af14f044562..ac563951128 100644 --- a/libraries/stdlib/jvm/build.gradle +++ b/libraries/stdlib/jvm/build.gradle @@ -57,7 +57,6 @@ dependencies { compile group: 'org.jetbrains', name: 'annotations', version:'13.0' testCompile project(':kotlin-test:kotlin-test-junit') - testCompile project(':kotlin-coroutines-experimental-compat') builtins project(':core:builtins') } diff --git a/libraries/stdlib/jvm/test/coroutines/CoroutinesMigrationTest.kt b/libraries/stdlib/jvm/test/coroutines/CoroutinesMigrationTest.kt deleted file mode 100644 index 36408b32aea..00000000000 --- a/libraries/stdlib/jvm/test/coroutines/CoroutinesMigrationTest.kt +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. - * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. - */ - -@file:Suppress("ObsoleteExperimentalCoroutines") - -package test.coroutines.experimental.migration - -import kotlin.coroutines.experimental.buildSequence as experimentalBuildSequence -import kotlin.coroutines.experimental.SequenceBuilder as ExperimentalSequenceBuilder -import kotlin.coroutines.experimental.Continuation as ExperimentalContinuation -import kotlin.coroutines.experimental.CoroutineContext as ExperimentalCoroutineContext -import kotlin.coroutines.experimental.AbstractCoroutineContextElement as ExperimentalAbstractCoroutineContextElement -import kotlin.coroutines.experimental.EmptyCoroutineContext as ExperimentalEmptyCoroutineContext -import kotlin.coroutines.experimental.ContinuationInterceptor as ExperimentalContinuationInterceptor -import kotlin.coroutines.experimental.intrinsics.COROUTINE_SUSPENDED as EXPERIMENTAL_COROUTINE_SUSPENDED -import kotlin.coroutines.experimental.migration.* -import kotlin.coroutines.* -import kotlin.test.* - -/** - * Tests on coroutines migrations utilities. - */ -class CoroutinesMigrationTest { - @Test - fun testContextMigration() { - assertTrue(EmptyCoroutineContext === ExperimentalEmptyCoroutineContext.toCoroutineContext()) - assertTrue(ExperimentalEmptyCoroutineContext === EmptyCoroutineContext.toExperimentalCoroutineContext()) - MyElement().let { e -> - assertTrue(e === e.toExperimentalCoroutineContext().toCoroutineContext()) - val ee = MyExperimentalElement() - val ctx = (e.toExperimentalCoroutineContext() + ee).toCoroutineContext() - assertTrue(e === ctx[MyElement.Key]) - assertTrue(ee === ctx.toExperimentalCoroutineContext()[MyExperimentalElement.Key]) - } - MyExperimentalElement().let { ee -> - assertTrue(ee === ee.toCoroutineContext().toExperimentalCoroutineContext()) - val e = MyElement() - val ctx = (ee.toCoroutineContext() + e).toExperimentalCoroutineContext() - assertTrue(ee === ctx[MyExperimentalElement.Key]) - assertTrue(e === ctx.toCoroutineContext()[MyElement.Key]) - } - } - - class MyElement : AbstractCoroutineContextElement(Key) { - companion object Key : CoroutineContext.Key - } - - class MyExperimentalElement : ExperimentalAbstractCoroutineContextElement(Key) { - companion object Key : ExperimentalCoroutineContext.Key - } -} - diff --git a/libraries/tools/binary-compatibility-validator/build.gradle b/libraries/tools/binary-compatibility-validator/build.gradle index 50d1fc8a2c3..63f44f4b56b 100644 --- a/libraries/tools/binary-compatibility-validator/build.gradle +++ b/libraries/tools/binary-compatibility-validator/build.gradle @@ -14,7 +14,6 @@ dependencies { testArtifacts project(':kotlin-stdlib-jdk7') testArtifacts project(':kotlin-stdlib-jdk8') testArtifacts project(':kotlin-reflect') - testArtifacts project(':kotlin-coroutines-experimental-compat') } pill { diff --git a/libraries/tools/binary-compatibility-validator/src/test/kotlin/org.jetbrains.kotlin.tools.tests/RuntimePublicAPITest.kt b/libraries/tools/binary-compatibility-validator/src/test/kotlin/org.jetbrains.kotlin.tools.tests/RuntimePublicAPITest.kt index 3b868370b32..16a433cf292 100644 --- a/libraries/tools/binary-compatibility-validator/src/test/kotlin/org.jetbrains.kotlin.tools.tests/RuntimePublicAPITest.kt +++ b/libraries/tools/binary-compatibility-validator/src/test/kotlin/org.jetbrains.kotlin.tools.tests/RuntimePublicAPITest.kt @@ -33,11 +33,6 @@ class RuntimePublicAPITest { snapshotAPIAndCompare("../../reflect/api/build/libs", "kotlin-reflect-api(?!-[-a-z]+)", nonPublicPackages = listOf("kotlin.reflect.jvm.internal")) } - @Test fun kotlinCoroutinesExperimentalCompat() { - snapshotAPIAndCompare("../../stdlib/coroutines-experimental/build/libs", "kotlin-coroutines-experimental-compat") - } - - private fun snapshotAPIAndCompare( basePath: String, jarPattern: String, diff --git a/prepare/compiler/build.gradle.kts b/prepare/compiler/build.gradle.kts index 2efc93714ba..d7d5ffab1ba 100644 --- a/prepare/compiler/build.gradle.kts +++ b/prepare/compiler/build.gradle.kts @@ -83,7 +83,6 @@ val distLibraryProjects = listOfNotNull( ":kotlin-annotations-android", ":kotlin-annotations-jvm", ":kotlin-ant", - ":kotlin-coroutines-experimental-compat", ":kotlin-daemon", ":kotlin-daemon-client", // TODO: uncomment when new daemon will be put back into dist @@ -121,7 +120,6 @@ val distCompilerPluginProjects = listOf( val distSourcesProjects = listOfNotNull( ":kotlin-annotations-jvm", - ":kotlin-coroutines-experimental-compat", ":kotlin-script-runtime", ":kotlin-test:kotlin-test-js".takeIf { !kotlinBuildProperties.isInJpsBuildIdeaSync }, ":kotlin-test:kotlin-test-junit", @@ -394,4 +392,4 @@ inline fun Project.distTask( rename(quote("-$version"), "") rename(quote("-$bootstrapKotlinVersion"), "") block() -} \ No newline at end of file +} diff --git a/prepare/idea-plugin/build.gradle.kts b/prepare/idea-plugin/build.gradle.kts index 5e5698f7526..2c71957e235 100644 --- a/prepare/idea-plugin/build.gradle.kts +++ b/prepare/idea-plugin/build.gradle.kts @@ -124,7 +124,6 @@ val projectsToShadow by extra(listOf( // Projects published to maven copied to the plugin as separate jars val libraryProjects = listOf( ":kotlin-reflect", - ":kotlin-coroutines-experimental-compat", ":kotlin-compiler-client-embeddable", ":kotlin-daemon-client", ":kotlin-daemon-client-new", diff --git a/settings.gradle b/settings.gradle index 65f5704ac74..3dfe1de7956 100644 --- a/settings.gradle +++ b/settings.gradle @@ -208,7 +208,6 @@ include ":benchmarks", ":plugins:uast-kotlin-idea", ":plugins:annotation-based-compiler-plugins-ide-support", ":kotlin-script-runtime", - ":kotlin-coroutines-experimental-compat", ":plugins:fir:fir-plugin-prototype", ":plugins:fir:fir-plugin-prototype:plugin-annotations", ":kotlin-test", @@ -442,7 +441,6 @@ if (buildProperties.inJpsBuildIdeaSync) { rootProject.name = "kotlin" project(':kotlin-script-runtime').projectDir = "$rootDir/libraries/tools/script-runtime" as File -project(":kotlin-coroutines-experimental-compat").projectDir = "$rootDir/libraries/stdlib/coroutines-experimental" as File project(':kotlin-test').projectDir = "$rootDir/libraries/kotlin.test" as File project(':kotlin-test:kotlin-test-common').projectDir = "$rootDir/libraries/kotlin.test/common" as File project(':kotlin-test:kotlin-test-annotations-common').projectDir = "$rootDir/libraries/kotlin.test/annotations-common" as File From 17230397e65b2c39f6e59d412a1581d523001f5b Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Wed, 27 Jan 2021 10:17:30 +0300 Subject: [PATCH 136/212] [Test] Update or drop some IDE tests about experimental coroutines --- .../testData/basic/common/CoroutineContext.kt | 8 --- .../test/JSBasicCompletionTestGenerated.java | 5 -- .../test/JvmBasicCompletionTestGenerated.java | 5 -- ...hLevelJvmBasicCompletionTestGenerated.java | 5 -- .../modifiers/suspend/createCoroutine.kt | 6 +-- .../suspend/createCoroutine.kt.after | 6 +-- .../modifiers/suspend/startCoroutine.kt | 6 +-- .../modifiers/suspend/startCoroutine.kt.after | 6 +-- .../quickfix/obsoleteCoroutines/.inspection | 1 - .../obsoleteCoroutines/buildIteratorImport.kt | 9 ---- .../buildIteratorImport.kt.after | 8 --- .../obsoleteCoroutines/buildSequence.kt | 10 ---- .../obsoleteCoroutines/buildSequence.kt.after | 10 ---- .../obsoleteCoroutines/buildSequenceImport.kt | 8 --- .../buildSequenceImport.kt.after | 7 --- .../obsoleteCoroutines/inProjectFix.kt | 16 ------ .../obsoleteCoroutines/inProjectFix.kt.after | 13 ----- .../quickfix/obsoleteCoroutines/resume.kt | 9 ---- .../obsoleteCoroutines/resume.kt.after | 10 ---- .../obsoleteCoroutines/resumeWithException.kt | 9 ---- .../resumeWithException.kt.after | 10 ---- .../quickfix/obsoleteCoroutines/starImport.kt | 3 -- .../obsoleteCoroutines/starImport.kt.after | 3 -- .../unresolvedKotlinxImport.kt | 4 -- .../unresolvedKotlinxImport.kt.after | 4 -- .../QuickFixMultiFileTestGenerated.java | 13 ----- .../idea/quickfix/QuickFixTestGenerated.java | 53 ------------------- 27 files changed, 12 insertions(+), 235 deletions(-) delete mode 100644 idea/idea-completion/testData/basic/common/CoroutineContext.kt delete mode 100644 idea/testData/quickfix/obsoleteCoroutines/.inspection delete mode 100644 idea/testData/quickfix/obsoleteCoroutines/buildIteratorImport.kt delete mode 100644 idea/testData/quickfix/obsoleteCoroutines/buildIteratorImport.kt.after delete mode 100644 idea/testData/quickfix/obsoleteCoroutines/buildSequence.kt delete mode 100644 idea/testData/quickfix/obsoleteCoroutines/buildSequence.kt.after delete mode 100644 idea/testData/quickfix/obsoleteCoroutines/buildSequenceImport.kt delete mode 100644 idea/testData/quickfix/obsoleteCoroutines/buildSequenceImport.kt.after delete mode 100644 idea/testData/quickfix/obsoleteCoroutines/inProjectFix.kt delete mode 100644 idea/testData/quickfix/obsoleteCoroutines/inProjectFix.kt.after delete mode 100644 idea/testData/quickfix/obsoleteCoroutines/resume.kt delete mode 100644 idea/testData/quickfix/obsoleteCoroutines/resume.kt.after delete mode 100644 idea/testData/quickfix/obsoleteCoroutines/resumeWithException.kt delete mode 100644 idea/testData/quickfix/obsoleteCoroutines/resumeWithException.kt.after delete mode 100644 idea/testData/quickfix/obsoleteCoroutines/starImport.kt delete mode 100644 idea/testData/quickfix/obsoleteCoroutines/starImport.kt.after delete mode 100644 idea/testData/quickfix/obsoleteCoroutines/unresolvedKotlinxImport.kt delete mode 100644 idea/testData/quickfix/obsoleteCoroutines/unresolvedKotlinxImport.kt.after diff --git a/idea/idea-completion/testData/basic/common/CoroutineContext.kt b/idea/idea-completion/testData/basic/common/CoroutineContext.kt deleted file mode 100644 index 22ae15e79fc..00000000000 --- a/idea/idea-completion/testData/basic/common/CoroutineContext.kt +++ /dev/null @@ -1,8 +0,0 @@ -suspend fun foo() { - corou -} - -// LANGUAGE_VERSION: 1.2 -// EXIST_JAVA_ONLY: {"lookupString":"coroutineContext","tailText":" (kotlin.coroutines.experimental)","typeText":"CoroutineContext","attributes":"","allLookupStrings":"coroutineContext, getCoroutineContext","itemText":"coroutineContext"} -// ABSENT: {"lookupString":"coroutineContext","tailText":" (kotlin.coroutines)","typeText":"CoroutineContext","attributes":"","allLookupStrings":"coroutineContext, getCoroutineContext","itemText":"coroutineContext"} -// ABSENT: {"lookupString":"coroutineContext","tailText":" (kotlin.coroutines.experimental.intrinsics)","typeText":"CoroutineContext","attributes":"","allLookupStrings":"coroutineContext, getCoroutineContext","itemText":"coroutineContext"} diff --git a/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/JSBasicCompletionTestGenerated.java b/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/JSBasicCompletionTestGenerated.java index 251aa029197..c207cdfd050 100644 --- a/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/JSBasicCompletionTestGenerated.java +++ b/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/JSBasicCompletionTestGenerated.java @@ -91,11 +91,6 @@ public class JSBasicCompletionTestGenerated extends AbstractJSBasicCompletionTes runTest("idea/idea-completion/testData/basic/common/ConsiderExtensionType.kt"); } - @TestMetadata("CoroutineContext.kt") - public void testCoroutineContext() throws Exception { - runTest("idea/idea-completion/testData/basic/common/CoroutineContext.kt"); - } - @TestMetadata("CoroutineContextReleaseCoroutines.kt") public void testCoroutineContextReleaseCoroutines() throws Exception { runTest("idea/idea-completion/testData/basic/common/CoroutineContextReleaseCoroutines.kt"); diff --git a/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/JvmBasicCompletionTestGenerated.java b/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/JvmBasicCompletionTestGenerated.java index c0bba3230c9..02139c86e48 100644 --- a/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/JvmBasicCompletionTestGenerated.java +++ b/idea/idea-completion/tests/org/jetbrains/kotlin/idea/completion/test/JvmBasicCompletionTestGenerated.java @@ -91,11 +91,6 @@ public class JvmBasicCompletionTestGenerated extends AbstractJvmBasicCompletionT runTest("idea/idea-completion/testData/basic/common/ConsiderExtensionType.kt"); } - @TestMetadata("CoroutineContext.kt") - public void testCoroutineContext() throws Exception { - runTest("idea/idea-completion/testData/basic/common/CoroutineContext.kt"); - } - @TestMetadata("CoroutineContextReleaseCoroutines.kt") public void testCoroutineContextReleaseCoroutines() throws Exception { runTest("idea/idea-completion/testData/basic/common/CoroutineContextReleaseCoroutines.kt"); diff --git a/idea/idea-fir/tests/org/jetbrains/kotlin/idea/completion/HighLevelJvmBasicCompletionTestGenerated.java b/idea/idea-fir/tests/org/jetbrains/kotlin/idea/completion/HighLevelJvmBasicCompletionTestGenerated.java index c1891fbeb7f..b19cfc5d471 100644 --- a/idea/idea-fir/tests/org/jetbrains/kotlin/idea/completion/HighLevelJvmBasicCompletionTestGenerated.java +++ b/idea/idea-fir/tests/org/jetbrains/kotlin/idea/completion/HighLevelJvmBasicCompletionTestGenerated.java @@ -91,11 +91,6 @@ public class HighLevelJvmBasicCompletionTestGenerated extends AbstractHighLevelJ runTest("idea/idea-completion/testData/basic/common/ConsiderExtensionType.kt"); } - @TestMetadata("CoroutineContext.kt") - public void testCoroutineContext() throws Exception { - runTest("idea/idea-completion/testData/basic/common/CoroutineContext.kt"); - } - @TestMetadata("CoroutineContextReleaseCoroutines.kt") public void testCoroutineContextReleaseCoroutines() throws Exception { runTest("idea/idea-completion/testData/basic/common/CoroutineContextReleaseCoroutines.kt"); diff --git a/idea/testData/quickfix/modifiers/suspend/createCoroutine.kt b/idea/testData/quickfix/modifiers/suspend/createCoroutine.kt index 89d498d6b4a..3811c4d1044 100644 --- a/idea/testData/quickfix/modifiers/suspend/createCoroutine.kt +++ b/idea/testData/quickfix/modifiers/suspend/createCoroutine.kt @@ -1,10 +1,10 @@ // "Make block type suspend" "true" // WITH_RUNTIME -import kotlin.coroutines.experimental.suspendCoroutine -import kotlin.coroutines.experimental.createCoroutine +import kotlin.coroutines.suspendCoroutine +import kotlin.coroutines.createCoroutine suspend fun suspending(): T { val block: () -> T = { null!! } return suspendCoroutine { block.createCoroutine(it) } -} \ No newline at end of file +} diff --git a/idea/testData/quickfix/modifiers/suspend/createCoroutine.kt.after b/idea/testData/quickfix/modifiers/suspend/createCoroutine.kt.after index f9831d9518e..1f7d33114c7 100644 --- a/idea/testData/quickfix/modifiers/suspend/createCoroutine.kt.after +++ b/idea/testData/quickfix/modifiers/suspend/createCoroutine.kt.after @@ -1,10 +1,10 @@ // "Make block type suspend" "true" // WITH_RUNTIME -import kotlin.coroutines.experimental.suspendCoroutine -import kotlin.coroutines.experimental.createCoroutine +import kotlin.coroutines.suspendCoroutine +import kotlin.coroutines.createCoroutine suspend fun suspending(): T { val block: suspend () -> T = { null!! } return suspendCoroutine { block.createCoroutine(it) } -} \ No newline at end of file +} diff --git a/idea/testData/quickfix/modifiers/suspend/startCoroutine.kt b/idea/testData/quickfix/modifiers/suspend/startCoroutine.kt index 9649cc97386..00e0187ba25 100644 --- a/idea/testData/quickfix/modifiers/suspend/startCoroutine.kt +++ b/idea/testData/quickfix/modifiers/suspend/startCoroutine.kt @@ -1,7 +1,7 @@ // "Make block type suspend" "true" // WITH_RUNTIME -import kotlin.coroutines.experimental.suspendCoroutine -import kotlin.coroutines.experimental.startCoroutine +import kotlin.coroutines.suspendCoroutine +import kotlin.coroutines.startCoroutine -suspend fun suspending(block: () -> T): T = suspendCoroutine { block.startCoroutine(it) } \ No newline at end of file +suspend fun suspending(block: () -> T): T = suspendCoroutine { block.startCoroutine(it) } diff --git a/idea/testData/quickfix/modifiers/suspend/startCoroutine.kt.after b/idea/testData/quickfix/modifiers/suspend/startCoroutine.kt.after index f4d34393b5b..2581e9f9b4d 100644 --- a/idea/testData/quickfix/modifiers/suspend/startCoroutine.kt.after +++ b/idea/testData/quickfix/modifiers/suspend/startCoroutine.kt.after @@ -1,7 +1,7 @@ // "Make block type suspend" "true" // WITH_RUNTIME -import kotlin.coroutines.experimental.suspendCoroutine -import kotlin.coroutines.experimental.startCoroutine +import kotlin.coroutines.suspendCoroutine +import kotlin.coroutines.startCoroutine -suspend fun suspending(block: suspend () -> T): T = suspendCoroutine { block.startCoroutine(it) } \ No newline at end of file +suspend fun suspending(block: suspend () -> T): T = suspendCoroutine { block.startCoroutine(it) } diff --git a/idea/testData/quickfix/obsoleteCoroutines/.inspection b/idea/testData/quickfix/obsoleteCoroutines/.inspection deleted file mode 100644 index 6c77dc329c6..00000000000 --- a/idea/testData/quickfix/obsoleteCoroutines/.inspection +++ /dev/null @@ -1 +0,0 @@ -org.jetbrains.kotlin.idea.inspections.migration.ObsoleteExperimentalCoroutinesInspection diff --git a/idea/testData/quickfix/obsoleteCoroutines/buildIteratorImport.kt b/idea/testData/quickfix/obsoleteCoroutines/buildIteratorImport.kt deleted file mode 100644 index 8a49bbd668d..00000000000 --- a/idea/testData/quickfix/obsoleteCoroutines/buildIteratorImport.kt +++ /dev/null @@ -1,9 +0,0 @@ -// "Fix experimental coroutines usage" "true" -// ERROR: Using 'buildIterator(noinline suspend SequenceScope.() -> Unit): Iterator' is an error. Use 'iterator { }' function instead. -// WITH_RUNTIME -import kotlin.coroutines.experimental.buildIterator - -fun main(args: Array) { - val lazySeq = buildIterator { - } -} \ No newline at end of file diff --git a/idea/testData/quickfix/obsoleteCoroutines/buildIteratorImport.kt.after b/idea/testData/quickfix/obsoleteCoroutines/buildIteratorImport.kt.after deleted file mode 100644 index bb4bc63b157..00000000000 --- a/idea/testData/quickfix/obsoleteCoroutines/buildIteratorImport.kt.after +++ /dev/null @@ -1,8 +0,0 @@ -// "Fix experimental coroutines usage" "true" -// ERROR: Using 'buildIterator(noinline suspend SequenceScope.() -> Unit): Iterator' is an error. Use 'iterator { }' function instead. -// WITH_RUNTIME - -fun main(args: Array) { - val lazySeq = buildIterator { - } -} \ No newline at end of file diff --git a/idea/testData/quickfix/obsoleteCoroutines/buildSequence.kt b/idea/testData/quickfix/obsoleteCoroutines/buildSequence.kt deleted file mode 100644 index cb62eadb5dc..00000000000 --- a/idea/testData/quickfix/obsoleteCoroutines/buildSequence.kt +++ /dev/null @@ -1,10 +0,0 @@ -// "Fix experimental coroutines usage" "true" -// WITH_RUNTIME -package some - -import kotlin.coroutines.experimental.buildSequence - -fun main(args: Array) { - val lazySeq = buildSequence { - } -} \ No newline at end of file diff --git a/idea/testData/quickfix/obsoleteCoroutines/buildSequence.kt.after b/idea/testData/quickfix/obsoleteCoroutines/buildSequence.kt.after deleted file mode 100644 index 899ed402b8c..00000000000 --- a/idea/testData/quickfix/obsoleteCoroutines/buildSequence.kt.after +++ /dev/null @@ -1,10 +0,0 @@ -// "Fix experimental coroutines usage" "true" -// WITH_RUNTIME -package some - -import kotlin.coroutines.experimental.buildSequence - -fun main(args: Array) { - val lazySeq = sequence { - } -} \ No newline at end of file diff --git a/idea/testData/quickfix/obsoleteCoroutines/buildSequenceImport.kt b/idea/testData/quickfix/obsoleteCoroutines/buildSequenceImport.kt deleted file mode 100644 index 6c0269e1924..00000000000 --- a/idea/testData/quickfix/obsoleteCoroutines/buildSequenceImport.kt +++ /dev/null @@ -1,8 +0,0 @@ -// "Fix experimental coroutines usage" "true" -// ERROR: Unresolved reference: buildSequence -import kotlin.coroutines.experimental.buildSequence - -fun main(args: Array) { - val lazySeq = buildSequence { - } -} \ No newline at end of file diff --git a/idea/testData/quickfix/obsoleteCoroutines/buildSequenceImport.kt.after b/idea/testData/quickfix/obsoleteCoroutines/buildSequenceImport.kt.after deleted file mode 100644 index d1b2117b0eb..00000000000 --- a/idea/testData/quickfix/obsoleteCoroutines/buildSequenceImport.kt.after +++ /dev/null @@ -1,7 +0,0 @@ -// "Fix experimental coroutines usage" "true" -// ERROR: Unresolved reference: buildSequence - -fun main(args: Array) { - val lazySeq = buildSequence { - } -} \ No newline at end of file diff --git a/idea/testData/quickfix/obsoleteCoroutines/inProjectFix.kt b/idea/testData/quickfix/obsoleteCoroutines/inProjectFix.kt deleted file mode 100644 index ed16d288749..00000000000 --- a/idea/testData/quickfix/obsoleteCoroutines/inProjectFix.kt +++ /dev/null @@ -1,16 +0,0 @@ -// "Fix experimental coroutines usages in the project" "true" -// WITH_RUNTIME -package migrate - -import kotlin.coroutines.experimental.buildIterator -import kotlin.coroutines.experimental.buildSequence - -fun main(args: Array) { - val one = buildSequence { - yield(1) - } - - val two = buildIterator { - yield(1) - } -} \ No newline at end of file diff --git a/idea/testData/quickfix/obsoleteCoroutines/inProjectFix.kt.after b/idea/testData/quickfix/obsoleteCoroutines/inProjectFix.kt.after deleted file mode 100644 index 12a0b3c2d70..00000000000 --- a/idea/testData/quickfix/obsoleteCoroutines/inProjectFix.kt.after +++ /dev/null @@ -1,13 +0,0 @@ -// "Fix experimental coroutines usages in the project" "true" -// WITH_RUNTIME -package migrate - -fun main(args: Array) { - val one = sequence { - yield(1) - } - - val two = iterator { - yield(1) - } -} \ No newline at end of file diff --git a/idea/testData/quickfix/obsoleteCoroutines/resume.kt b/idea/testData/quickfix/obsoleteCoroutines/resume.kt deleted file mode 100644 index 4ef619567ae..00000000000 --- a/idea/testData/quickfix/obsoleteCoroutines/resume.kt +++ /dev/null @@ -1,9 +0,0 @@ -// "Fix experimental coroutines usage" "true" -// SHOULD_BE_AVAILABLE_AFTER_EXECUTION -// WITH_RUNTIME - -import kotlin.coroutines.experimental.Continuation - -fun test(con: Continuation) { - con.resume(12) -} \ No newline at end of file diff --git a/idea/testData/quickfix/obsoleteCoroutines/resume.kt.after b/idea/testData/quickfix/obsoleteCoroutines/resume.kt.after deleted file mode 100644 index e411fc5e81e..00000000000 --- a/idea/testData/quickfix/obsoleteCoroutines/resume.kt.after +++ /dev/null @@ -1,10 +0,0 @@ -// "Fix experimental coroutines usage" "true" -// SHOULD_BE_AVAILABLE_AFTER_EXECUTION -// WITH_RUNTIME - -import kotlin.coroutines.experimental.Continuation -import kotlin.coroutines.resume - -fun test(con: Continuation) { - con.resume(12) -} \ No newline at end of file diff --git a/idea/testData/quickfix/obsoleteCoroutines/resumeWithException.kt b/idea/testData/quickfix/obsoleteCoroutines/resumeWithException.kt deleted file mode 100644 index a0b8595520b..00000000000 --- a/idea/testData/quickfix/obsoleteCoroutines/resumeWithException.kt +++ /dev/null @@ -1,9 +0,0 @@ -// "Fix experimental coroutines usage" "true" -// SHOULD_BE_AVAILABLE_AFTER_EXECUTION -// WITH_RUNTIME - -import kotlin.coroutines.experimental.Continuation - -fun test(con: Continuation) { - con.resumeWithException(RuntimeException("Haha")) -} \ No newline at end of file diff --git a/idea/testData/quickfix/obsoleteCoroutines/resumeWithException.kt.after b/idea/testData/quickfix/obsoleteCoroutines/resumeWithException.kt.after deleted file mode 100644 index 6bcf645c5a2..00000000000 --- a/idea/testData/quickfix/obsoleteCoroutines/resumeWithException.kt.after +++ /dev/null @@ -1,10 +0,0 @@ -// "Fix experimental coroutines usage" "true" -// SHOULD_BE_AVAILABLE_AFTER_EXECUTION -// WITH_RUNTIME - -import kotlin.coroutines.experimental.Continuation -import kotlin.coroutines.resumeWithException - -fun test(con: Continuation) { - con.resumeWithException(RuntimeException("Haha")) -} \ No newline at end of file diff --git a/idea/testData/quickfix/obsoleteCoroutines/starImport.kt b/idea/testData/quickfix/obsoleteCoroutines/starImport.kt deleted file mode 100644 index f4ff70f4d78..00000000000 --- a/idea/testData/quickfix/obsoleteCoroutines/starImport.kt +++ /dev/null @@ -1,3 +0,0 @@ -// "Fix experimental coroutines usage" "true" - -import kotlin.coroutines.experimental.* \ No newline at end of file diff --git a/idea/testData/quickfix/obsoleteCoroutines/starImport.kt.after b/idea/testData/quickfix/obsoleteCoroutines/starImport.kt.after deleted file mode 100644 index ef621f3800c..00000000000 --- a/idea/testData/quickfix/obsoleteCoroutines/starImport.kt.after +++ /dev/null @@ -1,3 +0,0 @@ -// "Fix experimental coroutines usage" "true" - -import kotlin.coroutines.* \ No newline at end of file diff --git a/idea/testData/quickfix/obsoleteCoroutines/unresolvedKotlinxImport.kt b/idea/testData/quickfix/obsoleteCoroutines/unresolvedKotlinxImport.kt deleted file mode 100644 index 74450e5e68f..00000000000 --- a/idea/testData/quickfix/obsoleteCoroutines/unresolvedKotlinxImport.kt +++ /dev/null @@ -1,4 +0,0 @@ -// "Fix experimental coroutines usage" "true" -// ERROR: Unresolved reference: kotlinx - -import kotlinx.coroutines.experimental.delay \ No newline at end of file diff --git a/idea/testData/quickfix/obsoleteCoroutines/unresolvedKotlinxImport.kt.after b/idea/testData/quickfix/obsoleteCoroutines/unresolvedKotlinxImport.kt.after deleted file mode 100644 index 3af1ea94b1d..00000000000 --- a/idea/testData/quickfix/obsoleteCoroutines/unresolvedKotlinxImport.kt.after +++ /dev/null @@ -1,4 +0,0 @@ -// "Fix experimental coroutines usage" "true" -// ERROR: Unresolved reference: kotlinx - -import kotlinx.coroutines.delay \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixMultiFileTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixMultiFileTestGenerated.java index a4d1154e619..085c463d4df 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixMultiFileTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixMultiFileTestGenerated.java @@ -3560,19 +3560,6 @@ public class QuickFixMultiFileTestGenerated extends AbstractQuickFixMultiFileTes } } - @TestMetadata("idea/testData/quickfix/obsoleteCoroutines") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ObsoleteCoroutines extends AbstractQuickFixMultiFileTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTestWithExtraFile, this, testDataFilePath); - } - - public void testAllFilesPresentInObsoleteCoroutines() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/testData/quickfix/obsoleteCoroutines"), Pattern.compile("^(\\w+)\\.((before\\.Main\\.\\w+)|(test))$"), null, true); - } - } - @TestMetadata("idea/testData/quickfix/obsoleteKotlinJsPackages") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixTestGenerated.java index a19d3bdbe5e..938eea025e3 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixTestGenerated.java @@ -9960,59 +9960,6 @@ public class QuickFixTestGenerated extends AbstractQuickFixTest { } } - @TestMetadata("idea/testData/quickfix/obsoleteCoroutines") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ObsoleteCoroutines extends AbstractQuickFixTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, this, testDataFilePath); - } - - public void testAllFilesPresentInObsoleteCoroutines() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/testData/quickfix/obsoleteCoroutines"), Pattern.compile("^([\\w\\-_]+)\\.kt$"), null, true); - } - - @TestMetadata("buildIteratorImport.kt") - public void testBuildIteratorImport() throws Exception { - runTest("idea/testData/quickfix/obsoleteCoroutines/buildIteratorImport.kt"); - } - - @TestMetadata("buildSequence.kt") - public void testBuildSequence() throws Exception { - runTest("idea/testData/quickfix/obsoleteCoroutines/buildSequence.kt"); - } - - @TestMetadata("buildSequenceImport.kt") - public void testBuildSequenceImport() throws Exception { - runTest("idea/testData/quickfix/obsoleteCoroutines/buildSequenceImport.kt"); - } - - @TestMetadata("inProjectFix.kt") - public void testInProjectFix() throws Exception { - runTest("idea/testData/quickfix/obsoleteCoroutines/inProjectFix.kt"); - } - - @TestMetadata("resume.kt") - public void testResume() throws Exception { - runTest("idea/testData/quickfix/obsoleteCoroutines/resume.kt"); - } - - @TestMetadata("resumeWithException.kt") - public void testResumeWithException() throws Exception { - runTest("idea/testData/quickfix/obsoleteCoroutines/resumeWithException.kt"); - } - - @TestMetadata("starImport.kt") - public void testStarImport() throws Exception { - runTest("idea/testData/quickfix/obsoleteCoroutines/starImport.kt"); - } - - @TestMetadata("unresolvedKotlinxImport.kt") - public void testUnresolvedKotlinxImport() throws Exception { - runTest("idea/testData/quickfix/obsoleteCoroutines/unresolvedKotlinxImport.kt"); - } - } - @TestMetadata("idea/testData/quickfix/obsoleteKotlinJsPackages") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) From 71d8b842fdea81321aba46b4c85c784427a2d85e Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Wed, 27 Jan 2021 14:11:46 +0300 Subject: [PATCH 137/212] Add runtime dependency on experimental coroutines to :kotlin-scripting-compiler-impl This is needed to keep compatibility with old gradle versions which are steel using kotlin 1.2 with experimental coroutines --- plugins/scripting/scripting-compiler-impl/build.gradle.kts | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/scripting/scripting-compiler-impl/build.gradle.kts b/plugins/scripting/scripting-compiler-impl/build.gradle.kts index 701be0ccfdd..b89ce3eb778 100644 --- a/plugins/scripting/scripting-compiler-impl/build.gradle.kts +++ b/plugins/scripting/scripting-compiler-impl/build.gradle.kts @@ -25,6 +25,7 @@ dependencies { compileOnly(intellijDep()) { includeJars("platform-api") } runtimeOnly(project(":kotlin-reflect")) + runtimeOnly( "org.jetbrains.kotlin:kotlin-coroutines-experimental-compat:1.4.20") testCompile(project(":compiler:frontend")) testCompile(project(":compiler:plugin-api")) From f740e4141c9495424264d970b3dbda1e1a0d7592 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Wed, 27 Jan 2021 14:35:22 +0300 Subject: [PATCH 138/212] Temporary force building all libraries with old backend --- libraries/commonConfiguration.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/commonConfiguration.gradle b/libraries/commonConfiguration.gradle index fad6c58bdb2..d5f4d85e34f 100644 --- a/libraries/commonConfiguration.gradle +++ b/libraries/commonConfiguration.gradle @@ -199,6 +199,7 @@ ext.configureJvmIrBackend = { Project project -> project.tasks.withType(KotlinCompile.class) { task -> task.kotlinOptions { useIR = project.kotlinBuildProperties.useIRForLibraries + freeCompilerArgs += "-Xuse-old-backend" } } } From 8b892a46c9d2f9b64631d9f4afb41baf890233b7 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Wed, 27 Jan 2021 17:46:35 +0300 Subject: [PATCH 139/212] Update testdata of maven plugin test --- .../kotlin-maven-plugin-test/src/it/test-apiVersion/pom.xml | 2 +- .../src/it/test-apiVersion/src/main/kotlin/main.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/tools/kotlin-maven-plugin-test/src/it/test-apiVersion/pom.xml b/libraries/tools/kotlin-maven-plugin-test/src/it/test-apiVersion/pom.xml index 9ea35c5ae76..7297f5964d9 100644 --- a/libraries/tools/kotlin-maven-plugin-test/src/it/test-apiVersion/pom.xml +++ b/libraries/tools/kotlin-maven-plugin-test/src/it/test-apiVersion/pom.xml @@ -22,7 +22,7 @@ - 1.2 + 1.3 diff --git a/libraries/tools/kotlin-maven-plugin-test/src/it/test-apiVersion/src/main/kotlin/main.kt b/libraries/tools/kotlin-maven-plugin-test/src/it/test-apiVersion/src/main/kotlin/main.kt index c2b3f9c5b1d..a9003dded73 100644 --- a/libraries/tools/kotlin-maven-plugin-test/src/it/test-apiVersion/src/main/kotlin/main.kt +++ b/libraries/tools/kotlin-maven-plugin-test/src/it/test-apiVersion/src/main/kotlin/main.kt @@ -3,7 +3,7 @@ class A fun foo( p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, - p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A + p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A, ) {} fun bar(x: Any) {} From 4389cc77879ae962901a19040a5fbea49dd8a356 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Wed, 27 Jan 2021 17:47:07 +0300 Subject: [PATCH 140/212] Update testdata of maven plugin tests --- .../it/test-apiVersion/src/main/kotlin/main.kt | 17 ++++------------- .../src/it/test-apiVersion/verify.bsh | 5 ++++- .../src/it/test-plugins/expected.log | 7 +++++++ 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/libraries/tools/kotlin-maven-plugin-test/src/it/test-apiVersion/src/main/kotlin/main.kt b/libraries/tools/kotlin-maven-plugin-test/src/it/test-apiVersion/src/main/kotlin/main.kt index a9003dded73..a9bcc41867a 100644 --- a/libraries/tools/kotlin-maven-plugin-test/src/it/test-apiVersion/src/main/kotlin/main.kt +++ b/libraries/tools/kotlin-maven-plugin-test/src/it/test-apiVersion/src/main/kotlin/main.kt @@ -1,14 +1,5 @@ -class A - -fun foo( - p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A, - p10: A, p11: A, p12: A, p13: A, p14: A, p15: A, p16: A, p17: A, p18: A, p19: A, - p20: A, p21: A, p22: A, p23: A, p24: A, p25: A, p26: A, p27: A, p28: A, p29: A, -) {} - -fun bar(x: Any) {} - -fun test(vararg x: Function30<*, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, *, Unit>) { - bar(::foo) - bar(x) +fun test2(s: Sequence) { + s.map { it } + s.shuffled() } + diff --git a/libraries/tools/kotlin-maven-plugin-test/src/it/test-apiVersion/verify.bsh b/libraries/tools/kotlin-maven-plugin-test/src/it/test-apiVersion/verify.bsh index 192c8ff5002..35221bfc555 100644 --- a/libraries/tools/kotlin-maven-plugin-test/src/it/test-apiVersion/verify.bsh +++ b/libraries/tools/kotlin-maven-plugin-test/src/it/test-apiVersion/verify.bsh @@ -1,4 +1,7 @@ source(new File(basedir, "../../../verify-common.bsh").getAbsolutePath()); assertBuildLogHasLine("[INFO] BUILD FAILURE"); -assertBuildLogHasLineThatContains("feature \"function types with big arity\" is only available since API version 1.3"); +assertBuildLogHasLineThatContains("Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:"); +assertBuildLogHasLineThatContains("public fun Iterable.shuffled(): List defined in kotlin.collections"); +assertBuildLogHasLineThatContains("public fun Iterable.shuffled(random: java.util.Random): List defined in kotlin.collections"); +assertBuildLogHasLineThatContains("public fun Iterable.shuffled(random: kotlin.random.Random): List defined in kotlin.collections"); diff --git a/libraries/tools/kotlin-maven-plugin-test/src/it/test-plugins/expected.log b/libraries/tools/kotlin-maven-plugin-test/src/it/test-plugins/expected.log index a3f5a309353..ccb1f4ffd51 100644 --- a/libraries/tools/kotlin-maven-plugin-test/src/it/test-plugins/expected.log +++ b/libraries/tools/kotlin-maven-plugin-test/src/it/test-plugins/expected.log @@ -1,3 +1,10 @@ +[WARNING] Runtime JAR files in the classpath should have the same version. These files were found in the classpath: +/local-repo/org/jetbrains/kotlin/kotlin-stdlib/@snapshot@/kotlin-stdlib-@snapshot@.jar (version 1.5) +/local-repo/org/jetbrains/kotlin/kotlin-stdlib-common/@snapshot@/kotlin-stdlib-common-@snapshot@.jar (version 1.5) +/local-repo/org/jetbrains/kotlin/kotlin-script-runtime/@snapshot@/kotlin-script-runtime-@snapshot@.jar (version 1.5) +/local-repo/org/jetbrains/kotlin/kotlin-reflect/@snapshot@/kotlin-reflect-@snapshot@.jar (version 1.5) +/local-repo/org/jetbrains/kotlin/kotlin-coroutines-experimental-compat/1.4.20/kotlin-coroutines-experimental-compat-1.4.20.jar (version 1.4) +[WARNING] Some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath [WARNING] No sources found skipping Kotlin compile [INFO] Applicability test for project use-test-extension [INFO] Applied plugin: 'test-me' From 72b07c727b4a28e9bb2bf091ba37a70abcf289d5 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Thu, 28 Jan 2021 09:25:08 +0300 Subject: [PATCH 141/212] fixup! Add runtime dependency on experimental coroutines to :kotlin-scripting-compiler-impl --- idea/idea-gradle/build.gradle.kts | 1 + 1 file changed, 1 insertion(+) diff --git a/idea/idea-gradle/build.gradle.kts b/idea/idea-gradle/build.gradle.kts index 0a54813ac45..2dbf4ee68aa 100644 --- a/idea/idea-gradle/build.gradle.kts +++ b/idea/idea-gradle/build.gradle.kts @@ -24,6 +24,7 @@ dependencies { compileOnly(intellijPluginDep("Groovy")) compileOnly(intellijPluginDep("junit")) compileOnly(intellijPluginDep("testng")) + runtimeOnly( "org.jetbrains.kotlin:kotlin-coroutines-experimental-compat:1.4.20") compileOnly(project(":kotlin-gradle-statistics")) From 1c80c5610ddf834fadf17f34dba12fe66124584d Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Thu, 28 Jan 2021 09:17:17 +0300 Subject: [PATCH 142/212] FIR: fix serialization of accessor with source-level annotations --- .../FirBlackBoxCodegenTestGenerated.java | 6 +++++ .../fir/serialization/FirElementSerializer.kt | 5 ++-- .../codegen/box/fir/NameHighlighter.kt | 27 +++++++++++++++++++ .../codegen/BlackBoxCodegenTestGenerated.java | 6 +++++ .../IrBlackBoxCodegenTestGenerated.java | 6 +++++ .../LightAnalysisModeTestGenerated.java | 5 ++++ 6 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 compiler/testData/codegen/box/fir/NameHighlighter.kt diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java index 7b8f5c62c04..00d9130261d 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java @@ -13724,6 +13724,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/fir/IrBuiltIns.kt"); } + @Test + @TestMetadata("NameHighlighter.kt") + public void testNameHighlighter() throws Exception { + runTest("compiler/testData/codegen/box/fir/NameHighlighter.kt"); + } + @Test @TestMetadata("SuspendExtension.kt") public void testSuspendExtension() throws Exception { diff --git a/compiler/fir/fir-serialization/src/org/jetbrains/kotlin/fir/serialization/FirElementSerializer.kt b/compiler/fir/fir-serialization/src/org/jetbrains/kotlin/fir/serialization/FirElementSerializer.kt index 2787ce4a395..a9e641b8747 100644 --- a/compiler/fir/fir-serialization/src/org/jetbrains/kotlin/fir/serialization/FirElementSerializer.kt +++ b/compiler/fir/fir-serialization/src/org/jetbrains/kotlin/fir/serialization/FirElementSerializer.kt @@ -714,11 +714,12 @@ class FirElementSerializer private constructor( private fun getAccessorFlags(accessor: FirPropertyAccessor, property: FirProperty): Int { // [FirDefaultPropertyAccessor]---a property accessor without body---can still hold other information, such as annotations, // user-contributed visibility, and modifiers, such as `external` or `inline`. + val nonSourceAnnotations = accessor.nonSourceAnnotations(session) val isDefault = accessor is FirDefaultPropertyAccessor && - accessor.annotations.isEmpty() && accessor.visibility == property.visibility && + nonSourceAnnotations.isEmpty() && accessor.visibility == property.visibility && !accessor.isExternal && !accessor.isInline return Flags.getAccessorFlags( - accessor.nonSourceAnnotations(session).isNotEmpty(), + nonSourceAnnotations.isNotEmpty(), ProtoEnumFlags.visibility(normalizeVisibility(accessor)), ProtoEnumFlags.modality(accessor.modality!!), !isDefault, diff --git a/compiler/testData/codegen/box/fir/NameHighlighter.kt b/compiler/testData/codegen/box/fir/NameHighlighter.kt new file mode 100644 index 00000000000..83a2488e240 --- /dev/null +++ b/compiler/testData/codegen/box/fir/NameHighlighter.kt @@ -0,0 +1,27 @@ +// TARGET_BACKEND: JVM +// MODULE: lib +// FILE: NameHighlighter.kt + +object NameHighlighter { + var namesHighlightingEnabled = true + @TestOnly set +} + +// FILE: TestOnly.java + +import java.lang.annotation.*; + +@Retention(RetentionPolicy.SOURCE) +@Target({ElementType.METHOD, ElementType.CONSTRUCTOR}) +public @interface TestOnly { +} + +// MODULE: main(lib) +// FILE: main.kt + +fun box(): String { + if (!NameHighlighter.namesHighlightingEnabled) return "FAIL 1" + NameHighlighter.namesHighlightingEnabled = false + if (NameHighlighter.namesHighlightingEnabled) return "FAIL 2" + return "OK" +} diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index a2e3a1b2235..18fb78c7125 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -13724,6 +13724,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/fir/IrBuiltIns.kt"); } + @Test + @TestMetadata("NameHighlighter.kt") + public void testNameHighlighter() throws Exception { + runTest("compiler/testData/codegen/box/fir/NameHighlighter.kt"); + } + @Test @TestMetadata("SuspendExtension.kt") public void testSuspendExtension() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index c3c4540ed55..636b5fd5453 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -13724,6 +13724,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/fir/IrBuiltIns.kt"); } + @Test + @TestMetadata("NameHighlighter.kt") + public void testNameHighlighter() throws Exception { + runTest("compiler/testData/codegen/box/fir/NameHighlighter.kt"); + } + @Test @TestMetadata("SuspendExtension.kt") public void testSuspendExtension() throws Exception { diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index f0760698a5d..baf97abc09c 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -12061,6 +12061,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes public void testIrBuiltIns() throws Exception { runTest("compiler/testData/codegen/box/fir/IrBuiltIns.kt"); } + + @TestMetadata("NameHighlighter.kt") + public void testNameHighlighter() throws Exception { + runTest("compiler/testData/codegen/box/fir/NameHighlighter.kt"); + } } @TestMetadata("compiler/testData/codegen/box/fullJdk") From 1b68f35f7ca1d4884cbd5a5aa069ea7bb1338242 Mon Sep 17 00:00:00 2001 From: Ilya Kirillov Date: Tue, 12 Jan 2021 17:57:30 +0100 Subject: [PATCH 143/212] FIR: create new ConeTypeCheckerContext on every supertypes calculation It can be recursively used while calculating supertypes via IDE lazy resolve, which is forbidden --- .../types/FirCorrespondingSupertypesCache.kt | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/types/FirCorrespondingSupertypesCache.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/types/FirCorrespondingSupertypesCache.kt index eb31055161d..8422957eeeb 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/types/FirCorrespondingSupertypesCache.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/types/FirCorrespondingSupertypesCache.kt @@ -20,7 +20,6 @@ import org.jetbrains.kotlin.types.model.TypeConstructorMarker @ThreadSafeMutableState class FirCorrespondingSupertypesCache(private val session: FirSession) : FirSessionComponent { - private val context = ConeTypeCheckerContext(isErrorTypeEqualsToAnything = false, isStubTypeEqualsToAnything = true, session = session) private val cache = HashMap>?>(1000, 0.5f) fun getCorrespondingSupertypes( @@ -29,27 +28,30 @@ class FirCorrespondingSupertypesCache(private val session: FirSession) : FirSess ): List? { if (type !is ConeClassLikeType || supertypeConstructor !is ConeClassLikeLookupTag) return null + val context = ConeTypeCheckerContext(isErrorTypeEqualsToAnything = false, isStubTypeEqualsToAnything = true, session = session) val lookupTag = type.lookupTag - if (lookupTag == supertypeConstructor) return listOf(captureType(type)) - + if (lookupTag == supertypeConstructor) return listOf(captureType(type, context)) if (lookupTag !in cache) { - cache[lookupTag] = computeSupertypesMap(lookupTag) + cache[lookupTag] = computeSupertypesMap(lookupTag, context) } val resultTypes = cache[lookupTag]?.getOrDefault(supertypeConstructor, emptyList()) ?: return null if (type.typeArguments.isEmpty()) return resultTypes - val capturedType = captureType(type) + val capturedType = captureType(type, context) val substitutionSupertypePolicy = context.substitutionSupertypePolicy(capturedType) return resultTypes.map { substitutionSupertypePolicy.transformType(context, it) as ConeClassLikeType } } - private fun captureType(type: ConeClassLikeType): ConeClassLikeType = + private fun captureType(type: ConeClassLikeType, context: ConeTypeCheckerContext): ConeClassLikeType = (context.captureFromArguments(type, CaptureStatus.FOR_SUBTYPING) ?: type) as ConeClassLikeType - private fun computeSupertypesMap(subtypeLookupTag: ConeClassLikeLookupTag): Map>? { + private fun computeSupertypesMap( + subtypeLookupTag: ConeClassLikeLookupTag, + context: ConeTypeCheckerContext + ): Map>? { val resultingMap = HashMap>() val subtypeFirClass: FirClassLikeDeclaration<*> = subtypeLookupTag.toSymbol(session)?.fir ?: return null @@ -64,7 +66,7 @@ class FirCorrespondingSupertypesCache(private val session: FirSession) : FirSess if (context.anySupertype( defaultType, { it !is ConeClassLikeType || it.lookupTag.toSymbol(session) !is FirClassLikeSymbol<*> } - ) { supertype -> computeSupertypePolicyAndPutInMap(supertype, resultingMap) } + ) { supertype -> computeSupertypePolicyAndPutInMap(supertype, resultingMap, context) } ) { return null } @@ -76,7 +78,8 @@ class FirCorrespondingSupertypesCache(private val session: FirSession) : FirSess private fun computeSupertypePolicyAndPutInMap( supertype: SimpleTypeMarker, - resultingMap: MutableMap> + resultingMap: MutableMap>, + context: ConeTypeCheckerContext ): AbstractTypeCheckerContext.SupertypesPolicy { val supertypeLookupTag = (supertype as ConeClassLikeType).lookupTag val captured = context.captureFromArguments(supertype, CaptureStatus.FOR_SUBTYPING) as ConeClassLikeType? ?: supertype From 977781fa498f493a17b4be2a91718d9d29f43a68 Mon Sep 17 00:00:00 2001 From: Ilya Goncharov Date: Thu, 21 Jan 2021 13:03:56 +0300 Subject: [PATCH 144/212] [JS IR] Add tests with export all file and export nested class [JS IR] Skip dce driven for nested classes export ^KT-44469 fixed --- .../semantics/IrBoxJsES6TestGenerated.java | 10 ++++++++ .../ir/semantics/IrBoxJsTestGenerated.java | 10 ++++++++ .../js/test/semantics/BoxJsTestGenerated.java | 10 ++++++++ .../testData/box/export/exportAllFile.kt | 22 ++++++++++++++++ .../testData/box/export/exportNestedClass.kt | 25 +++++++++++++++++++ 5 files changed, 77 insertions(+) create mode 100644 js/js.translator/testData/box/export/exportAllFile.kt create mode 100644 js/js.translator/testData/box/export/exportNestedClass.kt diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrBoxJsES6TestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrBoxJsES6TestGenerated.java index 766f3af1e52..a2520f7fae2 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrBoxJsES6TestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrBoxJsES6TestGenerated.java @@ -1617,6 +1617,16 @@ public class IrBoxJsES6TestGenerated extends AbstractIrBoxJsES6Test { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/export"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS_IR_ES6, true); } + @TestMetadata("exportAllFile.kt") + public void testExportAllFile() throws Exception { + runTest("js/js.translator/testData/box/export/exportAllFile.kt"); + } + + @TestMetadata("exportNestedClass.kt") + public void testExportNestedClass() throws Exception { + runTest("js/js.translator/testData/box/export/exportNestedClass.kt"); + } + @TestMetadata("nonIndetifierModuleName.kt") public void testNonIndetifierModuleName() throws Exception { runTest("js/js.translator/testData/box/export/nonIndetifierModuleName.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrBoxJsTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrBoxJsTestGenerated.java index 0f8ae44fe07..6a722ac2d4b 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrBoxJsTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrBoxJsTestGenerated.java @@ -1617,6 +1617,16 @@ public class IrBoxJsTestGenerated extends AbstractIrBoxJsTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/export"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS_IR, true); } + @TestMetadata("exportAllFile.kt") + public void testExportAllFile() throws Exception { + runTest("js/js.translator/testData/box/export/exportAllFile.kt"); + } + + @TestMetadata("exportNestedClass.kt") + public void testExportNestedClass() throws Exception { + runTest("js/js.translator/testData/box/export/exportNestedClass.kt"); + } + @TestMetadata("nonIndetifierModuleName.kt") public void testNonIndetifierModuleName() throws Exception { runTest("js/js.translator/testData/box/export/nonIndetifierModuleName.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/BoxJsTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/BoxJsTestGenerated.java index 4c672f1dcaa..4bffcc65168 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/BoxJsTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/BoxJsTestGenerated.java @@ -1622,6 +1622,16 @@ public class BoxJsTestGenerated extends AbstractBoxJsTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/export"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS, true); } + @TestMetadata("exportAllFile.kt") + public void testExportAllFile() throws Exception { + runTest("js/js.translator/testData/box/export/exportAllFile.kt"); + } + + @TestMetadata("exportNestedClass.kt") + public void testExportNestedClass() throws Exception { + runTest("js/js.translator/testData/box/export/exportNestedClass.kt"); + } + @TestMetadata("nonIndetifierModuleName.kt") public void testNonIndetifierModuleName() throws Exception { runTest("js/js.translator/testData/box/export/nonIndetifierModuleName.kt"); diff --git a/js/js.translator/testData/box/export/exportAllFile.kt b/js/js.translator/testData/box/export/exportAllFile.kt new file mode 100644 index 00000000000..bddf364de5a --- /dev/null +++ b/js/js.translator/testData/box/export/exportAllFile.kt @@ -0,0 +1,22 @@ +// IGNORE_BACKEND: JS +// RUN_PLAIN_BOX_FUNCTION +// INFER_MAIN_MODULE + +// MODULE: export-all-file +// FILE: lib.kt +@file:JsExport + +abstract class A { + abstract fun foo(k: String): String +} + +class B : A() { + override fun foo(k: String): String { + return "O" + k + } +} + +// FILE: test.js +function box() { + return new this["export-all-file"].B().foo("K"); +} \ No newline at end of file diff --git a/js/js.translator/testData/box/export/exportNestedClass.kt b/js/js.translator/testData/box/export/exportNestedClass.kt new file mode 100644 index 00000000000..ac724223f75 --- /dev/null +++ b/js/js.translator/testData/box/export/exportNestedClass.kt @@ -0,0 +1,25 @@ +// IGNORE_BACKEND: JS +// RUN_PLAIN_BOX_FUNCTION +// INFER_MAIN_MODULE +// SKIP_DCE_DRIVEN + +// MODULE: export-nested-class +// FILE: lib.kt + +abstract class A { + abstract fun foo(k: String): String +} + +@JsExport +class B { + class Foo : A() { + override fun foo(k: String): String { + return "O" + k + } + } +} + +// FILE: test.js +function box() { + return new this["export-nested-class"].B.Foo().foo("K"); +} \ No newline at end of file From 6e98b81f3ab9e719eac6ec9c2ecbc5141a752e46 Mon Sep 17 00:00:00 2001 From: Ilya Goncharov Date: Thu, 21 Jan 2021 13:58:31 +0300 Subject: [PATCH 145/212] [JS IR] Use recursive isExported for stable name detection ^KT-44469 fixed --- .../kotlin/ir/backend/js/export/ExportModelGenerator.kt | 8 ++++---- .../src/org/jetbrains/kotlin/ir/backend/js/utils/misc.kt | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/export/ExportModelGenerator.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/export/ExportModelGenerator.kt index c38d763aa0e..abbe7072fc8 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/export/ExportModelGenerator.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/export/ExportModelGenerator.kt @@ -391,11 +391,11 @@ private fun getExportCandidate(declaration: IrDeclaration): IrDeclarationWithNam return declaration } -private fun shouldDeclarationBeExported(declaration: IrDeclarationWithName, context: JsIrBackendContext): Boolean { - if (declaration.fqNameWhenAvailable in context.additionalExportedDeclarationNames) +private fun shouldDeclarationBeExported(declaration: IrDeclarationWithName, context: JsIrBackendContext?): Boolean { + if (context?.additionalExportedDeclarationNames?.contains(declaration.fqNameWhenAvailable) == true) return true - if (declaration in context.additionalExportedDeclarations) + if (context?.additionalExportedDeclarations?.contains(declaration) == true) return true if (declaration.isJsExport()) @@ -408,7 +408,7 @@ private fun shouldDeclarationBeExported(declaration: IrDeclarationWithName, cont } } -fun IrDeclaration.isExported(context: JsIrBackendContext): Boolean { +fun IrDeclaration.isExported(context: JsIrBackendContext?): Boolean { val candidate = getExportCandidate(this) ?: return false return shouldDeclarationBeExported(candidate, context) } diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/misc.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/misc.kt index 010d91cc531..59b186868fa 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/misc.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/misc.kt @@ -10,6 +10,7 @@ import org.jetbrains.kotlin.ir.IrElement import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET import org.jetbrains.kotlin.ir.backend.js.JsIrBackendContext import org.jetbrains.kotlin.ir.backend.js.JsLoweredDeclarationOrigin +import org.jetbrains.kotlin.ir.backend.js.export.isExported import org.jetbrains.kotlin.ir.declarations.* import org.jetbrains.kotlin.ir.expressions.IrExpression import org.jetbrains.kotlin.ir.expressions.impl.IrCallImpl @@ -51,7 +52,7 @@ fun IrFunction.hasStableJsName(): Boolean { else -> true } - return (isEffectivelyExternal() || getJsName() != null || isJsExport() || parentClassOrNull?.isJsExport() == true) && namedOrMissingGetter + return (isEffectivelyExternal() || getJsName() != null || isExported(null)) && namedOrMissingGetter } fun IrFunction.isEqualsInheritedFromAny() = From f1860471011731c60a58ff3dc8edcc231117a7ee Mon Sep 17 00:00:00 2001 From: Ilya Goncharov Date: Fri, 22 Jan 2021 17:20:15 +0300 Subject: [PATCH 146/212] [JS IR] Add additional exported declarations with exported stub to dce ^KT-44469 fixed --- .../backend.js/src/org/jetbrains/kotlin/ir/backend/js/Dce.kt | 2 +- .../kotlin/ir/backend/js/lower/ExportedDefaultParameterStub.kt | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/Dce.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/Dce.kt index 7b4e4906b2d..c4c5ff00461 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/Dce.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/Dce.kt @@ -413,7 +413,7 @@ fun usefulDeclarations(roots: Iterable, context: JsIrBackendConte reachabilityInfo.forEach(::println) } - return result + return result + context.additionalExportedDeclarations } private fun Collection.filterDescendantsOf(bases: Collection): Collection { diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/ExportedDefaultParameterStub.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/ExportedDefaultParameterStub.kt index 70fc7c882de..5598756c09c 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/ExportedDefaultParameterStub.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/ExportedDefaultParameterStub.kt @@ -19,6 +19,7 @@ import org.jetbrains.kotlin.ir.backend.js.ir.JsIrBuilder import org.jetbrains.kotlin.ir.backend.js.utils.JsAnnotations import org.jetbrains.kotlin.ir.backend.js.utils.hasStableJsName import org.jetbrains.kotlin.ir.builders.* +import org.jetbrains.kotlin.ir.builders.declarations.addFunction import org.jetbrains.kotlin.ir.builders.declarations.buildFun import org.jetbrains.kotlin.ir.declarations.* import org.jetbrains.kotlin.ir.expressions.IrConstructorCall @@ -104,6 +105,8 @@ class ExportedDefaultParameterStub(val context: JsIrBackendContext) : Declaratio origin = JsIrBuilder.SYNTHESIZED_DECLARATION } + context.additionalExportedDeclarations.add(exportedDefaultStubFun) + exportedDefaultStubFun.returnType = declaration.returnType.remapTypeParameters(declaration, exportedDefaultStubFun) exportedDefaultStubFun.parent = declaration.parent exportedDefaultStubFun.copyParameterDeclarationsFrom(declaration) From d88d1d048e00d04a68a04e47732970b3a18d9c71 Mon Sep 17 00:00:00 2001 From: Ilya Goncharov Date: Fri, 22 Jan 2021 18:42:34 +0300 Subject: [PATCH 147/212] [JS IR] Context to NameTables for stable names in additional exported declarations [JS IR] BridgesConstruction with generic without cast ^KT-44469 fixed --- .../backend/js/lower/BridgesConstruction.kt | 13 ++++++------ .../js/lower/ExportedDefaultParameterStub.kt | 2 +- .../backend/js/lower/JsBridgesConstruction.kt | 15 +++++++++++--- .../irToJs/IrModuleToJsTransformer.kt | 4 ++-- .../kotlin/ir/backend/js/utils/NameTables.kt | 20 +++++++++++++------ .../kotlin/ir/backend/js/utils/misc.kt | 4 ++-- .../wasm/lower/WasmBridgesConstruction.kt | 5 ++++- 7 files changed, 41 insertions(+), 22 deletions(-) diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/BridgesConstruction.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/BridgesConstruction.kt index ecf0b310afa..edad298cc64 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/BridgesConstruction.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/BridgesConstruction.kt @@ -13,6 +13,7 @@ import org.jetbrains.kotlin.backend.common.lower.* import org.jetbrains.kotlin.descriptors.Modality import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET import org.jetbrains.kotlin.ir.backend.js.JsCommonBackendContext +import org.jetbrains.kotlin.ir.backend.js.JsIrBackendContext import org.jetbrains.kotlin.ir.backend.js.JsLoweredDeclarationOrigin import org.jetbrains.kotlin.ir.backend.js.utils.hasStableJsName import org.jetbrains.kotlin.ir.backend.js.utils.realOverrideTarget @@ -43,7 +44,7 @@ import org.jetbrains.kotlin.ir.util.* // fun foo(t: Any?) = foo(t as Int) // Constructed bridge // } // -abstract class BridgesConstruction(val context: JsCommonBackendContext) : DeclarationTransformer { +abstract class BridgesConstruction(val context: T) : DeclarationTransformer { private val specialBridgeMethods = SpecialBridgeMethods(context) @@ -115,11 +116,7 @@ abstract class BridgesConstruction(val context: JsCommonBackendContext) : Declar specialMethodInfo: SpecialMethodWithDefaultInfo? ): IrFunction { - val origin = - if (bridge.hasStableJsName()) - JsLoweredDeclarationOrigin.BRIDGE_WITH_STABLE_NAME - else - JsLoweredDeclarationOrigin.BRIDGE_WITHOUT_STABLE_NAME + val origin = getBridgeOrigin(bridge) // TODO: Support offsets for debug info val irFunction = context.irFactory.buildFun { @@ -179,6 +176,8 @@ abstract class BridgesConstruction(val context: JsCommonBackendContext) : Declar return irFunction } + abstract fun getBridgeOrigin(bridge: IrSimpleFunction): IrDeclarationOrigin + // TODO: get rid of Unit check private fun IrBlockBodyBuilder.irCastIfNeeded(argument: IrExpression, type: IrType): IrExpression = if (argument.type.classifierOrNull == type.classifierOrNull) argument else irAs(argument, type) @@ -194,7 +193,7 @@ abstract class BridgesConstruction(val context: JsCommonBackendContext) : Declar override fun equals(other: Any?): Boolean { if (this === other) return true - if (other !is BridgesConstruction.FunctionAndSignature) return false + if (other !is BridgesConstruction<*>.FunctionAndSignature) return false return signature == other.signature } diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/ExportedDefaultParameterStub.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/ExportedDefaultParameterStub.kt index 5598756c09c..a991bb954ee 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/ExportedDefaultParameterStub.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/ExportedDefaultParameterStub.kt @@ -87,7 +87,7 @@ class ExportedDefaultParameterStub(val context: JsIrBackendContext) : Declaratio return null } - if (!declaration.hasStableJsName()) { + if (!declaration.hasStableJsName(context)) { return null } diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/JsBridgesConstruction.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/JsBridgesConstruction.kt index 1a59c7aeb7a..1c540748bb9 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/JsBridgesConstruction.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/JsBridgesConstruction.kt @@ -5,12 +5,21 @@ package org.jetbrains.kotlin.ir.backend.js.lower -import org.jetbrains.kotlin.ir.backend.js.JsCommonBackendContext +import org.jetbrains.kotlin.ir.backend.js.JsIrBackendContext +import org.jetbrains.kotlin.ir.backend.js.JsLoweredDeclarationOrigin import org.jetbrains.kotlin.ir.backend.js.utils.Signature +import org.jetbrains.kotlin.ir.backend.js.utils.hasStableJsName import org.jetbrains.kotlin.ir.backend.js.utils.jsFunctionSignature +import org.jetbrains.kotlin.ir.declarations.IrDeclarationOrigin import org.jetbrains.kotlin.ir.declarations.IrSimpleFunction -class JsBridgesConstruction(context: JsCommonBackendContext) : BridgesConstruction(context) { +class JsBridgesConstruction(context: JsIrBackendContext) : BridgesConstruction(context) { override fun getFunctionSignature(function: IrSimpleFunction): Signature = - jsFunctionSignature(function) + jsFunctionSignature(function, context) + + override fun getBridgeOrigin(bridge: IrSimpleFunction): IrDeclarationOrigin = + if (bridge.hasStableJsName(context)) + JsLoweredDeclarationOrigin.BRIDGE_WITH_STABLE_NAME + else + JsLoweredDeclarationOrigin.BRIDGE_WITHOUT_STABLE_NAME } diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/IrModuleToJsTransformer.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/IrModuleToJsTransformer.kt index 828f6b33f93..269a63319ff 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/IrModuleToJsTransformer.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/IrModuleToJsTransformer.kt @@ -27,7 +27,7 @@ class IrModuleToJsTransformer( private val backendContext: JsIrBackendContext, private val mainArguments: List?, private val generateScriptModule: Boolean = false, - var namer: NameTables = NameTables(emptyList()), + var namer: NameTables = NameTables(emptyList(), context = backendContext), private val fullJs: Boolean = true, private val dceJs: Boolean = false, private val multiModule: Boolean = false, @@ -64,7 +64,7 @@ class IrModuleToJsTransformer( eliminateDeadDeclarations(modules, backendContext) // Use a fresh namer for DCE so that we could compare the result with DCE-driven // TODO: is this mode relevant for scripting? If yes, refactor so that the external name tables are used here when needed. - val namer = NameTables(emptyList()) + val namer = NameTables(emptyList(), context = backendContext) namer.merge(modules.flatMap { it.files }, additionalPackages) generateWrappedModuleBody(modules, exportedModule, namer) } else null diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/NameTables.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/NameTables.kt index 3bf7300153e..f5163534a62 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/NameTables.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/NameTables.kt @@ -7,6 +7,7 @@ package org.jetbrains.kotlin.ir.backend.js.utils import org.jetbrains.kotlin.backend.common.ir.isTopLevel import org.jetbrains.kotlin.ir.IrElement +import org.jetbrains.kotlin.ir.backend.js.JsIrBackendContext import org.jetbrains.kotlin.ir.backend.js.lower.serialization.ir.JsManglerIr import org.jetbrains.kotlin.ir.declarations.* import org.jetbrains.kotlin.ir.expressions.IrBreak @@ -105,13 +106,13 @@ fun fieldSignature(field: IrField): Signature { return BackingFieldSignature(field) } -fun jsFunctionSignature(declaration: IrFunction): Signature { +fun jsFunctionSignature(declaration: IrFunction, context: JsIrBackendContext?): Signature { require(!declaration.isStaticMethodOfClass) require(declaration.dispatchReceiverParameter != null) val declarationName = declaration.getJsNameOrKotlinName().asString() - if (declaration.hasStableJsName()) { + if (declaration.hasStableJsName(context)) { return StableNameSignature(declarationName) } @@ -148,7 +149,8 @@ class NameTables( packages: List, reservedForGlobal: MutableSet = mutableSetOf(), reservedForMember: MutableSet = mutableSetOf(), - val mappedNames: MutableMap? = null + val mappedNames: MutableMap? = null, + private val context: JsIrBackendContext? = null ) { val globalNames: NameTable private val memberNames: NameTable @@ -250,7 +252,13 @@ class NameTables( val packages = mutableListOf().also { it.addAll(files) } if (packagesAdded()) packages.addAll(additionalPackages) - val table = NameTables(packages, globalNames.reserved, memberNames.reserved, mappedNames) + val table = NameTables( + packages, + globalNames.reserved, + memberNames.reserved, + mappedNames, + context + ) globalNames.names.addAllIfAbsent(table.globalNames.names) memberNames.names.addAllIfAbsent(table.memberNames.names) @@ -274,7 +282,7 @@ class NameTables( } private fun generateNameForMemberFunction(declaration: IrSimpleFunction) { - when (val signature = jsFunctionSignature(declaration)) { + when (val signature = jsFunctionSignature(declaration, context)) { is StableNameSignature -> memberNames.declareStableName(signature, signature.name) is ParameterTypeBasedSignature -> memberNames.declareFreshName(signature, signature.suggestedName) } @@ -327,7 +335,7 @@ class NameTables( } fun getNameForMemberFunction(function: IrSimpleFunction): String { - val signature = jsFunctionSignature(function) + val signature = jsFunctionSignature(function, context) val name = memberNames.names[signature] ?: mappedNames?.get(mapToKey(signature)) // TODO Add a compiler flag, which enables this behaviour diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/misc.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/misc.kt index 59b186868fa..2f597d3dddc 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/misc.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/misc.kt @@ -24,7 +24,7 @@ import org.jetbrains.kotlin.name.Name fun TODO(element: IrElement): Nothing = TODO(element::class.java.simpleName + " is not supported yet here") -fun IrFunction.hasStableJsName(): Boolean { +fun IrFunction.hasStableJsName(context: JsIrBackendContext?): Boolean { if ( origin == JsLoweredDeclarationOrigin.BRIDGE_WITH_STABLE_NAME || (this as? IrSimpleFunction)?.isMethodOfAny() == true // Handle names for special functions @@ -52,7 +52,7 @@ fun IrFunction.hasStableJsName(): Boolean { else -> true } - return (isEffectivelyExternal() || getJsName() != null || isExported(null)) && namedOrMissingGetter + return (isEffectivelyExternal() || getJsName() != null || isExported(context)) && namedOrMissingGetter } fun IrFunction.isEqualsInheritedFromAny() = diff --git a/compiler/ir/backend.wasm/src/org/jetbrains/kotlin/backend/wasm/lower/WasmBridgesConstruction.kt b/compiler/ir/backend.wasm/src/org/jetbrains/kotlin/backend/wasm/lower/WasmBridgesConstruction.kt index 4866ee596d2..2a271194e86 100644 --- a/compiler/ir/backend.wasm/src/org/jetbrains/kotlin/backend/wasm/lower/WasmBridgesConstruction.kt +++ b/compiler/ir/backend.wasm/src/org/jetbrains/kotlin/backend/wasm/lower/WasmBridgesConstruction.kt @@ -9,6 +9,7 @@ import org.jetbrains.kotlin.backend.common.CommonBackendContext import org.jetbrains.kotlin.backend.wasm.ir2wasm.erasedUpperBound import org.jetbrains.kotlin.ir.backend.js.JsCommonBackendContext import org.jetbrains.kotlin.ir.backend.js.lower.BridgesConstruction +import org.jetbrains.kotlin.ir.declarations.IrDeclarationOrigin import org.jetbrains.kotlin.ir.declarations.IrSimpleFunction import org.jetbrains.kotlin.ir.descriptors.IrBuiltIns import org.jetbrains.kotlin.ir.types.IrType @@ -18,12 +19,14 @@ import org.jetbrains.kotlin.ir.util.defaultType import org.jetbrains.kotlin.ir.util.render import org.jetbrains.kotlin.name.Name -class WasmBridgesConstruction(context: JsCommonBackendContext) : BridgesConstruction(context) { +class WasmBridgesConstruction(context: JsCommonBackendContext) : BridgesConstruction(context) { override fun getFunctionSignature(function: IrSimpleFunction): WasmSignature = function.wasmSignature(context.irBuiltIns) // Dispatch receiver type must be casted when types are different. override val shouldCastDispatchReceiver: Boolean = true + override fun getBridgeOrigin(bridge: IrSimpleFunction): IrDeclarationOrigin = + IrDeclarationOrigin.BRIDGE } data class WasmSignature( From 5fa9acc17ac27b8844b150eab3d3f818059986bc Mon Sep 17 00:00:00 2001 From: Ilya Goncharov Date: Mon, 25 Jan 2021 17:17:52 +0300 Subject: [PATCH 148/212] [JS IR] Add additional exported declarations inside dce loop [JS IR] Remove useless filter in dce for more log information ^KT-44469 fixed --- .../backend.js/src/org/jetbrains/kotlin/ir/backend/js/Dce.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/Dce.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/Dce.kt index c4c5ff00461..a07ba642801 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/Dce.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/Dce.kt @@ -407,13 +407,16 @@ fun usefulDeclarations(roots: Iterable, context: JsIrBackendConte } } } + + context.additionalExportedDeclarations + .forEach { it.enqueue(null, "from additionalExportedDeclarations", altFromFqn = "") } } if (printReachabilityInfo) { reachabilityInfo.forEach(::println) } - return result + context.additionalExportedDeclarations + return result } private fun Collection.filterDescendantsOf(bases: Collection): Collection { From bea29d0de52574e2403513ed483eb6feadeddebf Mon Sep 17 00:00:00 2001 From: Mikhael Bogdanov Date: Thu, 28 Jan 2021 10:56:47 +0100 Subject: [PATCH 149/212] Add test for KT-44074 #KT-44074 --- .../test/IrKotlinSteppingTestGenerated.java | 5 +++++ .../debugger/test/KotlinSteppingTestGenerated.java | 5 +++++ .../testData/stepping/stepOver/kt44074.kt | 14 ++++++++++++++ .../testData/stepping/stepOver/kt44074.out | 8 ++++++++ 4 files changed, 32 insertions(+) create mode 100644 idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/kt44074.kt create mode 100644 idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/kt44074.out diff --git a/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/IrKotlinSteppingTestGenerated.java b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/IrKotlinSteppingTestGenerated.java index 6ac4bf55172..fc7d1f26c6f 100644 --- a/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/IrKotlinSteppingTestGenerated.java +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/IrKotlinSteppingTestGenerated.java @@ -483,6 +483,11 @@ public class IrKotlinSteppingTestGenerated extends AbstractIrKotlinSteppingTest runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/kt24343.kt"); } + @TestMetadata("kt44074.kt") + public void testKt44074() throws Exception { + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/kt44074.kt"); + } + @TestMetadata("lambdaToInlineFold.kt") public void testLambdaToInlineFold() throws Exception { runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/lambdaToInlineFold.kt"); diff --git a/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/KotlinSteppingTestGenerated.java b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/KotlinSteppingTestGenerated.java index 1fce43faee8..863283169b6 100644 --- a/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/KotlinSteppingTestGenerated.java +++ b/idea/jvm-debugger/jvm-debugger-test/test/org/jetbrains/kotlin/idea/debugger/test/KotlinSteppingTestGenerated.java @@ -483,6 +483,11 @@ public class KotlinSteppingTestGenerated extends AbstractKotlinSteppingTest { runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/kt24343.kt"); } + @TestMetadata("kt44074.kt") + public void testKt44074() throws Exception { + runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/kt44074.kt"); + } + @TestMetadata("lambdaToInlineFold.kt") public void testLambdaToInlineFold() throws Exception { runTest("idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/lambdaToInlineFold.kt"); diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/kt44074.kt b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/kt44074.kt new file mode 100644 index 00000000000..ff3fa78b31f --- /dev/null +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/kt44074.kt @@ -0,0 +1,14 @@ +package test + +fun main() { + val toSet = setOf() + val clusterToReports = toSet.groupBy { it } + val updatedClusters = mutableListOf() + //Breakpoint! + updatedClusters.addAll(clusterToReports.map { it.value[0] }) // step over here + test(updatedClusters) +} + +fun test(a: Any) { + +} \ No newline at end of file diff --git a/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/kt44074.out b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/kt44074.out new file mode 100644 index 00000000000..72065627880 --- /dev/null +++ b/idea/jvm-debugger/jvm-debugger-test/testData/stepping/stepOver/kt44074.out @@ -0,0 +1,8 @@ +LineBreakpoint created at kt44074.kt:8 +Run Java +Connected to the target VM +kt44074.kt:8 +kt44074.kt:9 +Disconnected from the target VM + +Process finished with exit code 0 From b16b1b3b782153f165933cad9a263c644d207d75 Mon Sep 17 00:00:00 2001 From: Mikhael Bogdanov Date: Thu, 28 Jan 2021 12:53:32 +0100 Subject: [PATCH 150/212] Test for obsolete KT-26360 #KT-26360 --- .../FirBlackBoxCodegenTestGenerated.java | 6 ++++++ .../codegen/box/jvm8/defaults/26360.kt | 20 +++++++++++++++++++ .../codegen/BlackBoxCodegenTestGenerated.java | 6 ++++++ .../IrBlackBoxCodegenTestGenerated.java | 6 ++++++ .../LightAnalysisModeTestGenerated.java | 5 +++++ 5 files changed, 43 insertions(+) create mode 100644 compiler/testData/codegen/box/jvm8/defaults/26360.kt diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java index 00d9130261d..9e13e9c94d4 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java @@ -19282,6 +19282,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT @TestMetadata("compiler/testData/codegen/box/jvm8/defaults") @TestDataPath("$PROJECT_ROOT") public class Defaults extends AbstractFirBlackBoxCodegenTest { + @Test + @TestMetadata("26360.kt") + public void test26360() throws Exception { + runTest("compiler/testData/codegen/box/jvm8/defaults/26360.kt"); + } + @Test @TestMetadata("accessor.kt") public void testAccessor() throws Exception { diff --git a/compiler/testData/codegen/box/jvm8/defaults/26360.kt b/compiler/testData/codegen/box/jvm8/defaults/26360.kt new file mode 100644 index 00000000000..46c91da9952 --- /dev/null +++ b/compiler/testData/codegen/box/jvm8/defaults/26360.kt @@ -0,0 +1,20 @@ +// !JVM_TARGET: 1.8 +// !JVM_DEFAULT_MODE: enable +// WITH_RUNTIME +// TARGET_BACKEND: JVM +interface Base { + fun value(): String +} + +interface SubA : Base + +interface SubB : Base { + @JvmDefault + override fun value(): String = "OK" +} + +interface SubAB : SubA, SubB + +fun box(): String { + return object : SubAB {}.value() +} \ No newline at end of file diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index 18fb78c7125..0f6898b9cc1 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -19282,6 +19282,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { @TestMetadata("compiler/testData/codegen/box/jvm8/defaults") @TestDataPath("$PROJECT_ROOT") public class Defaults extends AbstractBlackBoxCodegenTest { + @Test + @TestMetadata("26360.kt") + public void test26360() throws Exception { + runTest("compiler/testData/codegen/box/jvm8/defaults/26360.kt"); + } + @Test @TestMetadata("accessor.kt") public void testAccessor() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index 636b5fd5453..81333c097ea 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -19282,6 +19282,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes @TestMetadata("compiler/testData/codegen/box/jvm8/defaults") @TestDataPath("$PROJECT_ROOT") public class Defaults extends AbstractIrBlackBoxCodegenTest { + @Test + @TestMetadata("26360.kt") + public void test26360() throws Exception { + runTest("compiler/testData/codegen/box/jvm8/defaults/26360.kt"); + } + @Test @TestMetadata("accessor.kt") public void testAccessor() throws Exception { diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index baf97abc09c..27f9022de03 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -16922,6 +16922,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } + @TestMetadata("26360.kt") + public void test26360() throws Exception { + runTest("compiler/testData/codegen/box/jvm8/defaults/26360.kt"); + } + @TestMetadata("accessor.kt") public void testAccessor() throws Exception { runTest("compiler/testData/codegen/box/jvm8/defaults/accessor.kt"); From 0ad24f5346088580e14e362cedb8874dae953028 Mon Sep 17 00:00:00 2001 From: Mikhael Bogdanov Date: Thu, 28 Jan 2021 17:18:06 +0100 Subject: [PATCH 151/212] Enable Android box test --- .../org/jetbrains/kotlin/android/tests/AndroidRunner.java | 2 +- compiler/testData/codegen/box/inlineClasses/result.kt | 2 +- .../codegen/box/ir/serializationRegressions/transitiveClash.kt | 1 + .../box/unsignedTypes/evaluateConstructorOfUnsignedType.kt | 3 +++ compiler/testData/codegen/box/valueClasses/jvmInline.kt | 1 + 5 files changed, 7 insertions(+), 2 deletions(-) diff --git a/compiler/android-tests/tests/org/jetbrains/kotlin/android/tests/AndroidRunner.java b/compiler/android-tests/tests/org/jetbrains/kotlin/android/tests/AndroidRunner.java index d7b8b853795..a95405af339 100644 --- a/compiler/android-tests/tests/org/jetbrains/kotlin/android/tests/AndroidRunner.java +++ b/compiler/android-tests/tests/org/jetbrains/kotlin/android/tests/AndroidRunner.java @@ -25,7 +25,7 @@ import org.junit.runners.AllTests; import java.io.File; -//@RunWith(AllTests.class) +@RunWith(AllTests.class) public class AndroidRunner { private static PathManager pathManager; diff --git a/compiler/testData/codegen/box/inlineClasses/result.kt b/compiler/testData/codegen/box/inlineClasses/result.kt index a9c33ff2884..9e9b036233b 100644 --- a/compiler/testData/codegen/box/inlineClasses/result.kt +++ b/compiler/testData/codegen/box/inlineClasses/result.kt @@ -1,7 +1,7 @@ // IGNORE_BACKEND: WASM, JS_IR // IGNORE_BACKEND_FIR: JVM_IR +// IGNORE_BACKEND: ANDROID // FILE: result.kt - package kotlin inline class Result(val value: Any?) diff --git a/compiler/testData/codegen/box/ir/serializationRegressions/transitiveClash.kt b/compiler/testData/codegen/box/ir/serializationRegressions/transitiveClash.kt index de18d4c9273..b7d334e0fff 100644 --- a/compiler/testData/codegen/box/ir/serializationRegressions/transitiveClash.kt +++ b/compiler/testData/codegen/box/ir/serializationRegressions/transitiveClash.kt @@ -4,6 +4,7 @@ // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 // IGNORE_BACKEND: NATIVE +// IGNORE_BACKEND: ANDROID // IGNORE_LIGHT_ANALYSIS // MODULE: lib1 // FILE: lib1.kt diff --git a/compiler/testData/codegen/box/unsignedTypes/evaluateConstructorOfUnsignedType.kt b/compiler/testData/codegen/box/unsignedTypes/evaluateConstructorOfUnsignedType.kt index bc983847e03..f1f2f09fc7e 100644 --- a/compiler/testData/codegen/box/unsignedTypes/evaluateConstructorOfUnsignedType.kt +++ b/compiler/testData/codegen/box/unsignedTypes/evaluateConstructorOfUnsignedType.kt @@ -2,6 +2,9 @@ // WITH_REFLECT // TARGET_BACKEND: JVM +// TODO: it's not clear why compilation fails for Android +// IGNORE_BACKEND: ANDROID + @file:Suppress("INVISIBLE_MEMBER") annotation class AnnoUB(val ub0: UByte, val ub1: UByte) diff --git a/compiler/testData/codegen/box/valueClasses/jvmInline.kt b/compiler/testData/codegen/box/valueClasses/jvmInline.kt index cdb5ca6edf9..e5dda1f3c98 100644 --- a/compiler/testData/codegen/box/valueClasses/jvmInline.kt +++ b/compiler/testData/codegen/box/valueClasses/jvmInline.kt @@ -2,6 +2,7 @@ // KJS_WITH_FULL_RUNTIME // IGNORE_DEXING // IGNORE_BACKEND: WASM +// IGNORE_BACKEND: ANDROID // FILE: 1.kt From 1c612376dd3a7bf40d34b063feb98646adf6b517 Mon Sep 17 00:00:00 2001 From: Mikhael Bogdanov Date: Thu, 28 Jan 2021 18:21:38 +0100 Subject: [PATCH 152/212] Disable some android box test --- .../testData/codegen/box/enum/declaringClassOnEnumObject.kt | 3 ++- .../testData/codegen/box/inlineClasses/kclassInAnnotation.kt | 3 ++- .../codegen/box/multifileClasses/namesInMetadataAreSorted.kt | 1 + .../box/multifileClasses/optimized/namesInMetadataAreSorted.kt | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/compiler/testData/codegen/box/enum/declaringClassOnEnumObject.kt b/compiler/testData/codegen/box/enum/declaringClassOnEnumObject.kt index b0a709c813c..6d6be207813 100644 --- a/compiler/testData/codegen/box/enum/declaringClassOnEnumObject.kt +++ b/compiler/testData/codegen/box/enum/declaringClassOnEnumObject.kt @@ -1,5 +1,6 @@ // TARGET_BACKEND: JVM // IGNORE_BACKEND_FIR: JVM_IR +package test enum class KEnum { A } @@ -9,5 +10,5 @@ fun test(e: KEnum): String { fun box(): String { val result = test(KEnum.A) - return if (result == "class KEnum") "OK" else "fail: $result" + return if (result == "class test.KEnum") "OK" else "fail: $result" } \ No newline at end of file diff --git a/compiler/testData/codegen/box/inlineClasses/kclassInAnnotation.kt b/compiler/testData/codegen/box/inlineClasses/kclassInAnnotation.kt index 933f9e9ccf3..d76a73f1a8a 100644 --- a/compiler/testData/codegen/box/inlineClasses/kclassInAnnotation.kt +++ b/compiler/testData/codegen/box/inlineClasses/kclassInAnnotation.kt @@ -1,5 +1,6 @@ // WITH_REFLECT // TARGET_BACKEND: JVM +package test import kotlin.reflect.KClass @@ -12,5 +13,5 @@ class C fun box(): String { val klass = (C::class.annotations.first() as Ann).c.toString() - return if (klass == "class IC") "OK" else klass + return if (klass == "class test.IC") "OK" else klass } \ No newline at end of file diff --git a/compiler/testData/codegen/box/multifileClasses/namesInMetadataAreSorted.kt b/compiler/testData/codegen/box/multifileClasses/namesInMetadataAreSorted.kt index 463eb9b243d..64194d28cab 100644 --- a/compiler/testData/codegen/box/multifileClasses/namesInMetadataAreSorted.kt +++ b/compiler/testData/codegen/box/multifileClasses/namesInMetadataAreSorted.kt @@ -1,4 +1,5 @@ // TARGET_BACKEND: JVM +// IGNORE_BACKEND: ANDROID // WITH_RUNTIME // FILE: ccc.kt diff --git a/compiler/testData/codegen/box/multifileClasses/optimized/namesInMetadataAreSorted.kt b/compiler/testData/codegen/box/multifileClasses/optimized/namesInMetadataAreSorted.kt index 89188b029a3..0b8fd0e3805 100644 --- a/compiler/testData/codegen/box/multifileClasses/optimized/namesInMetadataAreSorted.kt +++ b/compiler/testData/codegen/box/multifileClasses/optimized/namesInMetadataAreSorted.kt @@ -1,4 +1,5 @@ // TARGET_BACKEND: JVM +// IGNORE_BACKEND: ANDROID // IGNORE_LIGHT_ANALYSIS // WITH_RUNTIME // !INHERIT_MULTIFILE_PARTS From 844d2572e5cc9e209eb6919886c5138be9733e48 Mon Sep 17 00:00:00 2001 From: Mikhael Bogdanov Date: Fri, 29 Jan 2021 08:22:18 +0100 Subject: [PATCH 153/212] Don't run dx test in emulator --- .../android-tests/android-module/build.gradle | 24 +++++++------------ .../android-module/gradle.properties | 3 +-- .../tests/CodegenTestsOnAndroidRunner.kt | 20 ---------------- 3 files changed, 9 insertions(+), 38 deletions(-) diff --git a/compiler/android-tests/android-module/build.gradle b/compiler/android-tests/android-module/build.gradle index 979124f4231..81d244ad1c1 100644 --- a/compiler/android-tests/android-module/build.gradle +++ b/compiler/android-tests/android-module/build.gradle @@ -1,7 +1,4 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. -ext { - isD8Enabled = project.findProperty('android.enableD8').toBoolean() -} buildscript { repositories { google() @@ -60,11 +57,9 @@ android { resultsDir = "build/test/results" } - if (isD8Enabled) { - compileOptions { - sourceCompatibility = 1.8 - targetCompatibility = 1.8 - } + compileOptions { + sourceCompatibility = 1.8 + targetCompatibility = 1.8 } flavorDimensions "box" @@ -86,15 +81,12 @@ android { dimension "box" } + jvm80 { + dimension "box" + } - if (isD8Enabled) { - jvm80 { - dimension "box" - } - - reflectjvm80 { - dimension "box" - } + reflectjvm80 { + dimension "box" } } diff --git a/compiler/android-tests/android-module/gradle.properties b/compiler/android-tests/android-module/gradle.properties index b5cbc3bf649..2d32c803a44 100644 --- a/compiler/android-tests/android-module/gradle.properties +++ b/compiler/android-tests/android-module/gradle.properties @@ -1,3 +1,2 @@ #don't try to download android specific tools within gradle: licence acceptance will be required -android.builder.sdkDownload=false -android.enableD8=true \ No newline at end of file +android.builder.sdkDownload=false \ No newline at end of file diff --git a/compiler/android-tests/tests/org/jetbrains/kotlin/android/tests/CodegenTestsOnAndroidRunner.kt b/compiler/android-tests/tests/org/jetbrains/kotlin/android/tests/CodegenTestsOnAndroidRunner.kt index 9d9a05be748..b435d38066d 100644 --- a/compiler/android-tests/tests/org/jetbrains/kotlin/android/tests/CodegenTestsOnAndroidRunner.kt +++ b/compiler/android-tests/tests/org/jetbrains/kotlin/android/tests/CodegenTestsOnAndroidRunner.kt @@ -55,16 +55,6 @@ class CodegenTestsOnAndroidRunner private constructor(private val pathManager: P runTestsOnEmulator(gradleRunner, TestSuite("D8")).apply { rootSuite.addTest(this) } - - renameFlavorFolder() - enableD8(false) - runTestsOnEmulator(gradleRunner, TestSuite("DX")).apply { - (0 until this.countTestCases()).forEach { - val testCase = testAt(it) as TestCase - testCase.name += "_DX" - } - rootSuite.addTest(this) - } } catch (e: RuntimeException) { e.printStackTrace() throw e @@ -81,16 +71,6 @@ class CodegenTestsOnAndroidRunner private constructor(private val pathManager: P return rootSuite } - private fun enableD8(enable: Boolean) { - val file = File(pathManager.androidTmpFolder, "gradle.properties") - val lines = file.readLines().map { - if (it.startsWith("android.enableD8=")) { - "android.enableD8=$enable" - } else it - } - file.writeText(lines.joinToString("\n")) - } - private fun processReport(suite: TestSuite, resultOutput: String) { val reportFolder = File(flavorFolder()) try { From d9f45fdf9e8b7c91beed7ce8a5c4950fc8d41fc8 Mon Sep 17 00:00:00 2001 From: "Denis.Zharkov" Date: Mon, 25 Jan 2021 15:55:22 +0300 Subject: [PATCH 154/212] FIR2IR: Fix incorrect fake override structure for delegated member in supertype In C, fake override for `name` should have B::name as base symbol, not Named::name --- .../generators/FakeOverrideGenerator.kt | 4 +++- ...mpileKotlinAgainstKotlinTestGenerated.java | 5 ++++ ...plicitOverrideForDelegatedFromSupertype.kt | 23 +++++++++++++++++++ ...mpileKotlinAgainstKotlinTestGenerated.java | 5 ++++ ...mpileKotlinAgainstKotlinTestGenerated.java | 5 ++++ .../ir/JvmIrAgainstOldBoxTestGenerated.java | 5 ++++ .../ir/JvmOldAgainstIrBoxTestGenerated.java | 5 ++++ 7 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 compiler/testData/compileKotlinAgainstKotlin/noExplicitOverrideForDelegatedFromSupertype.kt diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/FakeOverrideGenerator.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/FakeOverrideGenerator.kt index ee506407f4a..f3c2639dfce 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/FakeOverrideGenerator.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/FakeOverrideGenerator.kt @@ -192,8 +192,10 @@ class FakeOverrideGenerator( ): List { if (symbol.fir.origin != FirDeclarationOrigin.IntersectionOverride) return listOf(basedSymbol) return scope.directOverridden(symbol).map { + // Unwrapping should happen only for fake overrides members from the same class, not from supertypes + if (it.dispatchReceiverClassOrNull() != containingClass) return@map it when { - it.fir.isSubstitutionOverride && it.dispatchReceiverClassOrNull() == containingClass -> + it.fir.isSubstitutionOverride -> it.originalForSubstitutionOverride!! it.fir.origin == FirDeclarationOrigin.Delegated -> it.fir.delegatedWrapperData?.wrapped?.symbol!! as S diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/FirCompileKotlinAgainstKotlinTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/FirCompileKotlinAgainstKotlinTestGenerated.java index 988a42c505a..84630348abd 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/FirCompileKotlinAgainstKotlinTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/FirCompileKotlinAgainstKotlinTestGenerated.java @@ -375,6 +375,11 @@ public class FirCompileKotlinAgainstKotlinTestGenerated extends AbstractFirCompi runTest("compiler/testData/compileKotlinAgainstKotlin/nestedTypeAliasExpansion.kt"); } + @TestMetadata("noExplicitOverrideForDelegatedFromSupertype.kt") + public void testNoExplicitOverrideForDelegatedFromSupertype() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/noExplicitOverrideForDelegatedFromSupertype.kt"); + } + @TestMetadata("optionalAnnotation.kt") public void testOptionalAnnotation() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/optionalAnnotation.kt"); diff --git a/compiler/testData/compileKotlinAgainstKotlin/noExplicitOverrideForDelegatedFromSupertype.kt b/compiler/testData/compileKotlinAgainstKotlin/noExplicitOverrideForDelegatedFromSupertype.kt new file mode 100644 index 00000000000..9999f9323ba --- /dev/null +++ b/compiler/testData/compileKotlinAgainstKotlin/noExplicitOverrideForDelegatedFromSupertype.kt @@ -0,0 +1,23 @@ +// TARGET_BACKEND: JVM +// FILE: A.kt +package a + +interface Named { + val name: String +} + +interface A : Named + +// FILE: B.kt +import a.* + +open class B(val a: A) : A by a, Named + +class C(a: A) : B(a) + +fun box(): String { + return C(object : A { + override val name: String + get() = "OK" + }).name +} diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/CompileKotlinAgainstKotlinTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/CompileKotlinAgainstKotlinTestGenerated.java index 3bec557cb3f..fcc51dc8196 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/CompileKotlinAgainstKotlinTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/CompileKotlinAgainstKotlinTestGenerated.java @@ -374,6 +374,11 @@ public class CompileKotlinAgainstKotlinTestGenerated extends AbstractCompileKotl runTest("compiler/testData/compileKotlinAgainstKotlin/nestedTypeAliasExpansion.kt"); } + @TestMetadata("noExplicitOverrideForDelegatedFromSupertype.kt") + public void testNoExplicitOverrideForDelegatedFromSupertype() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/noExplicitOverrideForDelegatedFromSupertype.kt"); + } + @TestMetadata("optionalAnnotation.kt") public void testOptionalAnnotation() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/optionalAnnotation.kt"); diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstKotlinTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstKotlinTestGenerated.java index 17a233ad471..0cb25e9e39d 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstKotlinTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstKotlinTestGenerated.java @@ -375,6 +375,11 @@ public class IrCompileKotlinAgainstKotlinTestGenerated extends AbstractIrCompile runTest("compiler/testData/compileKotlinAgainstKotlin/nestedTypeAliasExpansion.kt"); } + @TestMetadata("noExplicitOverrideForDelegatedFromSupertype.kt") + public void testNoExplicitOverrideForDelegatedFromSupertype() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/noExplicitOverrideForDelegatedFromSupertype.kt"); + } + @TestMetadata("optionalAnnotation.kt") public void testOptionalAnnotation() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/optionalAnnotation.kt"); diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmIrAgainstOldBoxTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmIrAgainstOldBoxTestGenerated.java index 6ca89dbf251..8e232cfc58f 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmIrAgainstOldBoxTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmIrAgainstOldBoxTestGenerated.java @@ -375,6 +375,11 @@ public class JvmIrAgainstOldBoxTestGenerated extends AbstractJvmIrAgainstOldBoxT runTest("compiler/testData/compileKotlinAgainstKotlin/nestedTypeAliasExpansion.kt"); } + @TestMetadata("noExplicitOverrideForDelegatedFromSupertype.kt") + public void testNoExplicitOverrideForDelegatedFromSupertype() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/noExplicitOverrideForDelegatedFromSupertype.kt"); + } + @TestMetadata("optionalAnnotation.kt") public void testOptionalAnnotation() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/optionalAnnotation.kt"); diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmOldAgainstIrBoxTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmOldAgainstIrBoxTestGenerated.java index 301c57aee00..842f7dc7c68 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmOldAgainstIrBoxTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmOldAgainstIrBoxTestGenerated.java @@ -375,6 +375,11 @@ public class JvmOldAgainstIrBoxTestGenerated extends AbstractJvmOldAgainstIrBoxT runTest("compiler/testData/compileKotlinAgainstKotlin/nestedTypeAliasExpansion.kt"); } + @TestMetadata("noExplicitOverrideForDelegatedFromSupertype.kt") + public void testNoExplicitOverrideForDelegatedFromSupertype() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/noExplicitOverrideForDelegatedFromSupertype.kt"); + } + @TestMetadata("optionalAnnotation.kt") public void testOptionalAnnotation() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/optionalAnnotation.kt"); From b1b89e6f5f8d703654dc263b1832de4697aaca00 Mon Sep 17 00:00:00 2001 From: "Denis.Zharkov" Date: Tue, 26 Jan 2021 10:28:07 +0300 Subject: [PATCH 155/212] FIR2IR: Fix smart-cast approximation implicit receiver Previously, it was always cast to the first type of smart cast variants list independently of callee symbol that might be present in the member scope of a different type --- .../FirBlackBoxCodegenTestGenerated.java | 6 ++++++ .../kotlin/fir/backend/Fir2IrVisitor.kt | 2 +- .../generators/CallAndReferenceGenerator.kt | 7 +++---- .../box/smartCasts/complexImplicitReceiver.kt | 17 +++++++++++++++++ .../codegen/BlackBoxCodegenTestGenerated.java | 6 ++++++ .../codegen/IrBlackBoxCodegenTestGenerated.java | 6 ++++++ .../codegen/LightAnalysisModeTestGenerated.java | 5 +++++ .../IrJsCodegenBoxES6TestGenerated.java | 5 +++++ .../semantics/IrJsCodegenBoxTestGenerated.java | 5 +++++ .../semantics/JsCodegenBoxTestGenerated.java | 5 +++++ .../IrCodegenBoxWasmTestGenerated.java | 5 +++++ 11 files changed, 64 insertions(+), 5 deletions(-) create mode 100644 compiler/testData/codegen/box/smartCasts/complexImplicitReceiver.kt diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java index 9e13e9c94d4..bb51c956b4c 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java @@ -34894,6 +34894,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/smartCasts"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test + @TestMetadata("complexImplicitReceiver.kt") + public void testComplexImplicitReceiver() throws Exception { + runTest("compiler/testData/codegen/box/smartCasts/complexImplicitReceiver.kt"); + } + @Test @TestMetadata("falseSmartCast.kt") public void testFalseSmartCast() throws Exception { diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt index 8427a0e5a48..5f0f3703d44 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt @@ -470,7 +470,7 @@ class Fir2IrVisitor( } } - private fun convertToIrReceiverExpression( + internal fun convertToIrReceiverExpression( expression: FirExpression?, calleeReference: FirReference, callableReferenceAccess: FirCallableReferenceAccess? = null diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt index fa4f3b87b31..4657a143edf 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/CallAndReferenceGenerator.kt @@ -713,10 +713,9 @@ class CallAndReferenceGenerator( if (firReceiver == explicitReceiver) { return explicitReceiverExpression } - if (firReceiver is FirResolvedQualifier) { - return convertToGetObject(firReceiver, this as? FirCallableReferenceAccess) - } - return firReceiver.takeIf { it !is FirNoReceiverExpression }?.let { visitor.convertToIrExpression(it) } + + return firReceiver.takeIf { it !is FirNoReceiverExpression } + ?.let { visitor.convertToIrReceiverExpression(it, calleeReference, this as? FirCallableReferenceAccess) } ?: explicitReceiverExpression ?: run { if (this is FirCallableReferenceAccess) return null diff --git a/compiler/testData/codegen/box/smartCasts/complexImplicitReceiver.kt b/compiler/testData/codegen/box/smartCasts/complexImplicitReceiver.kt new file mode 100644 index 00000000000..227e28633d2 --- /dev/null +++ b/compiler/testData/codegen/box/smartCasts/complexImplicitReceiver.kt @@ -0,0 +1,17 @@ +interface Bound +interface CompilerPhase + +private class CompositePhase( + val foo: String +) : CompilerPhase + +@Suppress("UNCHECKED_CAST") +fun CompilerPhase.bar(): String { + this as CompilerPhase + val ok = if (this is CompositePhase) foo + "K" else "fail" + return ok +} + +fun box(): String { + return CompositePhase("O").bar() +} diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index 0f6898b9cc1..50d4043833c 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -35094,6 +35094,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/smartCasts"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test + @TestMetadata("complexImplicitReceiver.kt") + public void testComplexImplicitReceiver() throws Exception { + runTest("compiler/testData/codegen/box/smartCasts/complexImplicitReceiver.kt"); + } + @Test @TestMetadata("falseSmartCast.kt") public void testFalseSmartCast() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index 81333c097ea..b49c31ba0e2 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -34894,6 +34894,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/smartCasts"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test + @TestMetadata("complexImplicitReceiver.kt") + public void testComplexImplicitReceiver() throws Exception { + runTest("compiler/testData/codegen/box/smartCasts/complexImplicitReceiver.kt"); + } + @Test @TestMetadata("falseSmartCast.kt") public void testFalseSmartCast() throws Exception { diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 27f9022de03..471512c6f8d 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -28666,6 +28666,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/smartCasts"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @TestMetadata("complexImplicitReceiver.kt") + public void testComplexImplicitReceiver() throws Exception { + runTest("compiler/testData/codegen/box/smartCasts/complexImplicitReceiver.kt"); + } + @TestMetadata("falseSmartCast.kt") public void testFalseSmartCast() throws Exception { runTest("compiler/testData/codegen/box/smartCasts/falseSmartCast.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java index 360ee393f14..142c74c6815 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java @@ -24792,6 +24792,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/smartCasts"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); } + @TestMetadata("complexImplicitReceiver.kt") + public void testComplexImplicitReceiver() throws Exception { + runTest("compiler/testData/codegen/box/smartCasts/complexImplicitReceiver.kt"); + } + @TestMetadata("falseSmartCast.kt") public void testFalseSmartCast() throws Exception { runTest("compiler/testData/codegen/box/smartCasts/falseSmartCast.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java index 9c921643b65..71a0780d19b 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java @@ -24792,6 +24792,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/smartCasts"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); } + @TestMetadata("complexImplicitReceiver.kt") + public void testComplexImplicitReceiver() throws Exception { + runTest("compiler/testData/codegen/box/smartCasts/complexImplicitReceiver.kt"); + } + @TestMetadata("falseSmartCast.kt") public void testFalseSmartCast() throws Exception { runTest("compiler/testData/codegen/box/smartCasts/falseSmartCast.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index 52787c0d968..b804a2cbcc4 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -24757,6 +24757,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/smartCasts"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true); } + @TestMetadata("complexImplicitReceiver.kt") + public void testComplexImplicitReceiver() throws Exception { + runTest("compiler/testData/codegen/box/smartCasts/complexImplicitReceiver.kt"); + } + @TestMetadata("falseSmartCast.kt") public void testFalseSmartCast() throws Exception { runTest("compiler/testData/codegen/box/smartCasts/falseSmartCast.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java index 99f5351fe67..e991db16c9f 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java @@ -13261,6 +13261,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/smartCasts"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true); } + @TestMetadata("complexImplicitReceiver.kt") + public void testComplexImplicitReceiver() throws Exception { + runTest("compiler/testData/codegen/box/smartCasts/complexImplicitReceiver.kt"); + } + @TestMetadata("falseSmartCast.kt") public void testFalseSmartCast() throws Exception { runTest("compiler/testData/codegen/box/smartCasts/falseSmartCast.kt"); From aab85121e2fae12d0d75aaf76f0cf9a7820bb54a Mon Sep 17 00:00:00 2001 From: "Denis.Zharkov" Date: Tue, 26 Jan 2021 10:55:55 +0300 Subject: [PATCH 156/212] Minor. Add clarification comment to MainFunctionDetector --- .../src/org/jetbrains/kotlin/idea/MainFunctionDetector.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/frontend/src/org/jetbrains/kotlin/idea/MainFunctionDetector.kt b/compiler/frontend/src/org/jetbrains/kotlin/idea/MainFunctionDetector.kt index e2e146944f6..300a09429ae 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/idea/MainFunctionDetector.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/idea/MainFunctionDetector.kt @@ -137,6 +137,7 @@ class MainFunctionDetector { assert(DescriptorUtils.isTopLevelDeclaration(descriptor)) { "main without parameters works only for top-level" } val containingFile = DescriptorToSourceUtils.getContainingFile(descriptor) // We do not support parameterless entry points having JvmName("name") but different real names + // See more at https://github.com/Kotlin/KEEP/blob/master/proposals/enhancing-main-convention.md#parameterless-main if (descriptor.name.asString() != "main") return false if (containingFile?.declarations?.any { declaration -> isMainWithParameter(declaration, checkJvmStaticAnnotation) } == true) { return false From 71596a08b3ab311759d34bd13c2f5b30d4de1b54 Mon Sep 17 00:00:00 2001 From: "Denis.Zharkov" Date: Wed, 27 Jan 2021 16:25:07 +0300 Subject: [PATCH 157/212] FIR2IR: Simplify Fir2IrImplicitCastInserter --- .../fir/backend/Fir2IrImplicitCastInserter.kt | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrImplicitCastInserter.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrImplicitCastInserter.kt index 5fc4615bae1..5db2dbb6fa6 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrImplicitCastInserter.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrImplicitCastInserter.kt @@ -22,7 +22,9 @@ import org.jetbrains.kotlin.fir.resolve.scope import org.jetbrains.kotlin.fir.scopes.FakeOverrideTypeCalculator import org.jetbrains.kotlin.fir.scopes.FirTypeScope import org.jetbrains.kotlin.fir.symbols.AbstractFirBasedSymbol -import org.jetbrains.kotlin.fir.symbols.impl.* +import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol +import org.jetbrains.kotlin.fir.symbols.impl.FirFunctionSymbol +import org.jetbrains.kotlin.fir.symbols.impl.FirPropertySymbol import org.jetbrains.kotlin.fir.types.* import org.jetbrains.kotlin.fir.visitors.FirDefaultVisitor import org.jetbrains.kotlin.ir.IrElement @@ -299,8 +301,7 @@ class Fir2IrImplicitCastInserter( return implicitCastOrExpression(value, castTypeRef) } - val originalTypeRef = expressionWithSmartcast.originalType - if (castTypeRef is FirResolvedTypeRef && originalTypeRef is FirResolvedTypeRef) { + if (castTypeRef is FirResolvedTypeRef) { val castType = castTypeRef.type if (castType is ConeIntersectionType) { val unwrappedSymbol = (referencedSymbol as? FirCallableSymbol)?.baseForIntersectionOverride ?: referencedSymbol @@ -311,15 +312,7 @@ class Fir2IrImplicitCastInserter( } } } - return if (originalExpression is FirThisReceiverExpression && - originalExpression.calleeReference.boundSymbol is FirAnonymousFunctionSymbol - ) { - // If the original is a "this" in a local function and original.type is the same as castType, - // we still want to keep the cast. See kt-42517 - implicitCast(value, castTypeRef.toIrType()) - } else { - implicitCastOrExpression(value, castTypeRef.toIrType()) - } + return implicitCastOrExpression(value, castTypeRef.toIrType()) } private fun ConeKotlinType.doesContainReferencedSymbolInScope( From b3b1eb57ae6727d4fcd46ec5693268ce5af48d45 Mon Sep 17 00:00:00 2001 From: "Denis.Zharkov" Date: Wed, 27 Jan 2021 18:11:04 +0300 Subject: [PATCH 158/212] FIR2IR: Simplify Fir2IrImplicitCastInserter::convertToImplicitCastExpression Use dispatchReceiverType instead of looking into scopes --- .../fir/backend/Fir2IrImplicitCastInserter.kt | 80 +++++-------------- 1 file changed, 19 insertions(+), 61 deletions(-) diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrImplicitCastInserter.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrImplicitCastInserter.kt index 5db2dbb6fa6..04e7d2b1c84 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrImplicitCastInserter.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrImplicitCastInserter.kt @@ -6,9 +6,9 @@ package org.jetbrains.kotlin.fir.backend import org.jetbrains.kotlin.fir.FirElement -import org.jetbrains.kotlin.fir.baseForIntersectionOverride import org.jetbrains.kotlin.fir.declarations.FirAnonymousFunction import org.jetbrains.kotlin.fir.declarations.FirAnonymousObject +import org.jetbrains.kotlin.fir.declarations.FirCallableMemberDeclaration import org.jetbrains.kotlin.fir.declarations.FirTypeAlias import org.jetbrains.kotlin.fir.expressions.* import org.jetbrains.kotlin.fir.expressions.impl.FirStubStatement @@ -16,15 +16,8 @@ import org.jetbrains.kotlin.fir.expressions.impl.FirUnitExpression import org.jetbrains.kotlin.fir.references.FirReference import org.jetbrains.kotlin.fir.references.FirResolvedNamedReference import org.jetbrains.kotlin.fir.render -import org.jetbrains.kotlin.fir.resolve.calls.FirSyntheticPropertiesScope -import org.jetbrains.kotlin.fir.resolve.calls.SyntheticPropertySymbol -import org.jetbrains.kotlin.fir.resolve.scope -import org.jetbrains.kotlin.fir.scopes.FakeOverrideTypeCalculator -import org.jetbrains.kotlin.fir.scopes.FirTypeScope -import org.jetbrains.kotlin.fir.symbols.AbstractFirBasedSymbol import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol -import org.jetbrains.kotlin.fir.symbols.impl.FirFunctionSymbol -import org.jetbrains.kotlin.fir.symbols.impl.FirPropertySymbol +import org.jetbrains.kotlin.fir.typeContext import org.jetbrains.kotlin.fir.types.* import org.jetbrains.kotlin.fir.visitors.FirDefaultVisitor import org.jetbrains.kotlin.ir.IrElement @@ -36,7 +29,7 @@ import org.jetbrains.kotlin.ir.types.withHasQuestionMark import org.jetbrains.kotlin.ir.util.classId import org.jetbrains.kotlin.ir.util.coerceToUnitIfNeeded import org.jetbrains.kotlin.ir.util.parentAsClass -import org.jetbrains.kotlin.name.Name +import org.jetbrains.kotlin.types.AbstractTypeChecker class Fir2IrImplicitCastInserter( private val components: Fir2IrComponents, @@ -292,61 +285,26 @@ class Fir2IrImplicitCastInserter( ): IrExpression { val originalExpression = expressionWithSmartcast.originalExpression val value = visitor.convertToIrExpression(originalExpression) - val castTypeRef = expressionWithSmartcast.typeRef - if (calleeReference !is FirResolvedNamedReference) { - return implicitCastOrExpression(value, castTypeRef) - } - val referencedSymbol = calleeReference.resolvedSymbol - if (referencedSymbol !is FirPropertySymbol && referencedSymbol !is FirFunctionSymbol && referencedSymbol !is FirFieldSymbol) { - return implicitCastOrExpression(value, castTypeRef) - } - if (castTypeRef is FirResolvedTypeRef) { - val castType = castTypeRef.type - if (castType is ConeIntersectionType) { - val unwrappedSymbol = (referencedSymbol as? FirCallableSymbol)?.baseForIntersectionOverride ?: referencedSymbol - castType.intersectedTypes.forEach { - if (it.doesContainReferencedSymbolInScope(unwrappedSymbol, calleeReference.name)) { - return implicitCastOrExpression(value, it) - } - } + val typeRef = expressionWithSmartcast.typeRef + val referencedDeclaration = + ((calleeReference as? FirResolvedNamedReference)?.resolvedSymbol as? FirCallableSymbol<*>)?.unwrapCallRepresentative() + ?.fir as FirCallableMemberDeclaration<*> + + val dispatchReceiverType = + referencedDeclaration.dispatchReceiverType as? ConeClassLikeType + ?: return implicitCastOrExpression(value, typeRef) + + val starProjectedDispatchReceiver = dispatchReceiverType.replaceArgumentsWithStarProjections() + + val castType = typeRef.coneTypeSafe() + castType?.intersectedTypes?.forEach { type -> + if (AbstractTypeChecker.isSubtypeOf(session.typeContext, type, starProjectedDispatchReceiver)) { + return implicitCastOrExpression(value, type) } } - return implicitCastOrExpression(value, castTypeRef.toIrType()) - } - private fun ConeKotlinType.doesContainReferencedSymbolInScope( - referencedSymbol: AbstractFirBasedSymbol<*>, name: Name - ): Boolean { - val scope = scope(session, components.scopeSession, FakeOverrideTypeCalculator.Forced) ?: return false - if (referencedSymbol is SyntheticPropertySymbol) { - return doesContainReferencedSyntheticSymbolInScope(referencedSymbol, name, scope) - } - var result = false - val processor = { it: FirCallableSymbol<*> -> - if (!result && it == referencedSymbol) { - result = true - } - } - when (referencedSymbol) { - is FirPropertySymbol, is FirFieldSymbol -> scope.processPropertiesByName(name, processor) - is FirFunctionSymbol -> scope.processFunctionsByName(name, processor) - } - return result - } - - private fun doesContainReferencedSyntheticSymbolInScope( - referencedSymbol: SyntheticPropertySymbol, name: Name, baseScope: FirTypeScope - ): Boolean { - val scope = FirSyntheticPropertiesScope(session, baseScope) - var result = false - val processor = { it: FirCallableSymbol<*> -> - if (!result && it.callableId == referencedSymbol.callableId) { - result = true - } - } - scope.processPropertiesByName(name, processor) - return result + return implicitCastOrExpression(value, typeRef) } private fun implicitCastOrExpression(original: IrExpression, castType: ConeKotlinType): IrExpression { From 5c62ee4ba896536c6674d7a752ca0dc5408e91c2 Mon Sep 17 00:00:00 2001 From: "Denis.Zharkov" Date: Wed, 27 Jan 2021 19:51:14 +0300 Subject: [PATCH 159/212] FIR2IR: Fix complex cases of smart cast expressions used as dispatch receiver It might be not only (a).foo(), but also id((a)).foo() and many other cases --- .../FirBlackBoxCodegenTestGenerated.java | 6 +++++ .../fir/backend/Fir2IrImplicitCastInserter.kt | 26 +++++++++---------- .../kotlin/fir/backend/Fir2IrVisitor.kt | 11 +++++--- .../box/smartCasts/complexExplicitReceiver.kt | 26 +++++++++++++++++++ .../ir/irText/expressions/bangbang.fir.kt.txt | 2 +- .../ir/irText/expressions/bangbang.fir.txt | 3 ++- .../expressions/chainOfSafeCalls.kt.txt | 9 +++---- .../irText/expressions/chainOfSafeCalls.txt | 12 ++++++--- .../expressions/coercionToUnit.fir.kt.txt | 4 +-- .../irText/expressions/coercionToUnit.fir.txt | 6 +++-- .../ir/irText/expressions/dotQualified.kt.txt | 3 +-- .../ir/irText/expressions/dotQualified.txt | 3 ++- .../ir/irText/expressions/kt30020.fir.kt.txt | 4 +-- .../ir/irText/expressions/kt30020.fir.txt | 6 +++-- .../expressions/safeAssignment.fir.kt.txt | 2 +- .../irText/expressions/safeAssignment.fir.txt | 3 ++- .../safeCallWithIncrementDecrement.fir.kt.txt | 8 +++--- .../safeCallWithIncrementDecrement.fir.txt | 12 ++++++--- .../irText/expressions/safeCalls.fir.kt.txt | 10 +++---- .../ir/irText/expressions/safeCalls.fir.txt | 15 +++++++---- ...temporaryInEnumEntryInitializer.fir.kt.txt | 2 +- .../temporaryInEnumEntryInitializer.fir.txt | 3 ++- .../expressions/temporaryInInitBlock.kt.txt | 3 +-- .../expressions/temporaryInInitBlock.txt | 3 ++- .../variableAsFunctionCall.fir.kt.txt | 4 +-- .../variableAsFunctionCall.fir.txt | 6 +++-- .../ImplicitReceiverStack.fir.kt.txt | 2 +- .../firProblems/ImplicitReceiverStack.fir.txt | 3 ++- .../ir/irText/firProblems/JCTree.fir.kt.txt | 2 +- .../ir/irText/firProblems/JCTree.fir.txt | 3 ++- .../coercionToUnitForNestedWhen.fir.kt.txt | 4 +-- .../coercionToUnitForNestedWhen.fir.txt | 6 +++-- .../genericDelegatedDeepProperty.fir.kt.txt | 4 +-- .../genericDelegatedDeepProperty.fir.txt | 6 +++-- .../genericPropertyReferenceType.fir.kt.txt | 2 +- .../genericPropertyReferenceType.fir.txt | 3 ++- ...alVariableOfIntersectionType_NI.fir.kt.txt | 4 +-- ...localVariableOfIntersectionType_NI.fir.txt | 16 +++++++----- .../codegen/BlackBoxCodegenTestGenerated.java | 6 +++++ .../IrBlackBoxCodegenTestGenerated.java | 6 +++++ .../LightAnalysisModeTestGenerated.java | 5 ++++ .../IrJsCodegenBoxES6TestGenerated.java | 5 ++++ .../IrJsCodegenBoxTestGenerated.java | 5 ++++ .../semantics/JsCodegenBoxTestGenerated.java | 5 ++++ .../IrCodegenBoxWasmTestGenerated.java | 5 ++++ 45 files changed, 193 insertions(+), 91 deletions(-) create mode 100644 compiler/testData/codegen/box/smartCasts/complexExplicitReceiver.kt diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java index bb51c956b4c..7e2ca5a9370 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java @@ -34894,6 +34894,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/smartCasts"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test + @TestMetadata("complexExplicitReceiver.kt") + public void testComplexExplicitReceiver() throws Exception { + runTest("compiler/testData/codegen/box/smartCasts/complexExplicitReceiver.kt"); + } + @Test @TestMetadata("complexImplicitReceiver.kt") public void testComplexImplicitReceiver() throws Exception { diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrImplicitCastInserter.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrImplicitCastInserter.kt index 04e7d2b1c84..4c68686a54a 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrImplicitCastInserter.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrImplicitCastInserter.kt @@ -280,31 +280,29 @@ class Fir2IrImplicitCastInserter( return implicitCastOrExpression(data as IrExpression, expressionWithSmartcast.typeRef) } - internal fun convertToImplicitCastExpression( - expressionWithSmartcast: FirExpressionWithSmartcast, calleeReference: FirReference + internal fun implicitCastFromDispatchReceiver( + original: IrExpression, + originalTypeRef: FirTypeRef, + calleeReference: FirReference, ): IrExpression { - val originalExpression = expressionWithSmartcast.originalExpression - val value = visitor.convertToIrExpression(originalExpression) - - val typeRef = expressionWithSmartcast.typeRef val referencedDeclaration = ((calleeReference as? FirResolvedNamedReference)?.resolvedSymbol as? FirCallableSymbol<*>)?.unwrapCallRepresentative() - ?.fir as FirCallableMemberDeclaration<*> + ?.fir as? FirCallableMemberDeclaration<*> val dispatchReceiverType = - referencedDeclaration.dispatchReceiverType as? ConeClassLikeType - ?: return implicitCastOrExpression(value, typeRef) + referencedDeclaration?.dispatchReceiverType as? ConeClassLikeType + ?: return implicitCastOrExpression(original, originalTypeRef) val starProjectedDispatchReceiver = dispatchReceiverType.replaceArgumentsWithStarProjections() - val castType = typeRef.coneTypeSafe() - castType?.intersectedTypes?.forEach { type -> - if (AbstractTypeChecker.isSubtypeOf(session.typeContext, type, starProjectedDispatchReceiver)) { - return implicitCastOrExpression(value, type) + val castType = originalTypeRef.coneTypeSafe() + castType?.intersectedTypes?.forEach { componentType -> + if (AbstractTypeChecker.isSubtypeOf(session.typeContext, componentType, starProjectedDispatchReceiver)) { + return implicitCastOrExpression(original, componentType) } } - return implicitCastOrExpression(value, typeRef) + return implicitCastOrExpression(original, originalTypeRef) } private fun implicitCastOrExpression(original: IrExpression, castType: ConeKotlinType): IrExpression { diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt index 5f0f3703d44..8b418059d09 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt @@ -21,6 +21,7 @@ import org.jetbrains.kotlin.fir.expressions.impl.FirStubStatement import org.jetbrains.kotlin.fir.expressions.impl.FirUnitExpression import org.jetbrains.kotlin.fir.references.FirReference import org.jetbrains.kotlin.fir.references.FirResolvedNamedReference +import org.jetbrains.kotlin.fir.references.FirSuperReference import org.jetbrains.kotlin.fir.resolve.isIteratorNext import org.jetbrains.kotlin.fir.resolve.toSymbol import org.jetbrains.kotlin.fir.symbols.impl.* @@ -476,10 +477,10 @@ class Fir2IrVisitor( callableReferenceAccess: FirCallableReferenceAccess? = null ): IrExpression? { return when (expression) { - null -> null + null -> return null is FirResolvedQualifier -> callGenerator.convertToGetObject(expression, callableReferenceAccess) - is FirExpressionWithSmartcast -> implicitCastInserter.convertToImplicitCastExpression(expression, calleeReference) - is FirFunctionCall, is FirThisReceiverExpression, is FirCallableReferenceAccess -> convertToIrExpression(expression) + is FirFunctionCall, is FirThisReceiverExpression, is FirCallableReferenceAccess, is FirExpressionWithSmartcast -> + convertToIrExpression(expression) else -> if (expression is FirQualifiedAccessExpression && expression.explicitReceiver == null) { val variableAsFunctionMode = calleeReference is FirResolvedNamedReference && calleeReference.name != OperatorNameConventions.INVOKE && @@ -491,6 +492,10 @@ class Fir2IrVisitor( } else { convertToIrExpression(expression) } + }?.run { + if (expression is FirQualifiedAccessExpression && expression.calleeReference is FirSuperReference) return@run this + + implicitCastInserter.implicitCastFromDispatchReceiver(this, expression.typeRef, calleeReference) } } diff --git a/compiler/testData/codegen/box/smartCasts/complexExplicitReceiver.kt b/compiler/testData/codegen/box/smartCasts/complexExplicitReceiver.kt new file mode 100644 index 00000000000..7f0c4b6fb0a --- /dev/null +++ b/compiler/testData/codegen/box/smartCasts/complexExplicitReceiver.kt @@ -0,0 +1,26 @@ +abstract class A { + abstract fun o(): String +} + +interface B { + fun k(): String +} + +fun id(x: T): T = x + +fun foo(a: A?): String { + if (a is B) { + return id(a).o() + a!!.k() + } + + return "fail" +} + +class Impl : A(), B { + override fun o(): String = "O" + override fun k(): String = "K" +} + +fun box(): String { + return foo(Impl()) +} diff --git a/compiler/testData/ir/irText/expressions/bangbang.fir.kt.txt b/compiler/testData/ir/irText/expressions/bangbang.fir.kt.txt index dd8140cc05f..d217c5919f6 100644 --- a/compiler/testData/ir/irText/expressions/bangbang.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/bangbang.fir.kt.txt @@ -7,7 +7,7 @@ fun test2(a: Any?): Int { val tmp0_safe_receiver: Any? = a when { EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null - else -> tmp0_safe_receiver.hashCode() + else -> tmp0_safe_receiver /*as Any */.hashCode() } }) } diff --git a/compiler/testData/ir/irText/expressions/bangbang.fir.txt b/compiler/testData/ir/irText/expressions/bangbang.fir.txt index cca5d161680..dc9d1daf00b 100644 --- a/compiler/testData/ir/irText/expressions/bangbang.fir.txt +++ b/compiler/testData/ir/irText/expressions/bangbang.fir.txt @@ -24,7 +24,8 @@ FILE fqName: fileName:/bangbang.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null - $this: GET_VAR 'val tmp_0: kotlin.Any? [val] declared in .test2' type=kotlin.Any? origin=null + $this: TYPE_OP type=kotlin.Any origin=IMPLICIT_CAST typeOperand=kotlin.Any + GET_VAR 'val tmp_0: kotlin.Any? [val] declared in .test2' type=kotlin.Any? origin=null FUN name:test3 visibility:public modality:FINAL (a:X of .test3) returnType:X of .test3 TYPE_PARAMETER name:X index:0 variance: superTypes:[kotlin.Any?] VALUE_PARAMETER name:a index:0 type:X of .test3 diff --git a/compiler/testData/ir/irText/expressions/chainOfSafeCalls.kt.txt b/compiler/testData/ir/irText/expressions/chainOfSafeCalls.kt.txt index 7a94b51e0c0..24b10edc3dd 100644 --- a/compiler/testData/ir/irText/expressions/chainOfSafeCalls.kt.txt +++ b/compiler/testData/ir/irText/expressions/chainOfSafeCalls.kt.txt @@ -23,23 +23,22 @@ fun test(nc: C?): C? { val tmp0_safe_receiver: C? = nc when { EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null - else -> tmp0_safe_receiver.foo() + else -> tmp0_safe_receiver /*as C */.foo() } } when { EQEQ(arg0 = tmp1_safe_receiver, arg1 = null) -> null - else -> tmp1_safe_receiver.bar() + else -> tmp1_safe_receiver /*as C */.bar() } } when { EQEQ(arg0 = tmp2_safe_receiver, arg1 = null) -> null - else -> tmp2_safe_receiver.foo() + else -> tmp2_safe_receiver /*as C */.foo() } } when { EQEQ(arg0 = tmp3_safe_receiver, arg1 = null) -> null - else -> tmp3_safe_receiver.foo() + else -> tmp3_safe_receiver /*as C */.foo() } } } - diff --git a/compiler/testData/ir/irText/expressions/chainOfSafeCalls.txt b/compiler/testData/ir/irText/expressions/chainOfSafeCalls.txt index ed8e621b69d..461a12bf19f 100644 --- a/compiler/testData/ir/irText/expressions/chainOfSafeCalls.txt +++ b/compiler/testData/ir/irText/expressions/chainOfSafeCalls.txt @@ -50,7 +50,8 @@ FILE fqName: fileName:/chainOfSafeCalls.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public final fun foo (): .C declared in .C' type=.C origin=null - $this: GET_VAR 'val tmp_3: .C? [val] declared in .test' type=.C? origin=null + $this: TYPE_OP type=.C origin=IMPLICIT_CAST typeOperand=.C + GET_VAR 'val tmp_3: .C? [val] declared in .test' type=.C? origin=null WHEN type=.C? origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ @@ -60,7 +61,8 @@ FILE fqName: fileName:/chainOfSafeCalls.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public final fun bar (): .C? declared in .C' type=.C? origin=null - $this: GET_VAR 'val tmp_2: .C? [val] declared in .test' type=.C? origin=null + $this: TYPE_OP type=.C origin=IMPLICIT_CAST typeOperand=.C + GET_VAR 'val tmp_2: .C? [val] declared in .test' type=.C? origin=null WHEN type=.C? origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ @@ -70,7 +72,8 @@ FILE fqName: fileName:/chainOfSafeCalls.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public final fun foo (): .C declared in .C' type=.C origin=null - $this: GET_VAR 'val tmp_1: .C? [val] declared in .test' type=.C? origin=null + $this: TYPE_OP type=.C origin=IMPLICIT_CAST typeOperand=.C + GET_VAR 'val tmp_1: .C? [val] declared in .test' type=.C? origin=null WHEN type=.C? origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ @@ -80,4 +83,5 @@ FILE fqName: fileName:/chainOfSafeCalls.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public final fun foo (): .C declared in .C' type=.C origin=null - $this: GET_VAR 'val tmp_0: .C? [val] declared in .test' type=.C? origin=null + $this: TYPE_OP type=.C origin=IMPLICIT_CAST typeOperand=.C + GET_VAR 'val tmp_0: .C? [val] declared in .test' type=.C? origin=null diff --git a/compiler/testData/ir/irText/expressions/coercionToUnit.fir.kt.txt b/compiler/testData/ir/irText/expressions/coercionToUnit.fir.kt.txt index 2d878235e87..4f3d8236800 100644 --- a/compiler/testData/ir/irText/expressions/coercionToUnit.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/coercionToUnit.fir.kt.txt @@ -14,14 +14,14 @@ fun test3() { val tmp0_safe_receiver: PrintStream? = #out when { EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null - else -> tmp0_safe_receiver.println(p0 = "Hello,") + else -> tmp0_safe_receiver /*as @FlexibleNullability PrintStream */.println(p0 = "Hello,") } } /*~> Unit */ { // BLOCK val tmp1_safe_receiver: PrintStream? = #out when { EQEQ(arg0 = tmp1_safe_receiver, arg1 = null) -> null - else -> tmp1_safe_receiver.println(p0 = "world!") + else -> tmp1_safe_receiver /*as @FlexibleNullability PrintStream */.println(p0 = "world!") } } /*~> Unit */ } diff --git a/compiler/testData/ir/irText/expressions/coercionToUnit.fir.txt b/compiler/testData/ir/irText/expressions/coercionToUnit.fir.txt index 18e3854f53c..f96009bc4cc 100644 --- a/compiler/testData/ir/irText/expressions/coercionToUnit.fir.txt +++ b/compiler/testData/ir/irText/expressions/coercionToUnit.fir.txt @@ -34,7 +34,8 @@ FILE fqName: fileName:/coercionToUnit.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public open fun println (p0: kotlin.String?): kotlin.Unit declared in java.io.PrintStream' type=kotlin.Unit origin=null - $this: GET_VAR 'val tmp_0: java.io.PrintStream? [val] declared in .test3' type=java.io.PrintStream? origin=null + $this: TYPE_OP type=@[FlexibleNullability] java.io.PrintStream origin=IMPLICIT_CAST typeOperand=@[FlexibleNullability] java.io.PrintStream + GET_VAR 'val tmp_0: java.io.PrintStream? [val] declared in .test3' type=java.io.PrintStream? origin=null p0: CONST String type=kotlin.String value="Hello," TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit BLOCK type=kotlin.Unit? origin=SAFE_CALL @@ -49,5 +50,6 @@ FILE fqName: fileName:/coercionToUnit.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public open fun println (p0: kotlin.String?): kotlin.Unit declared in java.io.PrintStream' type=kotlin.Unit origin=null - $this: GET_VAR 'val tmp_1: java.io.PrintStream? [val] declared in .test3' type=java.io.PrintStream? origin=null + $this: TYPE_OP type=@[FlexibleNullability] java.io.PrintStream origin=IMPLICIT_CAST typeOperand=@[FlexibleNullability] java.io.PrintStream + GET_VAR 'val tmp_1: java.io.PrintStream? [val] declared in .test3' type=java.io.PrintStream? origin=null p0: CONST String type=kotlin.String value="world!" diff --git a/compiler/testData/ir/irText/expressions/dotQualified.kt.txt b/compiler/testData/ir/irText/expressions/dotQualified.kt.txt index e155ea3c2ee..550df1664ee 100644 --- a/compiler/testData/ir/irText/expressions/dotQualified.kt.txt +++ b/compiler/testData/ir/irText/expressions/dotQualified.kt.txt @@ -7,8 +7,7 @@ fun lengthN(s: String?): Int? { val tmp0_safe_receiver: String? = s when { EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null - else -> tmp0_safe_receiver.() + else -> tmp0_safe_receiver /*as String */.() } } } - diff --git a/compiler/testData/ir/irText/expressions/dotQualified.txt b/compiler/testData/ir/irText/expressions/dotQualified.txt index 7d730a47d3b..f33bb88ffcd 100644 --- a/compiler/testData/ir/irText/expressions/dotQualified.txt +++ b/compiler/testData/ir/irText/expressions/dotQualified.txt @@ -21,4 +21,5 @@ FILE fqName: fileName:/dotQualified.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public open fun (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR 'val tmp_0: kotlin.String? [val] declared in .lengthN' type=kotlin.String? origin=null + $this: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String + GET_VAR 'val tmp_0: kotlin.String? [val] declared in .lengthN' type=kotlin.String? origin=null diff --git a/compiler/testData/ir/irText/expressions/kt30020.fir.kt.txt b/compiler/testData/ir/irText/expressions/kt30020.fir.kt.txt index fd3b77edb9d..5cfdce35f5a 100644 --- a/compiler/testData/ir/irText/expressions/kt30020.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/kt30020.fir.kt.txt @@ -15,14 +15,14 @@ fun test(x: X, nx: X?) { val tmp0_safe_receiver: X? = nx when { EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null - else -> tmp0_safe_receiver.() + else -> tmp0_safe_receiver /*as X */.() } }).plusAssign(element = 5) CHECK_NOT_NULL>(arg0 = { // BLOCK val tmp1_safe_receiver: X? = nx when { EQEQ(arg0 = tmp1_safe_receiver, arg1 = null) -> null - else -> tmp1_safe_receiver.f() + else -> tmp1_safe_receiver /*as X */.f() } }).plusAssign(element = 6) } diff --git a/compiler/testData/ir/irText/expressions/kt30020.fir.txt b/compiler/testData/ir/irText/expressions/kt30020.fir.txt index 1c57f6ea4a7..e9197fa4366 100644 --- a/compiler/testData/ir/irText/expressions/kt30020.fir.txt +++ b/compiler/testData/ir/irText/expressions/kt30020.fir.txt @@ -62,7 +62,8 @@ FILE fqName: fileName:/kt30020.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public abstract fun (): kotlin.collections.MutableList declared in .X' type=kotlin.collections.MutableList origin=GET_PROPERTY - $this: GET_VAR 'val tmp_0: .X? [val] declared in .test' type=.X? origin=null + $this: TYPE_OP type=.X origin=IMPLICIT_CAST typeOperand=.X + GET_VAR 'val tmp_0: .X? [val] declared in .test' type=.X? origin=null element: CONST Int type=kotlin.Int value=5 CALL 'public final fun plusAssign (element: T of kotlin.collections.CollectionsKt.plusAssign): kotlin.Unit [inline,operator] declared in kotlin.collections.CollectionsKt' type=kotlin.Unit origin=null : kotlin.Int @@ -80,7 +81,8 @@ FILE fqName: fileName:/kt30020.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public abstract fun f (): kotlin.collections.MutableList declared in .X' type=kotlin.collections.MutableList origin=null - $this: GET_VAR 'val tmp_1: .X? [val] declared in .test' type=.X? origin=null + $this: TYPE_OP type=.X origin=IMPLICIT_CAST typeOperand=.X + GET_VAR 'val tmp_1: .X? [val] declared in .test' type=.X? origin=null element: CONST Int type=kotlin.Int value=6 FUN name:testExtensionReceiver visibility:public modality:FINAL <> ($receiver:kotlin.collections.MutableList) returnType:kotlin.Unit $receiver: VALUE_PARAMETER name: type:kotlin.collections.MutableList diff --git a/compiler/testData/ir/irText/expressions/safeAssignment.fir.kt.txt b/compiler/testData/ir/irText/expressions/safeAssignment.fir.kt.txt index a44b20dfee8..58c85e4987b 100644 --- a/compiler/testData/ir/irText/expressions/safeAssignment.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/safeAssignment.fir.kt.txt @@ -17,7 +17,7 @@ fun test(nc: C?) { val tmp0_safe_receiver: C? = nc when { EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null - else -> tmp0_safe_receiver.( = 42) + else -> tmp0_safe_receiver /*as C */.( = 42) } } /*~> Unit */ } diff --git a/compiler/testData/ir/irText/expressions/safeAssignment.fir.txt b/compiler/testData/ir/irText/expressions/safeAssignment.fir.txt index 4491357a6c7..0a8cf9d7346 100644 --- a/compiler/testData/ir/irText/expressions/safeAssignment.fir.txt +++ b/compiler/testData/ir/irText/expressions/safeAssignment.fir.txt @@ -54,5 +54,6 @@ FILE fqName: fileName:/safeAssignment.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=EQ - $this: GET_VAR 'val tmp_0: .C? [val] declared in .test' type=.C? origin=null + $this: TYPE_OP type=.C origin=IMPLICIT_CAST typeOperand=.C + GET_VAR 'val tmp_0: .C? [val] declared in .test' type=.C? origin=null : CONST Int type=kotlin.Int value=42 diff --git a/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.kt.txt b/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.kt.txt index ea0d8518045..23d15a98d7a 100644 --- a/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.kt.txt @@ -21,7 +21,7 @@ operator fun Int?.inc(): Int? { val tmp0_safe_receiver: Int? = when { EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null - else -> tmp0_safe_receiver.inc() + else -> tmp0_safe_receiver /*as Int */.inc() } } } @@ -38,14 +38,14 @@ fun testProperty(nc: C?) { val tmp1_safe_receiver: C? = nc when { EQEQ(arg0 = tmp1_safe_receiver, arg1 = null) -> null - else -> tmp1_safe_receiver.() + else -> tmp1_safe_receiver /*as C */.() } } { // BLOCK val tmp2_safe_receiver: C? = nc when { EQEQ(arg0 = tmp2_safe_receiver, arg1 = null) -> null - else -> tmp2_safe_receiver.(value = .inc()) + else -> tmp2_safe_receiver /*as C */.(value = .inc()) } } /*~> Unit */ /*~> Unit */ @@ -56,7 +56,7 @@ fun testArrayAccess(nc: C?) { val tmp3_safe_receiver: C? = nc when { EQEQ(arg0 = tmp3_safe_receiver, arg1 = null) -> null - else -> tmp3_safe_receiver.() + else -> tmp3_safe_receiver /*as C */.() } } val : Int = 0 diff --git a/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.txt b/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.txt index d7c526ea61c..5f63dcb38aa 100644 --- a/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.txt +++ b/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.txt @@ -46,7 +46,8 @@ FILE fqName:test fileName:/safeCallWithIncrementDecrement.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_VAR 'val tmp_0: kotlin.Int? [val] declared in test.inc' type=kotlin.Int? origin=null + $this: TYPE_OP type=kotlin.Int origin=IMPLICIT_CAST typeOperand=kotlin.Int + GET_VAR 'val tmp_0: kotlin.Int? [val] declared in test.inc' type=kotlin.Int? origin=null FUN name:get visibility:public modality:FINAL <> ($receiver:kotlin.Int?, index:kotlin.Int) returnType:kotlin.Int [operator] $receiver: VALUE_PARAMETER name: type:kotlin.Int? VALUE_PARAMETER name:index index:0 type:kotlin.Int @@ -74,7 +75,8 @@ FILE fqName:test fileName:/safeCallWithIncrementDecrement.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public final fun (): kotlin.Int declared in test' type=kotlin.Int origin=GET_PROPERTY - $receiver: GET_VAR 'val tmp_2: test.C? [val] declared in test.testProperty' type=test.C? origin=null + $receiver: TYPE_OP type=test.C origin=IMPLICIT_CAST typeOperand=test.C + GET_VAR 'val tmp_2: test.C? [val] declared in test.testProperty' type=test.C? origin=null TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit BLOCK type=kotlin.Unit? origin=SAFE_CALL VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:test.C? [val] @@ -88,7 +90,8 @@ FILE fqName:test fileName:/safeCallWithIncrementDecrement.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public final fun (value: kotlin.Int): kotlin.Unit declared in test' type=kotlin.Unit origin=EQ - $receiver: GET_VAR 'val tmp_3: test.C? [val] declared in test.testProperty' type=test.C? origin=null + $receiver: TYPE_OP type=test.C origin=IMPLICIT_CAST typeOperand=test.C + GET_VAR 'val tmp_3: test.C? [val] declared in test.testProperty' type=test.C? origin=null value: CALL 'public final fun inc (): kotlin.Int? [operator] declared in test' type=kotlin.Int? origin=null $receiver: GET_VAR 'val tmp_1: kotlin.Int? [val] declared in test.testProperty' type=kotlin.Int? origin=null TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit @@ -109,7 +112,8 @@ FILE fqName:test fileName:/safeCallWithIncrementDecrement.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public final fun (): kotlin.Int declared in test' type=kotlin.Int origin=GET_PROPERTY - $receiver: GET_VAR 'val tmp_5: test.C? [val] declared in test.testArrayAccess' type=test.C? origin=null + $receiver: TYPE_OP type=test.C origin=IMPLICIT_CAST typeOperand=test.C + GET_VAR 'val tmp_5: test.C? [val] declared in test.testArrayAccess' type=test.C? origin=null VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:kotlin.Int [val] CONST Int type=kotlin.Int value=0 VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:kotlin.Int [val] diff --git a/compiler/testData/ir/irText/expressions/safeCalls.fir.kt.txt b/compiler/testData/ir/irText/expressions/safeCalls.fir.kt.txt index 9805859fa15..8cd5ff12e05 100644 --- a/compiler/testData/ir/irText/expressions/safeCalls.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/safeCalls.fir.kt.txt @@ -24,7 +24,7 @@ fun test1(x: String?): Int? { val tmp0_safe_receiver: String? = x when { EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null - else -> tmp0_safe_receiver.() + else -> tmp0_safe_receiver /*as String */.() } } } @@ -34,7 +34,7 @@ fun test2(x: String?): Int? { val tmp1_safe_receiver: String? = x when { EQEQ(arg0 = tmp1_safe_receiver, arg1 = null) -> null - else -> tmp1_safe_receiver.hashCode() + else -> tmp1_safe_receiver /*as String */.hashCode() } } } @@ -44,7 +44,7 @@ fun test3(x: String?, y: Any?): Boolean? { val tmp2_safe_receiver: String? = x when { EQEQ(arg0 = tmp2_safe_receiver, arg1 = null) -> null - else -> tmp2_safe_receiver.equals(other = y) + else -> tmp2_safe_receiver /*as String */.equals(other = y) } } } @@ -54,7 +54,7 @@ fun test4(x: Ref?) { val tmp3_safe_receiver: Ref? = x when { EQEQ(arg0 = tmp3_safe_receiver, arg1 = null) -> null - else -> tmp3_safe_receiver.( = 0) + else -> tmp3_safe_receiver /*as Ref */.( = 0) } } /*~> Unit */ } @@ -64,7 +64,7 @@ fun IHost.test5(s: String?): Int? { val tmp4_safe_receiver: String? = s when { EQEQ(arg0 = tmp4_safe_receiver, arg1 = null) -> null - else -> (, tmp4_safe_receiver).extLength() + else -> (, tmp4_safe_receiver /*as String */).extLength() } } } diff --git a/compiler/testData/ir/irText/expressions/safeCalls.fir.txt b/compiler/testData/ir/irText/expressions/safeCalls.fir.txt index 89b6504723b..8bdfebd4780 100644 --- a/compiler/testData/ir/irText/expressions/safeCalls.fir.txt +++ b/compiler/testData/ir/irText/expressions/safeCalls.fir.txt @@ -76,7 +76,8 @@ FILE fqName: fileName:/safeCalls.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public open fun (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR 'val tmp_0: kotlin.String? [val] declared in .test1' type=kotlin.String? origin=null + $this: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String + GET_VAR 'val tmp_0: kotlin.String? [val] declared in .test1' type=kotlin.String? origin=null FUN name:test2 visibility:public modality:FINAL <> (x:kotlin.String?) returnType:kotlin.Int? VALUE_PARAMETER name:x index:0 type:kotlin.String? BLOCK_BODY @@ -93,7 +94,8 @@ FILE fqName: fileName:/safeCalls.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.String' type=kotlin.Int origin=null - $this: GET_VAR 'val tmp_1: kotlin.String? [val] declared in .test2' type=kotlin.String? origin=null + $this: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String + GET_VAR 'val tmp_1: kotlin.String? [val] declared in .test2' type=kotlin.String? origin=null FUN name:test3 visibility:public modality:FINAL <> (x:kotlin.String?, y:kotlin.Any?) returnType:kotlin.Boolean? VALUE_PARAMETER name:x index:0 type:kotlin.String? VALUE_PARAMETER name:y index:1 type:kotlin.Any? @@ -111,7 +113,8 @@ FILE fqName: fileName:/safeCalls.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in kotlin.String' type=kotlin.Boolean origin=null - $this: GET_VAR 'val tmp_2: kotlin.String? [val] declared in .test3' type=kotlin.String? origin=null + $this: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String + GET_VAR 'val tmp_2: kotlin.String? [val] declared in .test3' type=kotlin.String? origin=null other: GET_VAR 'y: kotlin.Any? declared in .test3' type=kotlin.Any? origin=null FUN name:test4 visibility:public modality:FINAL <> (x:.Ref?) returnType:kotlin.Unit VALUE_PARAMETER name:x index:0 type:.Ref? @@ -129,7 +132,8 @@ FILE fqName: fileName:/safeCalls.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Ref' type=kotlin.Unit origin=EQ - $this: GET_VAR 'val tmp_3: .Ref? [val] declared in .test4' type=.Ref? origin=null + $this: TYPE_OP type=.Ref origin=IMPLICIT_CAST typeOperand=.Ref + GET_VAR 'val tmp_3: .Ref? [val] declared in .test4' type=.Ref? origin=null : CONST Int type=kotlin.Int value=0 FUN name:test5 visibility:public modality:FINAL <> ($receiver:.IHost, s:kotlin.String?) returnType:kotlin.Int? $receiver: VALUE_PARAMETER name: type:.IHost @@ -149,7 +153,8 @@ FILE fqName: fileName:/safeCalls.kt if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public open fun extLength (): kotlin.Int declared in .IHost' type=kotlin.Int origin=null $this: GET_VAR ': .IHost declared in .test5' type=.IHost origin=null - $receiver: GET_VAR 'val tmp_4: kotlin.String? [val] declared in .test5' type=kotlin.String? origin=null + $receiver: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String + GET_VAR 'val tmp_4: kotlin.String? [val] declared in .test5' type=kotlin.String? origin=null FUN name:foo visibility:public modality:FINAL <> ($receiver:kotlin.Int) returnType:kotlin.Int $receiver: VALUE_PARAMETER name: type:kotlin.Int BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.fir.kt.txt b/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.fir.kt.txt index 8019c9ab30b..32933809ff1 100644 --- a/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.fir.kt.txt @@ -17,7 +17,7 @@ open enum class En : Enum { val tmp0_safe_receiver: Any? = () when { EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null - else -> tmp0_safe_receiver.toString() + else -> tmp0_safe_receiver /*as Any */.toString() } }) diff --git a/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.fir.txt b/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.fir.txt index 033ae4b5121..bc50c00adb8 100644 --- a/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.fir.txt +++ b/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.fir.txt @@ -42,7 +42,8 @@ FILE fqName: fileName:/temporaryInEnumEntryInitializer.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null - $this: GET_VAR 'val tmp_0: kotlin.Any? [val] declared in .En' type=kotlin.Any? origin=null + $this: TYPE_OP type=kotlin.Any origin=IMPLICIT_CAST typeOperand=kotlin.Any + GET_VAR 'val tmp_0: kotlin.Any? [val] declared in .En' type=kotlin.Any? origin=null FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.En> SYNTHETIC_BODY kind=ENUM_VALUES FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.En diff --git a/compiler/testData/ir/irText/expressions/temporaryInInitBlock.kt.txt b/compiler/testData/ir/irText/expressions/temporaryInInitBlock.kt.txt index 47ad087b450..9d183ecd8b8 100644 --- a/compiler/testData/ir/irText/expressions/temporaryInInitBlock.kt.txt +++ b/compiler/testData/ir/irText/expressions/temporaryInInitBlock.kt.txt @@ -13,10 +13,9 @@ class C { val tmp0_safe_receiver: Any? = x when { EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null - else -> tmp0_safe_receiver.toString() + else -> tmp0_safe_receiver /*as Any */.toString() } } } } - diff --git a/compiler/testData/ir/irText/expressions/temporaryInInitBlock.txt b/compiler/testData/ir/irText/expressions/temporaryInInitBlock.txt index 842752aa6d2..10826774f71 100644 --- a/compiler/testData/ir/irText/expressions/temporaryInInitBlock.txt +++ b/compiler/testData/ir/irText/expressions/temporaryInInitBlock.txt @@ -31,7 +31,8 @@ FILE fqName: fileName:/temporaryInInitBlock.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null - $this: GET_VAR 'val tmp_0: kotlin.Any? [val] declared in .C' type=kotlin.Any? origin=null + $this: TYPE_OP type=kotlin.Any origin=IMPLICIT_CAST typeOperand=kotlin.Any + GET_VAR 'val tmp_0: kotlin.Any? [val] declared in .C' type=kotlin.Any? origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/variableAsFunctionCall.fir.kt.txt b/compiler/testData/ir/irText/expressions/variableAsFunctionCall.fir.kt.txt index d26d3800122..6986fd4fc10 100644 --- a/compiler/testData/ir/irText/expressions/variableAsFunctionCall.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/variableAsFunctionCall.fir.kt.txt @@ -23,12 +23,12 @@ fun test4(ns: String?): String? { val tmp0_safe_receiver: String? = ns when { EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null - else -> tmp0_safe_receiver.k() + else -> tmp0_safe_receiver /*as String */.k() } } when { EQEQ(arg0 = tmp1_safe_receiver, arg1 = null) -> null - else -> tmp1_safe_receiver.invoke() + else -> tmp1_safe_receiver /*as Function0 */.invoke() } } } diff --git a/compiler/testData/ir/irText/expressions/variableAsFunctionCall.fir.txt b/compiler/testData/ir/irText/expressions/variableAsFunctionCall.fir.txt index 7ba641b6e3a..2fda803593a 100644 --- a/compiler/testData/ir/irText/expressions/variableAsFunctionCall.fir.txt +++ b/compiler/testData/ir/irText/expressions/variableAsFunctionCall.fir.txt @@ -45,7 +45,8 @@ FILE fqName: fileName:/variableAsFunctionCall.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public final fun k (): kotlin.Function0 declared in ' type=kotlin.Function0 origin=null - $receiver: GET_VAR 'val tmp_1: kotlin.String? [val] declared in .test4' type=kotlin.String? origin=null + $receiver: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String + GET_VAR 'val tmp_1: kotlin.String? [val] declared in .test4' type=kotlin.String? origin=null WHEN type=kotlin.String? origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ @@ -55,4 +56,5 @@ FILE fqName: fileName:/variableAsFunctionCall.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=kotlin.String origin=INVOKE - $this: GET_VAR 'val tmp_0: kotlin.Function0? [val] declared in .test4' type=kotlin.Function0? origin=null + $this: TYPE_OP type=kotlin.Function0 origin=IMPLICIT_CAST typeOperand=kotlin.Function0 + GET_VAR 'val tmp_0: kotlin.Function0? [val] declared in .test4' type=kotlin.Function0? origin=null diff --git a/compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.fir.kt.txt b/compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.fir.kt.txt index 31d5a81df78..a6275eb4f88 100644 --- a/compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.fir.kt.txt @@ -79,7 +79,7 @@ fun box(): String { val tmp0_safe_receiver: ImplicitReceiverValue<*>? = stack.get(name = null) when { EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null - else -> tmp0_safe_receiver.() + else -> tmp0_safe_receiver /*as ImplicitReceiverValue<*> */.() } }) } diff --git a/compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.fir.txt b/compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.fir.txt index 06ec0dfc0fe..6dd76dc95a5 100644 --- a/compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.fir.txt +++ b/compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.fir.txt @@ -249,4 +249,5 @@ FILE fqName: fileName:/ImplicitReceiverStack.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public final fun (): kotlin.String declared in .ImplicitReceiverValue' type=kotlin.String origin=GET_PROPERTY - $this: GET_VAR 'val tmp_0: .ImplicitReceiverValue<*>? [val] declared in .box' type=.ImplicitReceiverValue<*>? origin=null + $this: TYPE_OP type=.ImplicitReceiverValue<*> origin=IMPLICIT_CAST typeOperand=.ImplicitReceiverValue<*> + GET_VAR 'val tmp_0: .ImplicitReceiverValue<*>? [val] declared in .box' type=.ImplicitReceiverValue<*>? origin=null diff --git a/compiler/testData/ir/irText/firProblems/JCTree.fir.kt.txt b/compiler/testData/ir/irText/firProblems/JCTree.fir.kt.txt index 4d37bdfb27f..f62bcb560c9 100644 --- a/compiler/testData/ir/irText/firProblems/JCTree.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/JCTree.fir.kt.txt @@ -13,7 +13,7 @@ class Owner { get(): String { var tree: JCTree = .() when { - tree /*as T */ is JCTypeApply -> return tree /*as JCTypeApply */.#clazz /*!! String */ + tree /*as T */ is JCTypeApply -> return tree /*as T */ /*as JCTypeApply */.#clazz /*!! String */ } return "" } diff --git a/compiler/testData/ir/irText/firProblems/JCTree.fir.txt b/compiler/testData/ir/irText/firProblems/JCTree.fir.txt index be83543c676..1c25e130956 100644 --- a/compiler/testData/ir/irText/firProblems/JCTree.fir.txt +++ b/compiler/testData/ir/irText/firProblems/JCTree.fir.txt @@ -35,7 +35,8 @@ FILE fqName: fileName:/JCTreeUser.kt TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:clazz type:kotlin.String? visibility:public' type=kotlin.String? origin=GET_PROPERTY receiver: TYPE_OP type=.JCTree.JCTypeApply origin=IMPLICIT_CAST typeOperand=.JCTree.JCTypeApply - GET_VAR 'var tree: .JCTree [var] declared in .Owner.' type=.JCTree origin=null + TYPE_OP type=T of .Owner origin=IMPLICIT_CAST typeOperand=T of .Owner + GET_VAR 'var tree: .JCTree [var] declared in .Owner.' type=.JCTree origin=null RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Owner' CONST String type=kotlin.String value="" FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] diff --git a/compiler/testData/ir/irText/firProblems/coercionToUnitForNestedWhen.fir.kt.txt b/compiler/testData/ir/irText/firProblems/coercionToUnitForNestedWhen.fir.kt.txt index 4cf9c1fb9dc..c5165983793 100644 --- a/compiler/testData/ir/irText/firProblems/coercionToUnitForNestedWhen.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/coercionToUnitForNestedWhen.fir.kt.txt @@ -10,7 +10,7 @@ private fun Reader.nextChar(): Char? { ) when { EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null - else -> tmp0_safe_receiver.toChar() + else -> tmp0_safe_receiver /*as Int */.toChar() } } } @@ -26,7 +26,7 @@ fun Reader.consumeRestOfQuotedSequence(sb: StringBuilder, quote: Char) { val tmp1_safe_receiver: Char? = .nextChar() when { EQEQ(arg0 = tmp1_safe_receiver, arg1 = null) -> null - else -> tmp1_safe_receiver.let(block = local fun (it: Char): StringBuilder? { + else -> tmp1_safe_receiver /*as Char */.let(block = local fun (it: Char): StringBuilder? { return sb.append(p0 = it) } ) diff --git a/compiler/testData/ir/irText/firProblems/coercionToUnitForNestedWhen.fir.txt b/compiler/testData/ir/irText/firProblems/coercionToUnitForNestedWhen.fir.txt index 24624e3721b..197ac7adb75 100644 --- a/compiler/testData/ir/irText/firProblems/coercionToUnitForNestedWhen.fir.txt +++ b/compiler/testData/ir/irText/firProblems/coercionToUnitForNestedWhen.fir.txt @@ -35,7 +35,8 @@ FILE fqName: fileName:/coercionToUnitForNestedWhen.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public open fun toChar (): kotlin.Char declared in kotlin.Int' type=kotlin.Char origin=null - $this: GET_VAR 'val tmp_0: kotlin.Int? [val] declared in .nextChar' type=kotlin.Int? origin=null + $this: TYPE_OP type=kotlin.Int origin=IMPLICIT_CAST typeOperand=kotlin.Int + GET_VAR 'val tmp_0: kotlin.Int? [val] declared in .nextChar' type=kotlin.Int? origin=null FUN name:consumeRestOfQuotedSequence visibility:public modality:FINAL <> ($receiver:java.io.Reader, sb:java.lang.StringBuilder, quote:kotlin.Char) returnType:kotlin.Unit $receiver: VALUE_PARAMETER name: type:java.io.Reader VALUE_PARAMETER name:sb index:0 type:java.lang.StringBuilder @@ -82,7 +83,8 @@ FILE fqName: fileName:/coercionToUnitForNestedWhen.kt then: CALL 'public final fun let (block: kotlin.Function1): R of kotlin.StandardKt.let [inline] declared in kotlin.StandardKt' type=java.lang.StringBuilder? origin=null : kotlin.Char : java.lang.StringBuilder? - $receiver: GET_VAR 'val tmp_1: kotlin.Char? [val] declared in .consumeRestOfQuotedSequence' type=kotlin.Char? origin=null + $receiver: TYPE_OP type=kotlin.Char origin=IMPLICIT_CAST typeOperand=kotlin.Char + GET_VAR 'val tmp_1: kotlin.Char? [val] declared in .consumeRestOfQuotedSequence' type=kotlin.Char? origin=null block: FUN_EXPR type=kotlin.Function1 origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:kotlin.Char) returnType:java.lang.StringBuilder? VALUE_PARAMETER name:it index:0 type:kotlin.Char diff --git a/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.fir.kt.txt b/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.fir.kt.txt index f7ebf840dfd..44b470be1c1 100644 --- a/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.fir.kt.txt +++ b/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.fir.kt.txt @@ -108,7 +108,7 @@ val Value>.additionalText: P /* by */ () } get(): T { - return .#deepO$delegate.getValue(t = , p = ::deepO) + return /*as */.#deepO$delegate.getValue(t = , p = ::deepO) } private val Value>.deepK: T /* by */ @@ -129,7 +129,7 @@ val Value>.additionalText: P /* by */ () } get(): T { - return .#deepK$delegate.getValue(t = , p = ::deepK) + return /*as */.#deepK$delegate.getValue(t = , p = ::deepK) } override operator fun getValue(t: Value>, p: KProperty<*>): P { diff --git a/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.fir.txt b/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.fir.txt index 3afe437a671..3e3d08e97bc 100644 --- a/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.fir.txt +++ b/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.fir.txt @@ -279,7 +279,8 @@ FILE fqName: fileName:/genericDelegatedDeepProperty.kt RETURN type=kotlin.Nothing from='public final fun (): T of . declared in .additionalText$delegate.' CALL 'public final fun getValue (t: .Value., .CR.>>, p: kotlin.reflect.KProperty<*>): T of . [operator] declared in .additionalText$delegate..deepO$delegate.' type=T of . origin=null $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:deepO$delegate type:.additionalText$delegate..deepO$delegate..> visibility:private [final]' type=.additionalText$delegate..deepO$delegate..> origin=null - receiver: GET_VAR ': .additionalText$delegate..> declared in .additionalText$delegate..' type=.additionalText$delegate..> origin=null + receiver: TYPE_OP type=.additionalText$delegate. origin=IMPLICIT_CAST typeOperand=.additionalText$delegate. + GET_VAR ': .additionalText$delegate..> declared in .additionalText$delegate..' type=.additionalText$delegate..> origin=null t: GET_VAR ': .additionalText$delegate..> declared in .additionalText$delegate..' type=.additionalText$delegate..> origin=null p: PROPERTY_REFERENCE 'private final deepO: T of . [delegated,val]' field=null getter='public final fun (): T of . declared in .additionalText$delegate.' setter=null type=kotlin.reflect.KProperty2<.Value., .CR.>>, *, T of .> origin=PROPERTY_REFERENCE_FOR_DELEGATE PROPERTY name:deepK visibility:private modality:FINAL [delegated,val] @@ -325,7 +326,8 @@ FILE fqName: fileName:/genericDelegatedDeepProperty.kt RETURN type=kotlin.Nothing from='public final fun (): T of . declared in .additionalText$delegate.' CALL 'public final fun getValue (t: .Value., .CR.>>, p: kotlin.reflect.KProperty<*>): T of . [operator] declared in .additionalText$delegate..deepK$delegate.' type=T of . origin=null $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:deepK$delegate type:.additionalText$delegate..deepK$delegate..> visibility:private [final]' type=.additionalText$delegate..deepK$delegate..> origin=null - receiver: GET_VAR ': .additionalText$delegate..> declared in .additionalText$delegate..' type=.additionalText$delegate..> origin=null + receiver: TYPE_OP type=.additionalText$delegate. origin=IMPLICIT_CAST typeOperand=.additionalText$delegate. + GET_VAR ': .additionalText$delegate..> declared in .additionalText$delegate..' type=.additionalText$delegate..> origin=null t: GET_VAR ': .additionalText$delegate..> declared in .additionalText$delegate..' type=.additionalText$delegate..> origin=null p: PROPERTY_REFERENCE 'private final deepK: T of . [delegated,val]' field=null getter='public final fun (): T of . declared in .additionalText$delegate.' setter=null type=kotlin.reflect.KProperty2<.Value., .CR.>>, *, T of .> origin=PROPERTY_REFERENCE_FOR_DELEGATE FUN name:getValue visibility:public modality:FINAL <> ($this:.additionalText$delegate..>, t:.Value., .CR.>>, p:kotlin.reflect.KProperty<*>) returnType:.P., T of .> [operator] diff --git a/compiler/testData/ir/irText/types/genericPropertyReferenceType.fir.kt.txt b/compiler/testData/ir/irText/types/genericPropertyReferenceType.fir.kt.txt index 4a847278e99..22e24614d4c 100644 --- a/compiler/testData/ir/irText/types/genericPropertyReferenceType.fir.kt.txt +++ b/compiler/testData/ir/irText/types/genericPropertyReferenceType.fir.kt.txt @@ -17,7 +17,7 @@ var C.y: T return .() } set(v: T) { - .( = v) + /*as C */.( = v) } fun use(p: KMutableProperty) { diff --git a/compiler/testData/ir/irText/types/genericPropertyReferenceType.fir.txt b/compiler/testData/ir/irText/types/genericPropertyReferenceType.fir.txt index 7471e9924c6..1fbcb8c17b5 100644 --- a/compiler/testData/ir/irText/types/genericPropertyReferenceType.fir.txt +++ b/compiler/testData/ir/irText/types/genericPropertyReferenceType.fir.txt @@ -55,7 +55,8 @@ FILE fqName: fileName:/genericPropertyReferenceType.kt VALUE_PARAMETER name:v index:0 type:T of . BLOCK_BODY CALL 'public final fun (: T of .C): kotlin.Unit declared in .C' type=kotlin.Unit origin=EQ - $this: GET_VAR ': .C.> declared in .' type=.C.> origin=null + $this: TYPE_OP type=.C.> origin=IMPLICIT_CAST typeOperand=.C.> + GET_VAR ': .C.> declared in .' type=.C.> origin=null : GET_VAR 'v: T of . declared in .' type=T of . origin=null FUN name:use visibility:public modality:FINAL <> (p:kotlin.reflect.KMutableProperty) returnType:kotlin.Unit VALUE_PARAMETER name:p index:0 type:kotlin.reflect.KMutableProperty diff --git a/compiler/testData/ir/irText/types/localVariableOfIntersectionType_NI.fir.kt.txt b/compiler/testData/ir/irText/types/localVariableOfIntersectionType_NI.fir.kt.txt index b1cd9cd8e15..5adf3761bd6 100644 --- a/compiler/testData/ir/irText/types/localVariableOfIntersectionType_NI.fir.kt.txt +++ b/compiler/testData/ir/irText/types/localVariableOfIntersectionType_NI.fir.kt.txt @@ -25,8 +25,8 @@ interface IB { fun test(a: In, b: In, z: Z) { z.create(x = a, y = b).().foo() - z.create(x = a, y = b).().bar() + z.create(x = a, y = b).() /*as IB */.bar() val t: IA = z.create(x = a, y = b).() t.foo() - t.bar() + t /*as IB */.bar() } diff --git a/compiler/testData/ir/irText/types/localVariableOfIntersectionType_NI.fir.txt b/compiler/testData/ir/irText/types/localVariableOfIntersectionType_NI.fir.txt index c46e69a5cbb..b49be83326c 100644 --- a/compiler/testData/ir/irText/types/localVariableOfIntersectionType_NI.fir.txt +++ b/compiler/testData/ir/irText/types/localVariableOfIntersectionType_NI.fir.txt @@ -102,12 +102,13 @@ FILE fqName: fileName:/localVariableOfIntersectionType_NI.kt x: GET_VAR 'a: .In<.IA> declared in .test' type=.In<.IA> origin=null y: GET_VAR 'b: .In<.IB> declared in .test' type=.In<.IB> origin=null CALL 'public abstract fun bar (): kotlin.Unit declared in .IB' type=kotlin.Unit origin=null - $this: CALL 'public abstract fun (): T of .Inv declared in .Inv' type=.IA origin=GET_PROPERTY - $this: CALL 'public abstract fun create (x: .In.Z.create>, y: .In.Z.create>): .Inv.Z.create> declared in .Z' type=.Inv<.IA> origin=null - : .IA - $this: GET_VAR 'z: .Z declared in .test' type=.Z origin=null - x: GET_VAR 'a: .In<.IA> declared in .test' type=.In<.IA> origin=null - y: GET_VAR 'b: .In<.IB> declared in .test' type=.In<.IB> origin=null + $this: TYPE_OP type=.IB origin=IMPLICIT_CAST typeOperand=.IB + CALL 'public abstract fun (): T of .Inv declared in .Inv' type=.IA origin=GET_PROPERTY + $this: CALL 'public abstract fun create (x: .In.Z.create>, y: .In.Z.create>): .Inv.Z.create> declared in .Z' type=.Inv<.IA> origin=null + : .IA + $this: GET_VAR 'z: .Z declared in .test' type=.Z origin=null + x: GET_VAR 'a: .In<.IA> declared in .test' type=.In<.IA> origin=null + y: GET_VAR 'b: .In<.IB> declared in .test' type=.In<.IB> origin=null VAR name:t type:.IA [val] CALL 'public abstract fun (): T of .Inv declared in .Inv' type=.IA origin=GET_PROPERTY $this: CALL 'public abstract fun create (x: .In.Z.create>, y: .In.Z.create>): .Inv.Z.create> declared in .Z' type=.Inv<.IA> origin=null @@ -118,4 +119,5 @@ FILE fqName: fileName:/localVariableOfIntersectionType_NI.kt CALL 'public abstract fun foo (): kotlin.Unit declared in .IA' type=kotlin.Unit origin=null $this: GET_VAR 'val t: .IA [val] declared in .test' type=.IA origin=null CALL 'public abstract fun bar (): kotlin.Unit declared in .IB' type=kotlin.Unit origin=null - $this: GET_VAR 'val t: .IA [val] declared in .test' type=.IA origin=null + $this: TYPE_OP type=.IB origin=IMPLICIT_CAST typeOperand=.IB + GET_VAR 'val t: .IA [val] declared in .test' type=.IA origin=null diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index 50d4043833c..ffb1a202405 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -35094,6 +35094,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/smartCasts"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test + @TestMetadata("complexExplicitReceiver.kt") + public void testComplexExplicitReceiver() throws Exception { + runTest("compiler/testData/codegen/box/smartCasts/complexExplicitReceiver.kt"); + } + @Test @TestMetadata("complexImplicitReceiver.kt") public void testComplexImplicitReceiver() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index b49c31ba0e2..b3d0bb8aa11 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -34894,6 +34894,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/smartCasts"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test + @TestMetadata("complexExplicitReceiver.kt") + public void testComplexExplicitReceiver() throws Exception { + runTest("compiler/testData/codegen/box/smartCasts/complexExplicitReceiver.kt"); + } + @Test @TestMetadata("complexImplicitReceiver.kt") public void testComplexImplicitReceiver() throws Exception { diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 471512c6f8d..25047ce0e46 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -28666,6 +28666,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/smartCasts"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @TestMetadata("complexExplicitReceiver.kt") + public void testComplexExplicitReceiver() throws Exception { + runTest("compiler/testData/codegen/box/smartCasts/complexExplicitReceiver.kt"); + } + @TestMetadata("complexImplicitReceiver.kt") public void testComplexImplicitReceiver() throws Exception { runTest("compiler/testData/codegen/box/smartCasts/complexImplicitReceiver.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java index 142c74c6815..ae6239cde17 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java @@ -24792,6 +24792,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/smartCasts"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); } + @TestMetadata("complexExplicitReceiver.kt") + public void testComplexExplicitReceiver() throws Exception { + runTest("compiler/testData/codegen/box/smartCasts/complexExplicitReceiver.kt"); + } + @TestMetadata("complexImplicitReceiver.kt") public void testComplexImplicitReceiver() throws Exception { runTest("compiler/testData/codegen/box/smartCasts/complexImplicitReceiver.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java index 71a0780d19b..b398829a8ee 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java @@ -24792,6 +24792,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/smartCasts"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); } + @TestMetadata("complexExplicitReceiver.kt") + public void testComplexExplicitReceiver() throws Exception { + runTest("compiler/testData/codegen/box/smartCasts/complexExplicitReceiver.kt"); + } + @TestMetadata("complexImplicitReceiver.kt") public void testComplexImplicitReceiver() throws Exception { runTest("compiler/testData/codegen/box/smartCasts/complexImplicitReceiver.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index b804a2cbcc4..3c9ac4b9149 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -24757,6 +24757,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/smartCasts"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true); } + @TestMetadata("complexExplicitReceiver.kt") + public void testComplexExplicitReceiver() throws Exception { + runTest("compiler/testData/codegen/box/smartCasts/complexExplicitReceiver.kt"); + } + @TestMetadata("complexImplicitReceiver.kt") public void testComplexImplicitReceiver() throws Exception { runTest("compiler/testData/codegen/box/smartCasts/complexImplicitReceiver.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java index e991db16c9f..8862d4fd405 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java @@ -13261,6 +13261,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/smartCasts"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true); } + @TestMetadata("complexExplicitReceiver.kt") + public void testComplexExplicitReceiver() throws Exception { + runTest("compiler/testData/codegen/box/smartCasts/complexExplicitReceiver.kt"); + } + @TestMetadata("complexImplicitReceiver.kt") public void testComplexImplicitReceiver() throws Exception { runTest("compiler/testData/codegen/box/smartCasts/complexImplicitReceiver.kt"); From 1e0d9f4075f77e220c6861e8fb83a586275f5119 Mon Sep 17 00:00:00 2001 From: "Denis.Zharkov" Date: Thu, 28 Jan 2021 16:38:41 +0300 Subject: [PATCH 160/212] FIR2IR: Do not add implicit casts for types with different nullability For smart casts, elvises, etc., there are no implicit casts in psi2fir in changed test data --- .../fir/backend/Fir2IrImplicitCastInserter.kt | 4 +- .../localDelegatedProperties.fir.kt.txt | 4 +- .../localDelegatedProperties.fir.txt | 6 +- .../ir/irText/expressions/bangbang.fir.kt.txt | 2 +- .../ir/irText/expressions/bangbang.fir.txt | 3 +- .../breakContinueInLoopHeader.fir.kt.txt | 8 +- .../breakContinueInLoopHeader.fir.txt | 12 +-- .../expressions/chainOfSafeCalls.kt.txt | 8 +- .../irText/expressions/chainOfSafeCalls.txt | 12 +-- .../expressions/coercionToUnit.fir.kt.txt | 4 +- .../irText/expressions/coercionToUnit.fir.txt | 6 +- .../ir/irText/expressions/dotQualified.kt.txt | 2 +- .../ir/irText/expressions/dotQualified.txt | 3 +- .../ir/irText/expressions/elvis.fir.kt.txt | 10 +-- .../ir/irText/expressions/elvis.fir.txt | 15 ++-- .../implicitCastToNonNull.fir.kt.txt | 33 -------- .../expressions/implicitCastToNonNull.fir.txt | 76 ------------------- .../expressions/implicitCastToNonNull.kt | 1 + .../ir/irText/expressions/kt30020.fir.kt.txt | 4 +- .../ir/irText/expressions/kt30020.fir.txt | 6 +- .../expressions/safeAssignment.fir.kt.txt | 2 +- .../irText/expressions/safeAssignment.fir.txt | 3 +- .../safeCallWithIncrementDecrement.fir.kt.txt | 8 +- .../safeCallWithIncrementDecrement.fir.txt | 12 +-- .../irText/expressions/safeCalls.fir.kt.txt | 10 +-- .../ir/irText/expressions/safeCalls.fir.txt | 15 ++-- ...temporaryInEnumEntryInitializer.fir.kt.txt | 2 +- .../temporaryInEnumEntryInitializer.fir.txt | 3 +- .../expressions/temporaryInInitBlock.kt.txt | 2 +- .../expressions/temporaryInInitBlock.txt | 3 +- .../variableAsFunctionCall.fir.kt.txt | 4 +- .../variableAsFunctionCall.fir.txt | 6 +- .../ir/irText/expressions/when.fir.kt.txt | 6 +- .../ir/irText/expressions/when.fir.txt | 9 +-- .../ClashResolutionDescriptor.fir.kt.txt | 2 +- .../ClashResolutionDescriptor.fir.txt | 3 +- .../ImplicitReceiverStack.fir.kt.txt | 2 +- .../firProblems/ImplicitReceiverStack.fir.txt | 3 +- .../coercionToUnitForNestedWhen.fir.kt.txt | 10 +-- .../coercionToUnitForNestedWhen.fir.txt | 15 ++-- .../inapplicableCollectionSet.fir.kt.txt | 4 +- .../inapplicableCollectionSet.fir.txt | 6 +- .../firProblems/readWriteProperty.fir.kt.txt | 4 +- .../firProblems/readWriteProperty.fir.txt | 6 +- .../castsInsideCoroutineInference.fir.kt.txt | 5 +- .../castsInsideCoroutineInference.fir.txt | 6 +- 46 files changed, 106 insertions(+), 264 deletions(-) delete mode 100644 compiler/testData/ir/irText/expressions/implicitCastToNonNull.fir.kt.txt delete mode 100644 compiler/testData/ir/irText/expressions/implicitCastToNonNull.fir.txt diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrImplicitCastInserter.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrImplicitCastInserter.kt index 4c68686a54a..f72e42869ea 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrImplicitCastInserter.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrImplicitCastInserter.kt @@ -24,6 +24,7 @@ import org.jetbrains.kotlin.ir.IrElement import org.jetbrains.kotlin.ir.expressions.* import org.jetbrains.kotlin.ir.expressions.impl.IrTypeOperatorCallImpl import org.jetbrains.kotlin.ir.types.IrType +import org.jetbrains.kotlin.ir.types.makeNotNull import org.jetbrains.kotlin.ir.types.removeAnnotations import org.jetbrains.kotlin.ir.types.withHasQuestionMark import org.jetbrains.kotlin.ir.util.classId @@ -314,7 +315,8 @@ class Fir2IrImplicitCastInserter( } internal fun implicitCastOrExpression(original: IrExpression, castType: IrType): IrExpression { - return original.takeIf { it.type == castType } ?: implicitCast(original, castType) + if (original.type.makeNotNull() == castType.makeNotNull()) return original + return implicitCast(original, castType) } private fun implicitCast(original: IrExpression, castType: IrType): IrExpression { diff --git a/compiler/testData/ir/irText/declarations/localDelegatedProperties.fir.kt.txt b/compiler/testData/ir/irText/declarations/localDelegatedProperties.fir.kt.txt index bb38bedafe8..cda338ab4fd 100644 --- a/compiler/testData/ir/irText/declarations/localDelegatedProperties.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/localDelegatedProperties.fir.kt.txt @@ -22,8 +22,8 @@ fun test2() { } ( = 0) - val : Int = () /*as Int */ + val : Int = () ( = .inc()) /*~> Unit */ - ( = () /*as Int */.plus(other = 1)) + ( = ().plus(other = 1)) } diff --git a/compiler/testData/ir/irText/declarations/localDelegatedProperties.fir.txt b/compiler/testData/ir/irText/declarations/localDelegatedProperties.fir.txt index 31ba7b5da0f..4bead69ab4c 100644 --- a/compiler/testData/ir/irText/declarations/localDelegatedProperties.fir.txt +++ b/compiler/testData/ir/irText/declarations/localDelegatedProperties.fir.txt @@ -48,8 +48,7 @@ FILE fqName: fileName:/localDelegatedProperties.kt CALL 'local final fun (: kotlin.Int?): kotlin.Unit declared in .test2' type=kotlin.Unit origin=EQ : CONST Int type=kotlin.Int value=0 VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Int [val] - TYPE_OP type=kotlin.Int origin=IMPLICIT_CAST typeOperand=kotlin.Int - CALL 'local final fun (): kotlin.Int? declared in .test2' type=kotlin.Int? origin=GET_LOCAL_PROPERTY + CALL 'local final fun (): kotlin.Int? declared in .test2' type=kotlin.Int? origin=GET_LOCAL_PROPERTY CALL 'local final fun (: kotlin.Int?): kotlin.Unit declared in .test2' type=kotlin.Unit origin=EQ : CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: GET_VAR 'val tmp_0: kotlin.Int [val] declared in .test2' type=kotlin.Int origin=null @@ -57,6 +56,5 @@ FILE fqName: fileName:/localDelegatedProperties.kt GET_VAR 'val tmp_0: kotlin.Int [val] declared in .test2' type=kotlin.Int origin=null CALL 'local final fun (: kotlin.Int?): kotlin.Unit declared in .test2' type=kotlin.Unit origin=EQ : CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: TYPE_OP type=kotlin.Int origin=IMPLICIT_CAST typeOperand=kotlin.Int - CALL 'local final fun (): kotlin.Int? declared in .test2' type=kotlin.Int? origin=GET_LOCAL_PROPERTY + $this: CALL 'local final fun (): kotlin.Int? declared in .test2' type=kotlin.Int? origin=GET_LOCAL_PROPERTY other: CONST Int type=kotlin.Int value=1 diff --git a/compiler/testData/ir/irText/expressions/bangbang.fir.kt.txt b/compiler/testData/ir/irText/expressions/bangbang.fir.kt.txt index d217c5919f6..dd8140cc05f 100644 --- a/compiler/testData/ir/irText/expressions/bangbang.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/bangbang.fir.kt.txt @@ -7,7 +7,7 @@ fun test2(a: Any?): Int { val tmp0_safe_receiver: Any? = a when { EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null - else -> tmp0_safe_receiver /*as Any */.hashCode() + else -> tmp0_safe_receiver.hashCode() } }) } diff --git a/compiler/testData/ir/irText/expressions/bangbang.fir.txt b/compiler/testData/ir/irText/expressions/bangbang.fir.txt index dc9d1daf00b..cca5d161680 100644 --- a/compiler/testData/ir/irText/expressions/bangbang.fir.txt +++ b/compiler/testData/ir/irText/expressions/bangbang.fir.txt @@ -24,8 +24,7 @@ FILE fqName: fileName:/bangbang.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null - $this: TYPE_OP type=kotlin.Any origin=IMPLICIT_CAST typeOperand=kotlin.Any - GET_VAR 'val tmp_0: kotlin.Any? [val] declared in .test2' type=kotlin.Any? origin=null + $this: GET_VAR 'val tmp_0: kotlin.Any? [val] declared in .test2' type=kotlin.Any? origin=null FUN name:test3 visibility:public modality:FINAL (a:X of .test3) returnType:X of .test3 TYPE_PARAMETER name:X index:0 variance: superTypes:[kotlin.Any?] VALUE_PARAMETER name:a index:0 type:X of .test3 diff --git a/compiler/testData/ir/irText/expressions/breakContinueInLoopHeader.fir.kt.txt b/compiler/testData/ir/irText/expressions/breakContinueInLoopHeader.fir.kt.txt index 88576c0eed8..f9ed0b8f326 100644 --- a/compiler/testData/ir/irText/expressions/breakContinueInLoopHeader.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/breakContinueInLoopHeader.fir.kt.txt @@ -4,7 +4,7 @@ fun test1(c: Boolean?) { val : Boolean? = c when { EQEQ(arg0 = , arg1 = null) -> break@L - else -> /*as Boolean */ + else -> } }) { // BLOCK } @@ -17,7 +17,7 @@ fun test2(c: Boolean?) { val : Boolean? = c when { EQEQ(arg0 = , arg1 = null) -> continue@L - else -> /*as Boolean */ + else -> } }) { // BLOCK } @@ -31,7 +31,7 @@ fun test3(ss: List?) { val : List? = ss when { EQEQ(arg0 = , arg1 = null) -> continue@L - else -> /*as List */ + else -> } }.iterator() L2@ while (.hasNext()) { // BLOCK @@ -48,7 +48,7 @@ fun test4(ss: List?) { val : List? = ss when { EQEQ(arg0 = , arg1 = null) -> break@L - else -> /*as List */ + else -> } }.iterator() L2@ while (.hasNext()) { // BLOCK diff --git a/compiler/testData/ir/irText/expressions/breakContinueInLoopHeader.fir.txt b/compiler/testData/ir/irText/expressions/breakContinueInLoopHeader.fir.txt index 60b54f615b5..781d8f74a98 100644 --- a/compiler/testData/ir/irText/expressions/breakContinueInLoopHeader.fir.txt +++ b/compiler/testData/ir/irText/expressions/breakContinueInLoopHeader.fir.txt @@ -17,8 +17,7 @@ FILE fqName: fileName:/breakContinueInLoopHeader.kt then: BREAK label=L loop.label=L BRANCH if: CONST Boolean type=kotlin.Boolean value=true - then: TYPE_OP type=kotlin.Boolean origin=IMPLICIT_CAST typeOperand=kotlin.Boolean - GET_VAR 'val tmp_0: kotlin.Boolean? [val] declared in .test1' type=kotlin.Boolean? origin=null + then: GET_VAR 'val tmp_0: kotlin.Boolean? [val] declared in .test1' type=kotlin.Boolean? origin=null body: BLOCK type=kotlin.Unit origin=null FUN name:test2 visibility:public modality:FINAL <> (c:kotlin.Boolean?) returnType:kotlin.Unit VALUE_PARAMETER name:c index:0 type:kotlin.Boolean? @@ -38,8 +37,7 @@ FILE fqName: fileName:/breakContinueInLoopHeader.kt then: CONTINUE label=L loop.label=L BRANCH if: CONST Boolean type=kotlin.Boolean value=true - then: TYPE_OP type=kotlin.Boolean origin=IMPLICIT_CAST typeOperand=kotlin.Boolean - GET_VAR 'val tmp_1: kotlin.Boolean? [val] declared in .test2' type=kotlin.Boolean? origin=null + then: GET_VAR 'val tmp_1: kotlin.Boolean? [val] declared in .test2' type=kotlin.Boolean? origin=null body: BLOCK type=kotlin.Unit origin=null FUN name:test3 visibility:public modality:FINAL <> (ss:kotlin.collections.List?) returnType:kotlin.Unit VALUE_PARAMETER name:ss index:0 type:kotlin.collections.List? @@ -61,8 +59,7 @@ FILE fqName: fileName:/breakContinueInLoopHeader.kt then: CONTINUE label=L loop.label=L BRANCH if: CONST Boolean type=kotlin.Boolean value=true - then: TYPE_OP type=kotlin.collections.List origin=IMPLICIT_CAST typeOperand=kotlin.collections.List - GET_VAR 'val tmp_3: kotlin.collections.List? [val] declared in .test3' type=kotlin.collections.List? origin=null + then: GET_VAR 'val tmp_3: kotlin.collections.List? [val] declared in .test3' type=kotlin.collections.List? origin=null WHILE label=L2 origin=FOR_LOOP_INNER_WHILE condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT $this: GET_VAR 'val tmp_2: kotlin.collections.Iterator [val] declared in .test3' type=kotlin.collections.Iterator origin=null @@ -90,8 +87,7 @@ FILE fqName: fileName:/breakContinueInLoopHeader.kt then: BREAK label=L loop.label=L BRANCH if: CONST Boolean type=kotlin.Boolean value=true - then: TYPE_OP type=kotlin.collections.List origin=IMPLICIT_CAST typeOperand=kotlin.collections.List - GET_VAR 'val tmp_5: kotlin.collections.List? [val] declared in .test4' type=kotlin.collections.List? origin=null + then: GET_VAR 'val tmp_5: kotlin.collections.List? [val] declared in .test4' type=kotlin.collections.List? origin=null WHILE label=L2 origin=FOR_LOOP_INNER_WHILE condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT $this: GET_VAR 'val tmp_4: kotlin.collections.Iterator [val] declared in .test4' type=kotlin.collections.Iterator origin=null diff --git a/compiler/testData/ir/irText/expressions/chainOfSafeCalls.kt.txt b/compiler/testData/ir/irText/expressions/chainOfSafeCalls.kt.txt index 24b10edc3dd..3d536fba7ee 100644 --- a/compiler/testData/ir/irText/expressions/chainOfSafeCalls.kt.txt +++ b/compiler/testData/ir/irText/expressions/chainOfSafeCalls.kt.txt @@ -23,22 +23,22 @@ fun test(nc: C?): C? { val tmp0_safe_receiver: C? = nc when { EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null - else -> tmp0_safe_receiver /*as C */.foo() + else -> tmp0_safe_receiver.foo() } } when { EQEQ(arg0 = tmp1_safe_receiver, arg1 = null) -> null - else -> tmp1_safe_receiver /*as C */.bar() + else -> tmp1_safe_receiver.bar() } } when { EQEQ(arg0 = tmp2_safe_receiver, arg1 = null) -> null - else -> tmp2_safe_receiver /*as C */.foo() + else -> tmp2_safe_receiver.foo() } } when { EQEQ(arg0 = tmp3_safe_receiver, arg1 = null) -> null - else -> tmp3_safe_receiver /*as C */.foo() + else -> tmp3_safe_receiver.foo() } } } diff --git a/compiler/testData/ir/irText/expressions/chainOfSafeCalls.txt b/compiler/testData/ir/irText/expressions/chainOfSafeCalls.txt index 461a12bf19f..ed8e621b69d 100644 --- a/compiler/testData/ir/irText/expressions/chainOfSafeCalls.txt +++ b/compiler/testData/ir/irText/expressions/chainOfSafeCalls.txt @@ -50,8 +50,7 @@ FILE fqName: fileName:/chainOfSafeCalls.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public final fun foo (): .C declared in .C' type=.C origin=null - $this: TYPE_OP type=.C origin=IMPLICIT_CAST typeOperand=.C - GET_VAR 'val tmp_3: .C? [val] declared in .test' type=.C? origin=null + $this: GET_VAR 'val tmp_3: .C? [val] declared in .test' type=.C? origin=null WHEN type=.C? origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ @@ -61,8 +60,7 @@ FILE fqName: fileName:/chainOfSafeCalls.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public final fun bar (): .C? declared in .C' type=.C? origin=null - $this: TYPE_OP type=.C origin=IMPLICIT_CAST typeOperand=.C - GET_VAR 'val tmp_2: .C? [val] declared in .test' type=.C? origin=null + $this: GET_VAR 'val tmp_2: .C? [val] declared in .test' type=.C? origin=null WHEN type=.C? origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ @@ -72,8 +70,7 @@ FILE fqName: fileName:/chainOfSafeCalls.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public final fun foo (): .C declared in .C' type=.C origin=null - $this: TYPE_OP type=.C origin=IMPLICIT_CAST typeOperand=.C - GET_VAR 'val tmp_1: .C? [val] declared in .test' type=.C? origin=null + $this: GET_VAR 'val tmp_1: .C? [val] declared in .test' type=.C? origin=null WHEN type=.C? origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ @@ -83,5 +80,4 @@ FILE fqName: fileName:/chainOfSafeCalls.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public final fun foo (): .C declared in .C' type=.C origin=null - $this: TYPE_OP type=.C origin=IMPLICIT_CAST typeOperand=.C - GET_VAR 'val tmp_0: .C? [val] declared in .test' type=.C? origin=null + $this: GET_VAR 'val tmp_0: .C? [val] declared in .test' type=.C? origin=null diff --git a/compiler/testData/ir/irText/expressions/coercionToUnit.fir.kt.txt b/compiler/testData/ir/irText/expressions/coercionToUnit.fir.kt.txt index 4f3d8236800..2d878235e87 100644 --- a/compiler/testData/ir/irText/expressions/coercionToUnit.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/coercionToUnit.fir.kt.txt @@ -14,14 +14,14 @@ fun test3() { val tmp0_safe_receiver: PrintStream? = #out when { EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null - else -> tmp0_safe_receiver /*as @FlexibleNullability PrintStream */.println(p0 = "Hello,") + else -> tmp0_safe_receiver.println(p0 = "Hello,") } } /*~> Unit */ { // BLOCK val tmp1_safe_receiver: PrintStream? = #out when { EQEQ(arg0 = tmp1_safe_receiver, arg1 = null) -> null - else -> tmp1_safe_receiver /*as @FlexibleNullability PrintStream */.println(p0 = "world!") + else -> tmp1_safe_receiver.println(p0 = "world!") } } /*~> Unit */ } diff --git a/compiler/testData/ir/irText/expressions/coercionToUnit.fir.txt b/compiler/testData/ir/irText/expressions/coercionToUnit.fir.txt index f96009bc4cc..18e3854f53c 100644 --- a/compiler/testData/ir/irText/expressions/coercionToUnit.fir.txt +++ b/compiler/testData/ir/irText/expressions/coercionToUnit.fir.txt @@ -34,8 +34,7 @@ FILE fqName: fileName:/coercionToUnit.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public open fun println (p0: kotlin.String?): kotlin.Unit declared in java.io.PrintStream' type=kotlin.Unit origin=null - $this: TYPE_OP type=@[FlexibleNullability] java.io.PrintStream origin=IMPLICIT_CAST typeOperand=@[FlexibleNullability] java.io.PrintStream - GET_VAR 'val tmp_0: java.io.PrintStream? [val] declared in .test3' type=java.io.PrintStream? origin=null + $this: GET_VAR 'val tmp_0: java.io.PrintStream? [val] declared in .test3' type=java.io.PrintStream? origin=null p0: CONST String type=kotlin.String value="Hello," TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit BLOCK type=kotlin.Unit? origin=SAFE_CALL @@ -50,6 +49,5 @@ FILE fqName: fileName:/coercionToUnit.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public open fun println (p0: kotlin.String?): kotlin.Unit declared in java.io.PrintStream' type=kotlin.Unit origin=null - $this: TYPE_OP type=@[FlexibleNullability] java.io.PrintStream origin=IMPLICIT_CAST typeOperand=@[FlexibleNullability] java.io.PrintStream - GET_VAR 'val tmp_1: java.io.PrintStream? [val] declared in .test3' type=java.io.PrintStream? origin=null + $this: GET_VAR 'val tmp_1: java.io.PrintStream? [val] declared in .test3' type=java.io.PrintStream? origin=null p0: CONST String type=kotlin.String value="world!" diff --git a/compiler/testData/ir/irText/expressions/dotQualified.kt.txt b/compiler/testData/ir/irText/expressions/dotQualified.kt.txt index 550df1664ee..c51eec9e70b 100644 --- a/compiler/testData/ir/irText/expressions/dotQualified.kt.txt +++ b/compiler/testData/ir/irText/expressions/dotQualified.kt.txt @@ -7,7 +7,7 @@ fun lengthN(s: String?): Int? { val tmp0_safe_receiver: String? = s when { EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null - else -> tmp0_safe_receiver /*as String */.() + else -> tmp0_safe_receiver.() } } } diff --git a/compiler/testData/ir/irText/expressions/dotQualified.txt b/compiler/testData/ir/irText/expressions/dotQualified.txt index f33bb88ffcd..7d730a47d3b 100644 --- a/compiler/testData/ir/irText/expressions/dotQualified.txt +++ b/compiler/testData/ir/irText/expressions/dotQualified.txt @@ -21,5 +21,4 @@ FILE fqName: fileName:/dotQualified.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public open fun (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=GET_PROPERTY - $this: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String - GET_VAR 'val tmp_0: kotlin.String? [val] declared in .lengthN' type=kotlin.String? origin=null + $this: GET_VAR 'val tmp_0: kotlin.String? [val] declared in .lengthN' type=kotlin.String? origin=null diff --git a/compiler/testData/ir/irText/expressions/elvis.fir.kt.txt b/compiler/testData/ir/irText/expressions/elvis.fir.kt.txt index 0ec550b8a10..d0e3af4f105 100644 --- a/compiler/testData/ir/irText/expressions/elvis.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/elvis.fir.kt.txt @@ -11,7 +11,7 @@ fun test1(a: Any?, b: Any): Any { val : Any? = a when { EQEQ(arg0 = , arg1 = null) -> b - else -> /*as Any */ + else -> } } } @@ -21,7 +21,7 @@ fun test2(a: String?, b: Any): Any { val : String? = a when { EQEQ(arg0 = , arg1 = null) -> b - else -> /*as String */ + else -> } } } @@ -37,7 +37,7 @@ fun test3(a: Any?, b: Any?): String { val : String? = a /*as String? */ when { EQEQ(arg0 = , arg1 = null) -> b /*as String */ - else -> /*as String */ + else -> } } } @@ -47,7 +47,7 @@ fun test4(x: Any): Any { val : Any? = () when { EQEQ(arg0 = , arg1 = null) -> x - else -> /*as Any */ + else -> } } } @@ -57,7 +57,7 @@ fun test5(x: Any): Any { val : Any? = foo() when { EQEQ(arg0 = , arg1 = null) -> x - else -> /*as Any */ + else -> } } } diff --git a/compiler/testData/ir/irText/expressions/elvis.fir.txt b/compiler/testData/ir/irText/expressions/elvis.fir.txt index 459ce80ec76..2b4064a2fc2 100644 --- a/compiler/testData/ir/irText/expressions/elvis.fir.txt +++ b/compiler/testData/ir/irText/expressions/elvis.fir.txt @@ -28,8 +28,7 @@ FILE fqName: fileName:/elvis.kt then: GET_VAR 'b: kotlin.Any declared in .test1' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true - then: TYPE_OP type=kotlin.Any origin=IMPLICIT_CAST typeOperand=kotlin.Any - GET_VAR 'val tmp_0: kotlin.Any? [val] declared in .test1' type=kotlin.Any? origin=null + then: GET_VAR 'val tmp_0: kotlin.Any? [val] declared in .test1' type=kotlin.Any? origin=null FUN name:test2 visibility:public modality:FINAL <> (a:kotlin.String?, b:kotlin.Any) returnType:kotlin.Any VALUE_PARAMETER name:a index:0 type:kotlin.String? VALUE_PARAMETER name:b index:1 type:kotlin.Any @@ -46,8 +45,7 @@ FILE fqName: fileName:/elvis.kt then: GET_VAR 'b: kotlin.Any declared in .test2' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true - then: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String - GET_VAR 'val tmp_1: kotlin.String? [val] declared in .test2' type=kotlin.String? origin=null + then: GET_VAR 'val tmp_1: kotlin.String? [val] declared in .test2' type=kotlin.String? origin=null FUN name:test3 visibility:public modality:FINAL <> (a:kotlin.Any?, b:kotlin.Any?) returnType:kotlin.String VALUE_PARAMETER name:a index:0 type:kotlin.Any? VALUE_PARAMETER name:b index:1 type:kotlin.Any? @@ -78,8 +76,7 @@ FILE fqName: fileName:/elvis.kt GET_VAR 'b: kotlin.Any? declared in .test3' type=kotlin.Any? origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true - then: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String - GET_VAR 'val tmp_2: kotlin.String? [val] declared in .test3' type=kotlin.String? origin=null + then: GET_VAR 'val tmp_2: kotlin.String? [val] declared in .test3' type=kotlin.String? origin=null FUN name:test4 visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Any VALUE_PARAMETER name:x index:0 type:kotlin.Any BLOCK_BODY @@ -95,8 +92,7 @@ FILE fqName: fileName:/elvis.kt then: GET_VAR 'x: kotlin.Any declared in .test4' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true - then: TYPE_OP type=kotlin.Any origin=IMPLICIT_CAST typeOperand=kotlin.Any - GET_VAR 'val tmp_3: kotlin.Any? [val] declared in .test4' type=kotlin.Any? origin=null + then: GET_VAR 'val tmp_3: kotlin.Any? [val] declared in .test4' type=kotlin.Any? origin=null FUN name:test5 visibility:public modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Any VALUE_PARAMETER name:x index:0 type:kotlin.Any BLOCK_BODY @@ -112,5 +108,4 @@ FILE fqName: fileName:/elvis.kt then: GET_VAR 'x: kotlin.Any declared in .test5' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true - then: TYPE_OP type=kotlin.Any origin=IMPLICIT_CAST typeOperand=kotlin.Any - GET_VAR 'val tmp_4: kotlin.Any? [val] declared in .test5' type=kotlin.Any? origin=null + then: GET_VAR 'val tmp_4: kotlin.Any? [val] declared in .test5' type=kotlin.Any? origin=null diff --git a/compiler/testData/ir/irText/expressions/implicitCastToNonNull.fir.kt.txt b/compiler/testData/ir/irText/expressions/implicitCastToNonNull.fir.kt.txt deleted file mode 100644 index f1ea7098be2..00000000000 --- a/compiler/testData/ir/irText/expressions/implicitCastToNonNull.fir.kt.txt +++ /dev/null @@ -1,33 +0,0 @@ -fun test1(x: String?): Int { - return when { - EQEQ(arg0 = x, arg1 = null) -> 0 - else -> x /*as String */.() - } -} - -fun test2(x: T): Int { - return when { - EQEQ(arg0 = x, arg1 = null) -> 0 - else -> x.() - } -} - -inline fun test3(x: Any): Int { - return when { - x !is T -> 0 - else -> x /*as T */.() - } -} - -inline fun test4(x: Any?): Int { - return when { - x !is T -> 0 - else -> x /*as T */.() - } -} - -fun test5(x: T, fn: Function1) { - when { - EQEQ(arg0 = x, arg1 = null).not() -> fn.invoke(p1 = x) - } -} diff --git a/compiler/testData/ir/irText/expressions/implicitCastToNonNull.fir.txt b/compiler/testData/ir/irText/expressions/implicitCastToNonNull.fir.txt deleted file mode 100644 index b4218fcc45c..00000000000 --- a/compiler/testData/ir/irText/expressions/implicitCastToNonNull.fir.txt +++ /dev/null @@ -1,76 +0,0 @@ -FILE fqName: fileName:/implicitCastToNonNull.kt - FUN name:test1 visibility:public modality:FINAL <> (x:kotlin.String?) returnType:kotlin.Int - VALUE_PARAMETER name:x index:0 type:kotlin.String? - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test1 (x: kotlin.String?): kotlin.Int declared in ' - WHEN type=kotlin.Int origin=IF - BRANCH - if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'x: kotlin.String? declared in .test1' type=kotlin.String? origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public open fun (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=GET_PROPERTY - $this: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String - GET_VAR 'x: kotlin.String? declared in .test1' type=kotlin.String? origin=null - FUN name:test2 visibility:public modality:FINAL (x:T of .test2) returnType:kotlin.Int - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.CharSequence?] - VALUE_PARAMETER name:x index:0 type:T of .test2 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test2 (x: T of .test2): kotlin.Int declared in ' - WHEN type=kotlin.Int origin=IF - BRANCH - if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'x: T of .test2 declared in .test2' type=T of .test2 origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public abstract fun (): kotlin.Int declared in kotlin.CharSequence' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR 'x: T of .test2 declared in .test2' type=T of .test2 origin=null - FUN name:test3 visibility:public modality:FINAL (x:kotlin.Any) returnType:kotlin.Int [inline] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.CharSequence?] - VALUE_PARAMETER name:x index:0 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test3 (x: kotlin.Any): kotlin.Int [inline] declared in ' - WHEN type=kotlin.Int origin=IF - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=T of .test3 - GET_VAR 'x: kotlin.Any declared in .test3' type=kotlin.Any origin=null - then: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public abstract fun (): kotlin.Int declared in kotlin.CharSequence' type=kotlin.Int origin=GET_PROPERTY - $this: TYPE_OP type=T of .test3 origin=IMPLICIT_CAST typeOperand=T of .test3 - GET_VAR 'x: kotlin.Any declared in .test3' type=kotlin.Any origin=null - FUN name:test4 visibility:public modality:FINAL (x:kotlin.Any?) returnType:kotlin.Int [inline] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.CharSequence] - VALUE_PARAMETER name:x index:0 type:kotlin.Any? - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test4 (x: kotlin.Any?): kotlin.Int [inline] declared in ' - WHEN type=kotlin.Int origin=IF - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=T of .test4 - GET_VAR 'x: kotlin.Any? declared in .test4' type=kotlin.Any? origin=null - then: CONST Int type=kotlin.Int value=0 - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public abstract fun (): kotlin.Int declared in kotlin.CharSequence' type=kotlin.Int origin=GET_PROPERTY - $this: TYPE_OP type=T of .test4 origin=IMPLICIT_CAST typeOperand=T of .test4 - GET_VAR 'x: kotlin.Any? declared in .test4' type=kotlin.Any? origin=null - FUN name:test5 visibility:public modality:FINAL (x:T of .test5, fn:kotlin.Function1.test5, kotlin.Unit>) returnType:kotlin.Unit - TYPE_PARAMETER name:T index:0 variance: superTypes:[S of .test5?] - TYPE_PARAMETER name:S index:1 variance: superTypes:[kotlin.Any?] - VALUE_PARAMETER name:x index:0 type:T of .test5 - VALUE_PARAMETER name:fn index:1 type:kotlin.Function1.test5, kotlin.Unit> - BLOCK_BODY - WHEN type=kotlin.Unit origin=IF - BRANCH - if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ - $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ - arg0: GET_VAR 'x: T of .test5 declared in .test5' type=T of .test5 origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CALL 'public abstract fun invoke (p1: P1 of kotlin.Function1): R of kotlin.Function1 [operator] declared in kotlin.Function1' type=kotlin.Unit origin=INVOKE - $this: GET_VAR 'fn: kotlin.Function1.test5, kotlin.Unit> declared in .test5' type=kotlin.Function1.test5, kotlin.Unit> origin=VARIABLE_AS_FUNCTION - p1: GET_VAR 'x: T of .test5 declared in .test5' type=T of .test5 origin=null diff --git a/compiler/testData/ir/irText/expressions/implicitCastToNonNull.kt b/compiler/testData/ir/irText/expressions/implicitCastToNonNull.kt index fa482951574..1e8ea10a291 100644 --- a/compiler/testData/ir/irText/expressions/implicitCastToNonNull.kt +++ b/compiler/testData/ir/irText/expressions/implicitCastToNonNull.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun test1(x: String?) = if (x == null) 0 else x.length diff --git a/compiler/testData/ir/irText/expressions/kt30020.fir.kt.txt b/compiler/testData/ir/irText/expressions/kt30020.fir.kt.txt index 5cfdce35f5a..fd3b77edb9d 100644 --- a/compiler/testData/ir/irText/expressions/kt30020.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/kt30020.fir.kt.txt @@ -15,14 +15,14 @@ fun test(x: X, nx: X?) { val tmp0_safe_receiver: X? = nx when { EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null - else -> tmp0_safe_receiver /*as X */.() + else -> tmp0_safe_receiver.() } }).plusAssign(element = 5) CHECK_NOT_NULL>(arg0 = { // BLOCK val tmp1_safe_receiver: X? = nx when { EQEQ(arg0 = tmp1_safe_receiver, arg1 = null) -> null - else -> tmp1_safe_receiver /*as X */.f() + else -> tmp1_safe_receiver.f() } }).plusAssign(element = 6) } diff --git a/compiler/testData/ir/irText/expressions/kt30020.fir.txt b/compiler/testData/ir/irText/expressions/kt30020.fir.txt index e9197fa4366..1c57f6ea4a7 100644 --- a/compiler/testData/ir/irText/expressions/kt30020.fir.txt +++ b/compiler/testData/ir/irText/expressions/kt30020.fir.txt @@ -62,8 +62,7 @@ FILE fqName: fileName:/kt30020.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public abstract fun (): kotlin.collections.MutableList declared in .X' type=kotlin.collections.MutableList origin=GET_PROPERTY - $this: TYPE_OP type=.X origin=IMPLICIT_CAST typeOperand=.X - GET_VAR 'val tmp_0: .X? [val] declared in .test' type=.X? origin=null + $this: GET_VAR 'val tmp_0: .X? [val] declared in .test' type=.X? origin=null element: CONST Int type=kotlin.Int value=5 CALL 'public final fun plusAssign (element: T of kotlin.collections.CollectionsKt.plusAssign): kotlin.Unit [inline,operator] declared in kotlin.collections.CollectionsKt' type=kotlin.Unit origin=null : kotlin.Int @@ -81,8 +80,7 @@ FILE fqName: fileName:/kt30020.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public abstract fun f (): kotlin.collections.MutableList declared in .X' type=kotlin.collections.MutableList origin=null - $this: TYPE_OP type=.X origin=IMPLICIT_CAST typeOperand=.X - GET_VAR 'val tmp_1: .X? [val] declared in .test' type=.X? origin=null + $this: GET_VAR 'val tmp_1: .X? [val] declared in .test' type=.X? origin=null element: CONST Int type=kotlin.Int value=6 FUN name:testExtensionReceiver visibility:public modality:FINAL <> ($receiver:kotlin.collections.MutableList) returnType:kotlin.Unit $receiver: VALUE_PARAMETER name: type:kotlin.collections.MutableList diff --git a/compiler/testData/ir/irText/expressions/safeAssignment.fir.kt.txt b/compiler/testData/ir/irText/expressions/safeAssignment.fir.kt.txt index 58c85e4987b..a44b20dfee8 100644 --- a/compiler/testData/ir/irText/expressions/safeAssignment.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/safeAssignment.fir.kt.txt @@ -17,7 +17,7 @@ fun test(nc: C?) { val tmp0_safe_receiver: C? = nc when { EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null - else -> tmp0_safe_receiver /*as C */.( = 42) + else -> tmp0_safe_receiver.( = 42) } } /*~> Unit */ } diff --git a/compiler/testData/ir/irText/expressions/safeAssignment.fir.txt b/compiler/testData/ir/irText/expressions/safeAssignment.fir.txt index 0a8cf9d7346..4491357a6c7 100644 --- a/compiler/testData/ir/irText/expressions/safeAssignment.fir.txt +++ b/compiler/testData/ir/irText/expressions/safeAssignment.fir.txt @@ -54,6 +54,5 @@ FILE fqName: fileName:/safeAssignment.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.Unit origin=EQ - $this: TYPE_OP type=.C origin=IMPLICIT_CAST typeOperand=.C - GET_VAR 'val tmp_0: .C? [val] declared in .test' type=.C? origin=null + $this: GET_VAR 'val tmp_0: .C? [val] declared in .test' type=.C? origin=null : CONST Int type=kotlin.Int value=42 diff --git a/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.kt.txt b/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.kt.txt index 23d15a98d7a..ea0d8518045 100644 --- a/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.kt.txt @@ -21,7 +21,7 @@ operator fun Int?.inc(): Int? { val tmp0_safe_receiver: Int? = when { EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null - else -> tmp0_safe_receiver /*as Int */.inc() + else -> tmp0_safe_receiver.inc() } } } @@ -38,14 +38,14 @@ fun testProperty(nc: C?) { val tmp1_safe_receiver: C? = nc when { EQEQ(arg0 = tmp1_safe_receiver, arg1 = null) -> null - else -> tmp1_safe_receiver /*as C */.() + else -> tmp1_safe_receiver.() } } { // BLOCK val tmp2_safe_receiver: C? = nc when { EQEQ(arg0 = tmp2_safe_receiver, arg1 = null) -> null - else -> tmp2_safe_receiver /*as C */.(value = .inc()) + else -> tmp2_safe_receiver.(value = .inc()) } } /*~> Unit */ /*~> Unit */ @@ -56,7 +56,7 @@ fun testArrayAccess(nc: C?) { val tmp3_safe_receiver: C? = nc when { EQEQ(arg0 = tmp3_safe_receiver, arg1 = null) -> null - else -> tmp3_safe_receiver /*as C */.() + else -> tmp3_safe_receiver.() } } val : Int = 0 diff --git a/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.txt b/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.txt index 5f63dcb38aa..d7c526ea61c 100644 --- a/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.txt +++ b/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.txt @@ -46,8 +46,7 @@ FILE fqName:test fileName:/safeCallWithIncrementDecrement.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: TYPE_OP type=kotlin.Int origin=IMPLICIT_CAST typeOperand=kotlin.Int - GET_VAR 'val tmp_0: kotlin.Int? [val] declared in test.inc' type=kotlin.Int? origin=null + $this: GET_VAR 'val tmp_0: kotlin.Int? [val] declared in test.inc' type=kotlin.Int? origin=null FUN name:get visibility:public modality:FINAL <> ($receiver:kotlin.Int?, index:kotlin.Int) returnType:kotlin.Int [operator] $receiver: VALUE_PARAMETER name: type:kotlin.Int? VALUE_PARAMETER name:index index:0 type:kotlin.Int @@ -75,8 +74,7 @@ FILE fqName:test fileName:/safeCallWithIncrementDecrement.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public final fun (): kotlin.Int declared in test' type=kotlin.Int origin=GET_PROPERTY - $receiver: TYPE_OP type=test.C origin=IMPLICIT_CAST typeOperand=test.C - GET_VAR 'val tmp_2: test.C? [val] declared in test.testProperty' type=test.C? origin=null + $receiver: GET_VAR 'val tmp_2: test.C? [val] declared in test.testProperty' type=test.C? origin=null TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit BLOCK type=kotlin.Unit? origin=SAFE_CALL VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:test.C? [val] @@ -90,8 +88,7 @@ FILE fqName:test fileName:/safeCallWithIncrementDecrement.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public final fun (value: kotlin.Int): kotlin.Unit declared in test' type=kotlin.Unit origin=EQ - $receiver: TYPE_OP type=test.C origin=IMPLICIT_CAST typeOperand=test.C - GET_VAR 'val tmp_3: test.C? [val] declared in test.testProperty' type=test.C? origin=null + $receiver: GET_VAR 'val tmp_3: test.C? [val] declared in test.testProperty' type=test.C? origin=null value: CALL 'public final fun inc (): kotlin.Int? [operator] declared in test' type=kotlin.Int? origin=null $receiver: GET_VAR 'val tmp_1: kotlin.Int? [val] declared in test.testProperty' type=kotlin.Int? origin=null TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit @@ -112,8 +109,7 @@ FILE fqName:test fileName:/safeCallWithIncrementDecrement.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public final fun (): kotlin.Int declared in test' type=kotlin.Int origin=GET_PROPERTY - $receiver: TYPE_OP type=test.C origin=IMPLICIT_CAST typeOperand=test.C - GET_VAR 'val tmp_5: test.C? [val] declared in test.testArrayAccess' type=test.C? origin=null + $receiver: GET_VAR 'val tmp_5: test.C? [val] declared in test.testArrayAccess' type=test.C? origin=null VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:kotlin.Int [val] CONST Int type=kotlin.Int value=0 VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:kotlin.Int [val] diff --git a/compiler/testData/ir/irText/expressions/safeCalls.fir.kt.txt b/compiler/testData/ir/irText/expressions/safeCalls.fir.kt.txt index 8cd5ff12e05..9805859fa15 100644 --- a/compiler/testData/ir/irText/expressions/safeCalls.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/safeCalls.fir.kt.txt @@ -24,7 +24,7 @@ fun test1(x: String?): Int? { val tmp0_safe_receiver: String? = x when { EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null - else -> tmp0_safe_receiver /*as String */.() + else -> tmp0_safe_receiver.() } } } @@ -34,7 +34,7 @@ fun test2(x: String?): Int? { val tmp1_safe_receiver: String? = x when { EQEQ(arg0 = tmp1_safe_receiver, arg1 = null) -> null - else -> tmp1_safe_receiver /*as String */.hashCode() + else -> tmp1_safe_receiver.hashCode() } } } @@ -44,7 +44,7 @@ fun test3(x: String?, y: Any?): Boolean? { val tmp2_safe_receiver: String? = x when { EQEQ(arg0 = tmp2_safe_receiver, arg1 = null) -> null - else -> tmp2_safe_receiver /*as String */.equals(other = y) + else -> tmp2_safe_receiver.equals(other = y) } } } @@ -54,7 +54,7 @@ fun test4(x: Ref?) { val tmp3_safe_receiver: Ref? = x when { EQEQ(arg0 = tmp3_safe_receiver, arg1 = null) -> null - else -> tmp3_safe_receiver /*as Ref */.( = 0) + else -> tmp3_safe_receiver.( = 0) } } /*~> Unit */ } @@ -64,7 +64,7 @@ fun IHost.test5(s: String?): Int? { val tmp4_safe_receiver: String? = s when { EQEQ(arg0 = tmp4_safe_receiver, arg1 = null) -> null - else -> (, tmp4_safe_receiver /*as String */).extLength() + else -> (, tmp4_safe_receiver).extLength() } } } diff --git a/compiler/testData/ir/irText/expressions/safeCalls.fir.txt b/compiler/testData/ir/irText/expressions/safeCalls.fir.txt index 8bdfebd4780..89b6504723b 100644 --- a/compiler/testData/ir/irText/expressions/safeCalls.fir.txt +++ b/compiler/testData/ir/irText/expressions/safeCalls.fir.txt @@ -76,8 +76,7 @@ FILE fqName: fileName:/safeCalls.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public open fun (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=GET_PROPERTY - $this: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String - GET_VAR 'val tmp_0: kotlin.String? [val] declared in .test1' type=kotlin.String? origin=null + $this: GET_VAR 'val tmp_0: kotlin.String? [val] declared in .test1' type=kotlin.String? origin=null FUN name:test2 visibility:public modality:FINAL <> (x:kotlin.String?) returnType:kotlin.Int? VALUE_PARAMETER name:x index:0 type:kotlin.String? BLOCK_BODY @@ -94,8 +93,7 @@ FILE fqName: fileName:/safeCalls.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.String' type=kotlin.Int origin=null - $this: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String - GET_VAR 'val tmp_1: kotlin.String? [val] declared in .test2' type=kotlin.String? origin=null + $this: GET_VAR 'val tmp_1: kotlin.String? [val] declared in .test2' type=kotlin.String? origin=null FUN name:test3 visibility:public modality:FINAL <> (x:kotlin.String?, y:kotlin.Any?) returnType:kotlin.Boolean? VALUE_PARAMETER name:x index:0 type:kotlin.String? VALUE_PARAMETER name:y index:1 type:kotlin.Any? @@ -113,8 +111,7 @@ FILE fqName: fileName:/safeCalls.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in kotlin.String' type=kotlin.Boolean origin=null - $this: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String - GET_VAR 'val tmp_2: kotlin.String? [val] declared in .test3' type=kotlin.String? origin=null + $this: GET_VAR 'val tmp_2: kotlin.String? [val] declared in .test3' type=kotlin.String? origin=null other: GET_VAR 'y: kotlin.Any? declared in .test3' type=kotlin.Any? origin=null FUN name:test4 visibility:public modality:FINAL <> (x:.Ref?) returnType:kotlin.Unit VALUE_PARAMETER name:x index:0 type:.Ref? @@ -132,8 +129,7 @@ FILE fqName: fileName:/safeCalls.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Ref' type=kotlin.Unit origin=EQ - $this: TYPE_OP type=.Ref origin=IMPLICIT_CAST typeOperand=.Ref - GET_VAR 'val tmp_3: .Ref? [val] declared in .test4' type=.Ref? origin=null + $this: GET_VAR 'val tmp_3: .Ref? [val] declared in .test4' type=.Ref? origin=null : CONST Int type=kotlin.Int value=0 FUN name:test5 visibility:public modality:FINAL <> ($receiver:.IHost, s:kotlin.String?) returnType:kotlin.Int? $receiver: VALUE_PARAMETER name: type:.IHost @@ -153,8 +149,7 @@ FILE fqName: fileName:/safeCalls.kt if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public open fun extLength (): kotlin.Int declared in .IHost' type=kotlin.Int origin=null $this: GET_VAR ': .IHost declared in .test5' type=.IHost origin=null - $receiver: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String - GET_VAR 'val tmp_4: kotlin.String? [val] declared in .test5' type=kotlin.String? origin=null + $receiver: GET_VAR 'val tmp_4: kotlin.String? [val] declared in .test5' type=kotlin.String? origin=null FUN name:foo visibility:public modality:FINAL <> ($receiver:kotlin.Int) returnType:kotlin.Int $receiver: VALUE_PARAMETER name: type:kotlin.Int BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.fir.kt.txt b/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.fir.kt.txt index 32933809ff1..8019c9ab30b 100644 --- a/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.fir.kt.txt @@ -17,7 +17,7 @@ open enum class En : Enum { val tmp0_safe_receiver: Any? = () when { EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null - else -> tmp0_safe_receiver /*as Any */.toString() + else -> tmp0_safe_receiver.toString() } }) diff --git a/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.fir.txt b/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.fir.txt index bc50c00adb8..033ae4b5121 100644 --- a/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.fir.txt +++ b/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.fir.txt @@ -42,8 +42,7 @@ FILE fqName: fileName:/temporaryInEnumEntryInitializer.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null - $this: TYPE_OP type=kotlin.Any origin=IMPLICIT_CAST typeOperand=kotlin.Any - GET_VAR 'val tmp_0: kotlin.Any? [val] declared in .En' type=kotlin.Any? origin=null + $this: GET_VAR 'val tmp_0: kotlin.Any? [val] declared in .En' type=kotlin.Any? origin=null FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.En> SYNTHETIC_BODY kind=ENUM_VALUES FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.En diff --git a/compiler/testData/ir/irText/expressions/temporaryInInitBlock.kt.txt b/compiler/testData/ir/irText/expressions/temporaryInInitBlock.kt.txt index 9d183ecd8b8..b5161ea7d1e 100644 --- a/compiler/testData/ir/irText/expressions/temporaryInInitBlock.kt.txt +++ b/compiler/testData/ir/irText/expressions/temporaryInInitBlock.kt.txt @@ -13,7 +13,7 @@ class C { val tmp0_safe_receiver: Any? = x when { EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null - else -> tmp0_safe_receiver /*as Any */.toString() + else -> tmp0_safe_receiver.toString() } } } diff --git a/compiler/testData/ir/irText/expressions/temporaryInInitBlock.txt b/compiler/testData/ir/irText/expressions/temporaryInInitBlock.txt index 10826774f71..842752aa6d2 100644 --- a/compiler/testData/ir/irText/expressions/temporaryInInitBlock.txt +++ b/compiler/testData/ir/irText/expressions/temporaryInInitBlock.txt @@ -31,8 +31,7 @@ FILE fqName: fileName:/temporaryInInitBlock.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null - $this: TYPE_OP type=kotlin.Any origin=IMPLICIT_CAST typeOperand=kotlin.Any - GET_VAR 'val tmp_0: kotlin.Any? [val] declared in .C' type=kotlin.Any? origin=null + $this: GET_VAR 'val tmp_0: kotlin.Any? [val] declared in .C' type=kotlin.Any? origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/variableAsFunctionCall.fir.kt.txt b/compiler/testData/ir/irText/expressions/variableAsFunctionCall.fir.kt.txt index 6986fd4fc10..d26d3800122 100644 --- a/compiler/testData/ir/irText/expressions/variableAsFunctionCall.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/variableAsFunctionCall.fir.kt.txt @@ -23,12 +23,12 @@ fun test4(ns: String?): String? { val tmp0_safe_receiver: String? = ns when { EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null - else -> tmp0_safe_receiver /*as String */.k() + else -> tmp0_safe_receiver.k() } } when { EQEQ(arg0 = tmp1_safe_receiver, arg1 = null) -> null - else -> tmp1_safe_receiver /*as Function0 */.invoke() + else -> tmp1_safe_receiver.invoke() } } } diff --git a/compiler/testData/ir/irText/expressions/variableAsFunctionCall.fir.txt b/compiler/testData/ir/irText/expressions/variableAsFunctionCall.fir.txt index 2fda803593a..7ba641b6e3a 100644 --- a/compiler/testData/ir/irText/expressions/variableAsFunctionCall.fir.txt +++ b/compiler/testData/ir/irText/expressions/variableAsFunctionCall.fir.txt @@ -45,8 +45,7 @@ FILE fqName: fileName:/variableAsFunctionCall.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public final fun k (): kotlin.Function0 declared in ' type=kotlin.Function0 origin=null - $receiver: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String - GET_VAR 'val tmp_1: kotlin.String? [val] declared in .test4' type=kotlin.String? origin=null + $receiver: GET_VAR 'val tmp_1: kotlin.String? [val] declared in .test4' type=kotlin.String? origin=null WHEN type=kotlin.String? origin=null BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ @@ -56,5 +55,4 @@ FILE fqName: fileName:/variableAsFunctionCall.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=kotlin.String origin=INVOKE - $this: TYPE_OP type=kotlin.Function0 origin=IMPLICIT_CAST typeOperand=kotlin.Function0 - GET_VAR 'val tmp_0: kotlin.Function0? [val] declared in .test4' type=kotlin.Function0? origin=null + $this: GET_VAR 'val tmp_0: kotlin.Function0? [val] declared in .test4' type=kotlin.Function0? origin=null diff --git a/compiler/testData/ir/irText/expressions/when.fir.kt.txt b/compiler/testData/ir/irText/expressions/when.fir.kt.txt index b29edd7691a..2df62c95bd2 100644 --- a/compiler/testData/ir/irText/expressions/when.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/when.fir.kt.txt @@ -24,9 +24,9 @@ fun testWithSubject(x: Any?): String { fun test(x: Any?): String { return when { EQEQ(arg0 = x, arg1 = null) -> "null" - EQEQ(arg0 = x /*as Any */, arg1 = A) -> "A" - x /*as Any */ is String -> "String" - x /*as Any */ !is Number -> "!Number" + EQEQ(arg0 = x, arg1 = A) -> "A" + x is String -> "String" + x !is Number -> "!Number" setOf().contains(element = x /*as Number */) -> "nothingness?" else -> "something" } diff --git a/compiler/testData/ir/irText/expressions/when.fir.txt b/compiler/testData/ir/irText/expressions/when.fir.txt index f57c1e163b2..8011d00f0d7 100644 --- a/compiler/testData/ir/irText/expressions/when.fir.txt +++ b/compiler/testData/ir/irText/expressions/when.fir.txt @@ -66,19 +66,16 @@ FILE fqName: fileName:/when.kt then: CONST String type=kotlin.String value="null" BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: TYPE_OP type=kotlin.Any origin=IMPLICIT_CAST typeOperand=kotlin.Any - GET_VAR 'x: kotlin.Any? declared in .test' type=kotlin.Any? origin=null + arg0: GET_VAR 'x: kotlin.Any? declared in .test' type=kotlin.Any? origin=null arg1: GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.A then: CONST String type=kotlin.String value="A" BRANCH if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.String - TYPE_OP type=kotlin.Any origin=IMPLICIT_CAST typeOperand=kotlin.Any - GET_VAR 'x: kotlin.Any? declared in .test' type=kotlin.Any? origin=null + GET_VAR 'x: kotlin.Any? declared in .test' type=kotlin.Any? origin=null then: CONST String type=kotlin.String value="String" BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.Number - TYPE_OP type=kotlin.Any origin=IMPLICIT_CAST typeOperand=kotlin.Any - GET_VAR 'x: kotlin.Any? declared in .test' type=kotlin.Any? origin=null + GET_VAR 'x: kotlin.Any? declared in .test' type=kotlin.Any? origin=null then: CONST String type=kotlin.String value="!Number" BRANCH if: CALL 'public final fun contains (element: T of kotlin.collections.CollectionsKt.contains): kotlin.Boolean [operator] declared in kotlin.collections.CollectionsKt' type=kotlin.Boolean origin=null diff --git a/compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.fir.kt.txt b/compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.fir.kt.txt index fa763a44d20..c23e32d63c5 100644 --- a/compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.fir.kt.txt @@ -53,7 +53,7 @@ fun resolveClashesIfAny(container: ComponentContainer, clashResolvers: List: Collection? = ().get(p0 = resolver.()) as? Collection when { EQEQ(arg0 = , arg1 = null) -> continue - else -> /*as Collection */ + else -> } } val substituteDescriptor: ClashResolutionDescriptor>>>>> = ClashResolutionDescriptor>>>>>(container = container, resolver = resolver, clashedComponents = clashedComponents.toList()) diff --git a/compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.fir.txt b/compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.fir.txt index e67870b6bbb..074f31191fa 100644 --- a/compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.fir.txt +++ b/compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.fir.txt @@ -164,8 +164,7 @@ FILE fqName: fileName:/ClashResolutionDescriptor.kt then: CONTINUE label=null loop.label=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true - then: TYPE_OP type=kotlin.collections.Collection<.ComponentDescriptor> origin=IMPLICIT_CAST typeOperand=kotlin.collections.Collection<.ComponentDescriptor> - GET_VAR 'val tmp_1: kotlin.collections.Collection<.ComponentDescriptor>? [val] declared in .resolveClashesIfAny' type=kotlin.collections.Collection<.ComponentDescriptor>? origin=null + then: GET_VAR 'val tmp_1: kotlin.collections.Collection<.ComponentDescriptor>? [val] declared in .resolveClashesIfAny' type=kotlin.collections.Collection<.ComponentDescriptor>? origin=null VAR name:substituteDescriptor type:.ClashResolutionDescriptor.PlatformSpecificExtension.PlatformSpecificExtension.PlatformSpecificExtension.PlatformSpecificExtension.PlatformSpecificExtension>>>>> [val] CONSTRUCTOR_CALL 'public constructor (container: .ComponentContainer, resolver: .PlatformExtensionsClashResolver.ClashResolutionDescriptor>, clashedComponents: kotlin.collections.List<.ComponentDescriptor>) [primary] declared in .ClashResolutionDescriptor' type=.ClashResolutionDescriptor.PlatformSpecificExtension.PlatformSpecificExtension.PlatformSpecificExtension.PlatformSpecificExtension.PlatformSpecificExtension>>>>> origin=null : .PlatformSpecificExtension.PlatformSpecificExtension.PlatformSpecificExtension.PlatformSpecificExtension.PlatformSpecificExtension>>>> diff --git a/compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.fir.kt.txt b/compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.fir.kt.txt index a6275eb4f88..31d5a81df78 100644 --- a/compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.fir.kt.txt @@ -79,7 +79,7 @@ fun box(): String { val tmp0_safe_receiver: ImplicitReceiverValue<*>? = stack.get(name = null) when { EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null - else -> tmp0_safe_receiver /*as ImplicitReceiverValue<*> */.() + else -> tmp0_safe_receiver.() } }) } diff --git a/compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.fir.txt b/compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.fir.txt index 6dd76dc95a5..06ec0dfc0fe 100644 --- a/compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.fir.txt +++ b/compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.fir.txt @@ -249,5 +249,4 @@ FILE fqName: fileName:/ImplicitReceiverStack.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public final fun (): kotlin.String declared in .ImplicitReceiverValue' type=kotlin.String origin=GET_PROPERTY - $this: TYPE_OP type=.ImplicitReceiverValue<*> origin=IMPLICIT_CAST typeOperand=.ImplicitReceiverValue<*> - GET_VAR 'val tmp_0: .ImplicitReceiverValue<*>? [val] declared in .box' type=.ImplicitReceiverValue<*>? origin=null + $this: GET_VAR 'val tmp_0: .ImplicitReceiverValue<*>? [val] declared in .box' type=.ImplicitReceiverValue<*>? origin=null diff --git a/compiler/testData/ir/irText/firProblems/coercionToUnitForNestedWhen.fir.kt.txt b/compiler/testData/ir/irText/firProblems/coercionToUnitForNestedWhen.fir.kt.txt index c5165983793..9ee70479d91 100644 --- a/compiler/testData/ir/irText/firProblems/coercionToUnitForNestedWhen.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/coercionToUnitForNestedWhen.fir.kt.txt @@ -10,7 +10,7 @@ private fun Reader.nextChar(): Char? { ) when { EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null - else -> tmp0_safe_receiver /*as Int */.toChar() + else -> tmp0_safe_receiver.toChar() } } } @@ -18,21 +18,21 @@ private fun Reader.nextChar(): Char? { fun Reader.consumeRestOfQuotedSequence(sb: StringBuilder, quote: Char) { var ch: Char? = .nextChar() while (when { - EQEQ(arg0 = ch, arg1 = null).not() -> EQEQ(arg0 = ch /*as Char */, arg1 = quote).not() + EQEQ(arg0 = ch, arg1 = null).not() -> EQEQ(arg0 = ch, arg1 = quote).not() else -> false }) { // BLOCK when { - EQEQ(arg0 = ch /*as Char */, arg1 = ()) -> { // BLOCK + EQEQ(arg0 = ch, arg1 = ()) -> { // BLOCK val tmp1_safe_receiver: Char? = .nextChar() when { EQEQ(arg0 = tmp1_safe_receiver, arg1 = null) -> null - else -> tmp1_safe_receiver /*as Char */.let(block = local fun (it: Char): StringBuilder? { + else -> tmp1_safe_receiver.let(block = local fun (it: Char): StringBuilder? { return sb.append(p0 = it) } ) } } - else -> sb.append(p0 = ch /*as Char */) + else -> sb.append(p0 = ch) } /*~> Unit */ ch = .nextChar() } diff --git a/compiler/testData/ir/irText/firProblems/coercionToUnitForNestedWhen.fir.txt b/compiler/testData/ir/irText/firProblems/coercionToUnitForNestedWhen.fir.txt index 197ac7adb75..6ac9386d126 100644 --- a/compiler/testData/ir/irText/firProblems/coercionToUnitForNestedWhen.fir.txt +++ b/compiler/testData/ir/irText/firProblems/coercionToUnitForNestedWhen.fir.txt @@ -35,8 +35,7 @@ FILE fqName: fileName:/coercionToUnitForNestedWhen.kt BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public open fun toChar (): kotlin.Char declared in kotlin.Int' type=kotlin.Char origin=null - $this: TYPE_OP type=kotlin.Int origin=IMPLICIT_CAST typeOperand=kotlin.Int - GET_VAR 'val tmp_0: kotlin.Int? [val] declared in .nextChar' type=kotlin.Int? origin=null + $this: GET_VAR 'val tmp_0: kotlin.Int? [val] declared in .nextChar' type=kotlin.Int? origin=null FUN name:consumeRestOfQuotedSequence visibility:public modality:FINAL <> ($receiver:java.io.Reader, sb:java.lang.StringBuilder, quote:kotlin.Char) returnType:kotlin.Unit $receiver: VALUE_PARAMETER name: type:java.io.Reader VALUE_PARAMETER name:sb index:0 type:java.lang.StringBuilder @@ -54,8 +53,7 @@ FILE fqName: fileName:/coercionToUnitForNestedWhen.kt arg1: CONST Null type=kotlin.Nothing? value=null then: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ - arg0: TYPE_OP type=kotlin.Char origin=IMPLICIT_CAST typeOperand=kotlin.Char - GET_VAR 'var ch: kotlin.Char? [var] declared in .consumeRestOfQuotedSequence' type=kotlin.Char? origin=null + arg0: GET_VAR 'var ch: kotlin.Char? [var] declared in .consumeRestOfQuotedSequence' type=kotlin.Char? origin=null arg1: GET_VAR 'quote: kotlin.Char declared in .consumeRestOfQuotedSequence' type=kotlin.Char origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true @@ -65,8 +63,7 @@ FILE fqName: fileName:/coercionToUnitForNestedWhen.kt WHEN type=@[FlexibleNullability] java.lang.StringBuilder? origin=IF BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: TYPE_OP type=kotlin.Char origin=IMPLICIT_CAST typeOperand=kotlin.Char - GET_VAR 'var ch: kotlin.Char? [var] declared in .consumeRestOfQuotedSequence' type=kotlin.Char? origin=null + arg0: GET_VAR 'var ch: kotlin.Char? [var] declared in .consumeRestOfQuotedSequence' type=kotlin.Char? origin=null arg1: CALL 'private final fun (): kotlin.Char declared in ' type=kotlin.Char origin=GET_PROPERTY then: BLOCK type=java.lang.StringBuilder? origin=SAFE_CALL VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Char? [val] @@ -83,8 +80,7 @@ FILE fqName: fileName:/coercionToUnitForNestedWhen.kt then: CALL 'public final fun let (block: kotlin.Function1): R of kotlin.StandardKt.let [inline] declared in kotlin.StandardKt' type=java.lang.StringBuilder? origin=null : kotlin.Char : java.lang.StringBuilder? - $receiver: TYPE_OP type=kotlin.Char origin=IMPLICIT_CAST typeOperand=kotlin.Char - GET_VAR 'val tmp_1: kotlin.Char? [val] declared in .consumeRestOfQuotedSequence' type=kotlin.Char? origin=null + $receiver: GET_VAR 'val tmp_1: kotlin.Char? [val] declared in .consumeRestOfQuotedSequence' type=kotlin.Char? origin=null block: FUN_EXPR type=kotlin.Function1 origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:kotlin.Char) returnType:java.lang.StringBuilder? VALUE_PARAMETER name:it index:0 type:kotlin.Char @@ -97,8 +93,7 @@ FILE fqName: fileName:/coercionToUnitForNestedWhen.kt if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public open fun append (p0: kotlin.Char): java.lang.StringBuilder? declared in java.lang.StringBuilder' type=java.lang.StringBuilder? origin=null $this: GET_VAR 'sb: java.lang.StringBuilder declared in .consumeRestOfQuotedSequence' type=java.lang.StringBuilder origin=null - p0: TYPE_OP type=kotlin.Char origin=IMPLICIT_CAST typeOperand=kotlin.Char - GET_VAR 'var ch: kotlin.Char? [var] declared in .consumeRestOfQuotedSequence' type=kotlin.Char? origin=null + p0: GET_VAR 'var ch: kotlin.Char? [var] declared in .consumeRestOfQuotedSequence' type=kotlin.Char? origin=null SET_VAR 'var ch: kotlin.Char? [var] declared in .consumeRestOfQuotedSequence' type=kotlin.Unit origin=EQ CALL 'private final fun nextChar (): kotlin.Char? declared in ' type=kotlin.Char? origin=null $receiver: GET_VAR ': java.io.Reader declared in .consumeRestOfQuotedSequence' type=java.io.Reader origin=null diff --git a/compiler/testData/ir/irText/firProblems/inapplicableCollectionSet.fir.kt.txt b/compiler/testData/ir/irText/firProblems/inapplicableCollectionSet.fir.kt.txt index 7537cea0936..d0e513e1ce4 100644 --- a/compiler/testData/ir/irText/firProblems/inapplicableCollectionSet.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/inapplicableCollectionSet.fir.kt.txt @@ -23,10 +23,10 @@ class Flaf { result = Flaf(javaName = javaName) } } - .().set(key = javaName, value = result /*as Flaf */) + .().set(key = javaName, value = result) } } - return result /*as Flaf */ + return result } } diff --git a/compiler/testData/ir/irText/firProblems/inapplicableCollectionSet.fir.txt b/compiler/testData/ir/irText/firProblems/inapplicableCollectionSet.fir.txt index 40d4e6eb48f..d9583317f9e 100644 --- a/compiler/testData/ir/irText/firProblems/inapplicableCollectionSet.fir.txt +++ b/compiler/testData/ir/irText/firProblems/inapplicableCollectionSet.fir.txt @@ -68,11 +68,9 @@ FILE fqName: fileName:/inapplicableCollectionSet.kt $receiver: CALL 'private final fun (): kotlin.collections.MutableMap.Flaf> declared in .Flaf' type=kotlin.collections.MutableMap.Flaf> origin=GET_PROPERTY $this: GET_VAR ': .Flaf declared in .Flaf.forJavaName' type=.Flaf origin=null key: GET_VAR 'javaName: kotlin.String declared in .Flaf.forJavaName' type=kotlin.String origin=null - value: TYPE_OP type=.Flaf origin=IMPLICIT_CAST typeOperand=.Flaf - GET_VAR 'var result: .Flaf? [var] declared in .Flaf.forJavaName' type=.Flaf? origin=null + value: GET_VAR 'var result: .Flaf? [var] declared in .Flaf.forJavaName' type=.Flaf? origin=null RETURN type=kotlin.Nothing from='public final fun forJavaName (javaName: kotlin.String): .Flaf declared in .Flaf' - TYPE_OP type=.Flaf origin=IMPLICIT_CAST typeOperand=.Flaf - GET_VAR 'var result: .Flaf? [var] declared in .Flaf.forJavaName' type=.Flaf? origin=null + GET_VAR 'var result: .Flaf? [var] declared in .Flaf.forJavaName' type=.Flaf? origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any diff --git a/compiler/testData/ir/irText/firProblems/readWriteProperty.fir.kt.txt b/compiler/testData/ir/irText/firProblems/readWriteProperty.fir.kt.txt index 72f6380c202..2dbbd701b66 100644 --- a/compiler/testData/ir/irText/firProblems/readWriteProperty.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/readWriteProperty.fir.kt.txt @@ -59,8 +59,8 @@ class IdeWizard { when { EQEQ(arg0 = value, arg1 = null) -> return Unit } - reference.( = SettingType(type = value /*as V */::class) as T) - reference.( = value /*as V */) + reference.( = SettingType(type = value::class) as T) + reference.( = value) } override operator fun getValue(thisRef: Any?, property: KProperty<*>): V? { diff --git a/compiler/testData/ir/irText/firProblems/readWriteProperty.fir.txt b/compiler/testData/ir/irText/firProblems/readWriteProperty.fir.txt index c7de57617e9..01d05d7d1cb 100644 --- a/compiler/testData/ir/irText/firProblems/readWriteProperty.fir.txt +++ b/compiler/testData/ir/irText/firProblems/readWriteProperty.fir.txt @@ -169,12 +169,10 @@ FILE fqName: fileName:/readWriteProperty.kt CONSTRUCTOR_CALL 'public constructor (type: kotlin.reflect.KClass.SettingType>) [primary] declared in .SettingType' type=.SettingType.IdeWizard.setting> origin=null : V of .IdeWizard.setting type: GET_CLASS type=kotlin.reflect.KClass.IdeWizard.setting> - TYPE_OP type=V of .IdeWizard.setting origin=IMPLICIT_CAST typeOperand=V of .IdeWizard.setting - GET_VAR 'value: V of .IdeWizard.setting? declared in .IdeWizard.setting..setValue' type=V of .IdeWizard.setting? origin=null + GET_VAR 'value: V of .IdeWizard.setting? declared in .IdeWizard.setting..setValue' type=V of .IdeWizard.setting? origin=null CALL 'public final fun (: V of .SettingReference): kotlin.Unit declared in .SettingReference' type=kotlin.Unit origin=EQ $this: GET_VAR 'reference: .SettingReference.IdeWizard.setting, T of .IdeWizard.setting> declared in .IdeWizard.setting' type=.SettingReference.IdeWizard.setting, T of .IdeWizard.setting> origin=null - : TYPE_OP type=V of .IdeWizard.setting origin=IMPLICIT_CAST typeOperand=V of .IdeWizard.setting - GET_VAR 'value: V of .IdeWizard.setting? declared in .IdeWizard.setting..setValue' type=V of .IdeWizard.setting? origin=null + : GET_VAR 'value: V of .IdeWizard.setting? declared in .IdeWizard.setting..setValue' type=V of .IdeWizard.setting? origin=null FUN name:getValue visibility:public modality:FINAL <> ($this:.IdeWizard.setting..IdeWizard.setting, T of .IdeWizard.setting>, thisRef:kotlin.Any?, property:kotlin.reflect.KProperty<*>) returnType:V of .IdeWizard.setting? [operator] overridden: public abstract fun getValue (thisRef: T of kotlin.properties.ReadWriteProperty, property: kotlin.reflect.KProperty<*>): V of kotlin.properties.ReadWriteProperty [operator] declared in kotlin.properties.ReadWriteProperty diff --git a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.kt.txt b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.kt.txt index de21f64cb90..20df7d23208 100644 --- a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.kt.txt +++ b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.kt.txt @@ -42,7 +42,7 @@ private fun CoroutineScope.asFairChannel(flow: Flow<*>): ReceiveChannel { val : Any? = value when { EQEQ(arg0 = , arg1 = null) -> Any() - else -> /*as Any */ + else -> } }) } @@ -58,7 +58,7 @@ private fun CoroutineScope.asChannel(flow: Flow<*>): ReceiveChannel { val : Any? = value when { EQEQ(arg0 = , arg1 = null) -> Any() - else -> /*as Any */ + else -> } }) } @@ -141,4 +141,3 @@ interface SendChannel { abstract suspend fun send(e: E) } - diff --git a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.txt b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.txt index b74e4cd4ea0..3000008ef91 100644 --- a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.txt +++ b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.fir.txt @@ -114,8 +114,7 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt then: CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true - then: TYPE_OP type=kotlin.Any origin=IMPLICIT_CAST typeOperand=kotlin.Any - GET_VAR 'val tmp_0: kotlin.Any? [val] declared in .asFairChannel..' type=kotlin.Any? origin=null + then: GET_VAR 'val tmp_0: kotlin.Any? [val] declared in .asFairChannel..' type=kotlin.Any? origin=null FUN name:asChannel visibility:private modality:FINAL <> ($receiver:.CoroutineScope, flow:.Flow<*>) returnType:.ReceiveChannel $receiver: VALUE_PARAMETER name: type:.CoroutineScope VALUE_PARAMETER name:flow index:0 type:.Flow<*> @@ -150,8 +149,7 @@ FILE fqName: fileName:/castsInsideCoroutineInference.kt then: CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true - then: TYPE_OP type=kotlin.Any origin=IMPLICIT_CAST typeOperand=kotlin.Any - GET_VAR 'val tmp_1: kotlin.Any? [val] declared in .asChannel..' type=kotlin.Any? origin=null + then: GET_VAR 'val tmp_1: kotlin.Any? [val] declared in .asChannel..' type=kotlin.Any? origin=null CLASS CLASS name:SafeCollector modality:FINAL visibility:public superTypes:[.FlowCollector.SafeCollector>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.SafeCollector.SafeCollector> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] From 7e6abffb625110b87ab7898c19885e07dd3d3380 Mon Sep 17 00:00:00 2001 From: "Denis.Zharkov" Date: Thu, 28 Jan 2021 18:15:15 +0300 Subject: [PATCH 161/212] FIR: Fix incorrectly serialized type See the test added: there's a non-denotable T!! type inside flexible type that wasn't handled before. ConeKotlinType::contains handles flexible types content and some other cases Also, it has better asymptotics --- .../FirBlackBoxCodegenTestGenerated.java | 6 ++ .../jetbrains/kotlin/fir/types/TypeUtils.kt | 14 +---- ...tiModuleJsCompilerRunnerTestGenerated.java | 2 +- ...duleJsKlibCompilerRunnerTestGenerated.java | 2 +- .../approximationForDefinitelyNotNull.kt | 57 +++++++++++++++++++ .../codegen/BlackBoxCodegenTestGenerated.java | 6 ++ .../IrBlackBoxCodegenTestGenerated.java | 6 ++ .../LightAnalysisModeTestGenerated.java | 5 ++ ...ileToSourceStubConverterTestGenerated.java | 1 - ...ileToSourceStubConverterTestGenerated.java | 1 - 10 files changed, 84 insertions(+), 16 deletions(-) create mode 100644 compiler/testData/codegen/box/regressions/approximationForDefinitelyNotNull.kt diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java index 7e2ca5a9370..48f5ada576c 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java @@ -33314,6 +33314,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/regressions/approximateIntersectionType.kt"); } + @Test + @TestMetadata("approximationForDefinitelyNotNull.kt") + public void testApproximationForDefinitelyNotNull() throws Exception { + runTest("compiler/testData/codegen/box/regressions/approximationForDefinitelyNotNull.kt"); + } + @Test @TestMetadata("arrayLengthNPE.kt") public void testArrayLengthNPE() throws Exception { diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/types/TypeUtils.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/types/TypeUtils.kt index 5faf26003be..7b2e341b402 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/types/TypeUtils.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/types/TypeUtils.kt @@ -11,7 +11,6 @@ import org.jetbrains.kotlin.fir.FirFakeSourceElementKind import org.jetbrains.kotlin.fir.FirSession import org.jetbrains.kotlin.fir.declarations.classId import org.jetbrains.kotlin.fir.diagnostics.ConeSimpleDiagnostic -import org.jetbrains.kotlin.fir.expressions.classId import org.jetbrains.kotlin.fir.fakeElement import org.jetbrains.kotlin.fir.render import org.jetbrains.kotlin.fir.resolve.fullyExpandedType @@ -270,17 +269,8 @@ fun FirTypeRef.approximatedForPublicPosition(approximator: AbstractTypeApproxima else this -private fun ConeKotlinType.requiresApproximationInPublicPosition(): Boolean { - return when (this) { - is ConeIntegerLiteralType, - is ConeCapturedType, - is ConeDefinitelyNotNullType, - is ConeIntersectionType -> true - is ConeClassLikeType -> typeArguments.any { - it is ConeKotlinTypeProjection && it.type.requiresApproximationInPublicPosition() - } - else -> false - } +private fun ConeKotlinType.requiresApproximationInPublicPosition(): Boolean = contains { + it is ConeIntegerLiteralType || it is ConeCapturedType || it is ConeDefinitelyNotNullType || it is ConeIntersectionType } /* diff --git a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalMultiModuleJsCompilerRunnerTestGenerated.java b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalMultiModuleJsCompilerRunnerTestGenerated.java index d87b986749e..1c1a8920b15 100644 --- a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalMultiModuleJsCompilerRunnerTestGenerated.java +++ b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalMultiModuleJsCompilerRunnerTestGenerated.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ diff --git a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalMultiModuleJsKlibCompilerRunnerTestGenerated.java b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalMultiModuleJsKlibCompilerRunnerTestGenerated.java index 945baa3bb5d..48018e4d2a8 100644 --- a/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalMultiModuleJsKlibCompilerRunnerTestGenerated.java +++ b/compiler/incremental-compilation-impl/test/org/jetbrains/kotlin/incremental/IncrementalMultiModuleJsKlibCompilerRunnerTestGenerated.java @@ -1,5 +1,5 @@ /* - * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ diff --git a/compiler/testData/codegen/box/regressions/approximationForDefinitelyNotNull.kt b/compiler/testData/codegen/box/regressions/approximationForDefinitelyNotNull.kt new file mode 100644 index 00000000000..998f226ac30 --- /dev/null +++ b/compiler/testData/codegen/box/regressions/approximationForDefinitelyNotNull.kt @@ -0,0 +1,57 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME + +// MODULE: lib +// FILE: CachedValuesManager.java +import org.jetbrains.annotations.NotNull; +public class CachedValuesManager { + public @NotNull CachedValue createCachedValue(final @NotNull CachedValueProvider provider) { + return new CachedValue() { + public T getValue() { + return provider.compute().value; + } + }; + } +} + +// FILE: CachedValueProvider.java +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.Collection; + +public interface CachedValueProvider { + @Nullable + Result compute(); + + class Result { + public final T value; + public Result(@Nullable T value) { + this.value = value; + } + } +} + +// FILE: CachedValue.java +public interface CachedValue { + T getValue(); +} + +// FILE: lib.kt + +// Inferred as CachedValue>! and T!! should be approximated +fun cachedValue(manager: CachedValuesManager, createValue: () -> T) = + manager.createCachedValue { + CachedValueProvider.Result( + createValue() + ) + } + +// MODULE: main(lib) +// FILE: main.kt + +fun box(): String { + val value = cachedValue(CachedValuesManager()) { Pair("O", "K") }.value + + return value.first + value.second +} diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index ffb1a202405..29dde57cd24 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -33514,6 +33514,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/regressions/approximateIntersectionType.kt"); } + @Test + @TestMetadata("approximationForDefinitelyNotNull.kt") + public void testApproximationForDefinitelyNotNull() throws Exception { + runTest("compiler/testData/codegen/box/regressions/approximationForDefinitelyNotNull.kt"); + } + @Test @TestMetadata("arrayLengthNPE.kt") public void testArrayLengthNPE() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index b3d0bb8aa11..18fedd1f27f 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -33314,6 +33314,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/regressions/approximateIntersectionType.kt"); } + @Test + @TestMetadata("approximationForDefinitelyNotNull.kt") + public void testApproximationForDefinitelyNotNull() throws Exception { + runTest("compiler/testData/codegen/box/regressions/approximationForDefinitelyNotNull.kt"); + } + @Test @TestMetadata("arrayLengthNPE.kt") public void testArrayLengthNPE() throws Exception { diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 25047ce0e46..d8e5fe91f0b 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -27298,6 +27298,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/regressions/approximateIntersectionType.kt"); } + @TestMetadata("approximationForDefinitelyNotNull.kt") + public void testApproximationForDefinitelyNotNull() throws Exception { + runTest("compiler/testData/codegen/box/regressions/approximationForDefinitelyNotNull.kt"); + } + @TestMetadata("arrayLengthNPE.kt") public void testArrayLengthNPE() throws Exception { runTest("compiler/testData/codegen/box/regressions/arrayLengthNPE.kt"); diff --git a/plugins/kapt3/kapt3-compiler/test/org/jetbrains/kotlin/kapt3/test/ClassFileToSourceStubConverterTestGenerated.java b/plugins/kapt3/kapt3-compiler/test/org/jetbrains/kotlin/kapt3/test/ClassFileToSourceStubConverterTestGenerated.java index 3a738140417..5c4b619d774 100644 --- a/plugins/kapt3/kapt3-compiler/test/org/jetbrains/kotlin/kapt3/test/ClassFileToSourceStubConverterTestGenerated.java +++ b/plugins/kapt3/kapt3-compiler/test/org/jetbrains/kotlin/kapt3/test/ClassFileToSourceStubConverterTestGenerated.java @@ -74,7 +74,6 @@ public class ClassFileToSourceStubConverterTestGenerated extends AbstractClassFi runTest("plugins/kapt3/kapt3-compiler/testData/converter/comments.kt"); } - /** Regression test for KT-43593. */ @TestMetadata("commentsRemoved.kt") public void testCommentsRemoved() throws Exception { runTest("plugins/kapt3/kapt3-compiler/testData/converter/commentsRemoved.kt"); diff --git a/plugins/kapt3/kapt3-compiler/test/org/jetbrains/kotlin/kapt3/test/IrClassFileToSourceStubConverterTestGenerated.java b/plugins/kapt3/kapt3-compiler/test/org/jetbrains/kotlin/kapt3/test/IrClassFileToSourceStubConverterTestGenerated.java index f1e2da8eca4..d9de74b45ed 100644 --- a/plugins/kapt3/kapt3-compiler/test/org/jetbrains/kotlin/kapt3/test/IrClassFileToSourceStubConverterTestGenerated.java +++ b/plugins/kapt3/kapt3-compiler/test/org/jetbrains/kotlin/kapt3/test/IrClassFileToSourceStubConverterTestGenerated.java @@ -75,7 +75,6 @@ public class IrClassFileToSourceStubConverterTestGenerated extends AbstractIrCla runTest("plugins/kapt3/kapt3-compiler/testData/converter/comments.kt"); } - /** Regression test for KT-43593. */ @TestMetadata("commentsRemoved.kt") public void testCommentsRemoved() throws Exception { runTest("plugins/kapt3/kapt3-compiler/testData/converter/commentsRemoved.kt"); From c13949d322bf85bb22b3959b66602885d8e468a6 Mon Sep 17 00:00:00 2001 From: Ilya Goncharov Date: Wed, 27 Jan 2021 13:29:05 +0300 Subject: [PATCH 162/212] [Gradle, JS] Move incremental test into non-ir js tests and add module name into 2js plugin [Gradle, JS] Fix tests for incremental compilation of IR klib dir [Gradle, JS] Add hack of outputFile into kotlin2js plugin [Gradle, JS] Remove producing klib-dir [Gradle, JS] Try to fix outputFileOrNull in JS compile Because on clean run, file is not yet created, isFile check is incorrect --- .../kotlin/gradle/Kotlin2JsGradlePluginIT.kt | 98 +++++++++---------- .../kotlin2JsNoOutputFileProject/build.gradle | 2 +- .../kotlin/gradle/plugin/KotlinPlugin.kt | 23 ++++- .../jetbrains/kotlin/gradle/tasks/Tasks.kt | 27 ++--- 4 files changed, 86 insertions(+), 64 deletions(-) diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/Kotlin2JsGradlePluginIT.kt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/Kotlin2JsGradlePluginIT.kt index 312c0551031..50b73a400da 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/Kotlin2JsGradlePluginIT.kt +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/Kotlin2JsGradlePluginIT.kt @@ -127,6 +127,47 @@ class Kotlin2JsGradlePluginIT : AbstractKotlin2JsGradlePluginIT(false) { return super.defaultBuildOptions().copy(warningMode = WarningMode.Summary) } + @Test + fun testIncrementalCompilation() = Project("kotlin2JsICProject").run { + setupWorkingDir() + val modules = listOf("app", "lib") + val mainFiles = modules.flatMapTo(LinkedHashSet()) { + projectDir.resolve("$it/src/main").allKotlinFiles() + } + + build("build") { + assertSuccessful() + checkIrCompilationMessage() + assertContains(USING_JS_INCREMENTAL_COMPILATION_MESSAGE) + if (irBackend) { + assertCompiledKotlinSources(project.relativize(mainFiles)) + } else { + assertCompiledKotlinSources(project.relativize(allKotlinFiles)) + } + } + + build("build") { + assertSuccessful() + assertCompiledKotlinSources(emptyList()) + } + + projectFile("A.kt").modify { + it.replace("val x = 0", "val x = \"a\"") + } + build("build") { + assertSuccessful() + checkIrCompilationMessage() + assertContains(USING_JS_INCREMENTAL_COMPILATION_MESSAGE) + val affectedFiles = project.projectDir.getFilesByNames("A.kt", "useAInLibMain.kt", "useAInAppMain.kt", "useAInAppTest.kt") + if (irBackend) { + // only klib ic is supported for now, so tests are generated non-incrementally with ir backend + assertCompiledKotlinSources(project.relativize(affectedFiles.filter { it in mainFiles })) + } else { + assertCompiledKotlinSources(project.relativize(affectedFiles)) + } + } + } + @Test fun testKotlinJsBuiltins() { val project = Project("kotlinBuiltins") @@ -257,7 +298,7 @@ class Kotlin2JsGradlePluginIT : AbstractKotlin2JsGradlePluginIT(false) { } } -abstract class AbstractKotlin2JsGradlePluginIT(private val irBackend: Boolean) : BaseGradleIT() { +abstract class AbstractKotlin2JsGradlePluginIT(val irBackend: Boolean) : BaseGradleIT() { override fun defaultBuildOptions(): BuildOptions = super.defaultBuildOptions().copy( jsIrBackend = irBackend, @@ -284,10 +325,12 @@ abstract class AbstractKotlin2JsGradlePluginIT(private val irBackend: Boolean) : val jarPath = "build/libs/kotlin2JsNoOutputFileProject.jar" assertFileExists(jarPath) val jar = ZipFile(fileInWorkingDir(jarPath)) - assertEquals( - 1, jar.entries().asSequence().count { it.name == "kotlin2JsNoOutputFileProject.js" }, - "The jar should contain an entry `kotlin2JsNoOutputFileProject.js` with no duplicates" - ) + if (!irBackend) { + assertEquals( + 1, jar.entries().asSequence().count { it.name == "kotlin2JsNoOutputFileProject.js" }, + "The jar should contain an entry `kotlin2JsNoOutputFileProject.js` with no duplicates" + ) + } } } @@ -327,9 +370,7 @@ abstract class AbstractKotlin2JsGradlePluginIT(private val irBackend: Boolean) : project.build("build") { assertSuccessful() checkIrCompilationMessage() - if (irBackend) { - assertFileExists(kotlinClassesDir() + "default/manifest") - } else { + if (!irBackend) { assertFileExists(kotlinClassesDir() + "kotlin2JsNoOutputFileProject.js") } assertFileExists(kotlinClassesDir(sourceSet = "test") + "kotlin2JsNoOutputFileProject_test.js") @@ -445,47 +486,6 @@ abstract class AbstractKotlin2JsGradlePluginIT(private val irBackend: Boolean) : } } - @Test - fun testIncrementalCompilation() = Project("kotlin2JsICProject").run { - setupWorkingDir() - val modules = listOf("app", "lib") - val mainFiles = modules.flatMapTo(LinkedHashSet()) { - projectDir.resolve("$it/src/main").allKotlinFiles() - } - - build("build") { - assertSuccessful() - checkIrCompilationMessage() - assertContains(USING_JS_INCREMENTAL_COMPILATION_MESSAGE) - if (irBackend) { - assertCompiledKotlinSources(project.relativize(mainFiles)) - } else { - assertCompiledKotlinSources(project.relativize(allKotlinFiles)) - } - } - - build("build") { - assertSuccessful() - assertCompiledKotlinSources(emptyList()) - } - - projectFile("A.kt").modify { - it.replace("val x = 0", "val x = \"a\"") - } - build("build") { - assertSuccessful() - checkIrCompilationMessage() - assertContains(USING_JS_INCREMENTAL_COMPILATION_MESSAGE) - val affectedFiles = project.projectDir.getFilesByNames("A.kt", "useAInLibMain.kt", "useAInAppMain.kt", "useAInAppTest.kt") - if (irBackend) { - // only klib ic is supported for now, so tests are generated non-incrementally with ir backend - assertCompiledKotlinSources(project.relativize(affectedFiles.filter { it in mainFiles })) - } else { - assertCompiledKotlinSources(project.relativize(affectedFiles)) - } - } - } - @Test fun testIncrementalCompilationDisabled() = Project("kotlin2JsICProject").run { val options = defaultBuildOptions().run { diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/kotlin2JsNoOutputFileProject/build.gradle b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/kotlin2JsNoOutputFileProject/build.gradle index f72cdd7d48e..60ce4bbed01 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/kotlin2JsNoOutputFileProject/build.gradle +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/resources/testProject/kotlin2JsNoOutputFileProject/build.gradle @@ -20,6 +20,6 @@ dependencies { } if (project.findProperty("kotlin.js.useIrBackend")?.toBoolean() == true) { - compileKotlin2Js.kotlinOptions.freeCompilerArgs += ["-Xir-produce-klib-dir", "-Xir-produce-js", "-Xir-only"] + compileKotlin2Js.kotlinOptions.freeCompilerArgs += ["-Xir-produce-klib-dir", "-Xir-only"] compileTestKotlin2Js.kotlinOptions.freeCompilerArgs += ["-Xir-produce-js"] } \ No newline at end of file diff --git a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/KotlinPlugin.kt b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/KotlinPlugin.kt index 18a84b1e0c0..2195f8c040f 100755 --- a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/KotlinPlugin.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/KotlinPlugin.kt @@ -262,8 +262,13 @@ internal class Kotlin2JsSourceSetProcessor( // outputFile can be set later during the configuration phase, get it only after the phase: project.whenEvaluated { kotlinTask.configure { kotlinTaskInstance -> - kotlinTaskInstance.kotlinOptions.outputFile = kotlinTaskInstance.outputFile.absolutePath - val outputDir = kotlinTaskInstance.outputFile.parentFile + val kotlinOptions = kotlinTaskInstance.kotlinOptions + val outputDir: File = kotlinTaskInstance.outputFile.parentFile + kotlinOptions.outputFile = if (!kotlinOptions.isProduceUnzippedKlib()) { + kotlinTaskInstance.outputFile.absolutePath + } else { + kotlinTaskInstance.outputFile.parentFile.absolutePath + } if (outputDir.isParentOf(project.rootDir)) throw InvalidUserDataException( "The output directory '$outputDir' (defined by outputFile of $kotlinTaskInstance) contains or " + @@ -272,6 +277,20 @@ internal class Kotlin2JsSourceSetProcessor( "To fix this, consider using the default outputFile location instead of providing it explicitly." ) kotlinTaskInstance.destinationDir = outputDir + + if ( + kotlinOptions.freeCompilerArgs.contains(PRODUCE_JS) || + kotlinOptions.freeCompilerArgs.contains(PRODUCE_UNZIPPED_KLIB) || + kotlinOptions.freeCompilerArgs.contains(PRODUCE_ZIPPED_KLIB) + ) { + // Configure FQ module name to avoid cyclic dependencies in klib manifests (see KT-36721). + val baseName = if (kotlinCompilation.isMain()) { + project.name + } else { + "${project.name}_${kotlinCompilation.name}" + } + kotlinTaskInstance.kotlinOptions.freeCompilerArgs += "$MODULE_NAME=${project.klibModuleName(baseName)}" + } } val subpluginEnvironment: SubpluginEnvironment = SubpluginEnvironment.loadSubplugins(project, kotlinPluginVersion) diff --git a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/tasks/Tasks.kt b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/tasks/Tasks.kt index 70f86a47020..9509274f7e0 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/tasks/Tasks.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/tasks/Tasks.kt @@ -43,6 +43,7 @@ import org.jetbrains.kotlin.gradle.plugin.mpp.AbstractKotlinCompilation import org.jetbrains.kotlin.gradle.plugin.mpp.associateWithTransitiveClosure import org.jetbrains.kotlin.gradle.plugin.mpp.ownModuleName import org.jetbrains.kotlin.gradle.report.ReportingSettings +import org.jetbrains.kotlin.gradle.targets.js.ir.isProduceUnzippedKlib import org.jetbrains.kotlin.gradle.utils.* import org.jetbrains.kotlin.incremental.ChangedFiles import org.jetbrains.kotlin.library.impl.isKotlinLibrary @@ -276,7 +277,7 @@ abstract class AbstractKotlinCompile() : AbstractKo // Input is needed to force rebuild even if source files are not changed @get:Input - internal val coroutinesStr: Provider = project.provider {coroutines.get().name} + internal val coroutinesStr: Provider = project.provider { coroutines.get().name } @get:Input internal val coroutines: Provider = project.provider { @@ -397,7 +398,11 @@ abstract class AbstractKotlinCompile() : AbstractKo internal val isMultiplatform: Boolean by lazy { project.plugins.any { it is KotlinPlatformPluginBase || it is KotlinMultiplatformPluginWrapper } } @get:Internal - internal val abstractKotlinCompileArgumentsContributor by lazy { AbstractKotlinCompileArgumentsContributor(KotlinCompileArgumentsProvider(this)) } + internal val abstractKotlinCompileArgumentsContributor by lazy { + AbstractKotlinCompileArgumentsContributor( + KotlinCompileArgumentsProvider(this) + ) + } override fun setupCompilerArgs(args: T, defaultsOnly: Boolean, ignoreClasspathResolutionErrors: Boolean) { abstractKotlinCompileArgumentsContributor.contributeArguments( @@ -496,10 +501,12 @@ open class KotlinCompile : AbstractKotlinCompile(), Kotl K2JVMCompilerArguments() override fun setupCompilerArgs(args: K2JVMCompilerArguments, defaultsOnly: Boolean, ignoreClasspathResolutionErrors: Boolean) { - compilerArgumentsContributor.contributeArguments(args, compilerArgumentsConfigurationFlags( - defaultsOnly, - ignoreClasspathResolutionErrors - )) + compilerArgumentsContributor.contributeArguments( + args, compilerArgumentsConfigurationFlags( + defaultsOnly, + ignoreClasspathResolutionErrors + ) + ) } @get:Internal @@ -635,23 +642,19 @@ open class Kotlin2JsCompile : AbstractKotlinCompile(), Ko @get:Internal val outputFile: File - get() = outputFilePath?.let(::File) ?: defaultOutputFile + get() = kotlinOptions.outputFile?.let(::File) ?: defaultOutputFile @get:OutputFile @get:Optional val outputFileOrNull: File? get() = outputFile.let { file -> - if (file.isFile) { + if (!kotlinOptions.isProduceUnzippedKlib()) { file } else { null } } - @get:Input - val outputFilePath: String? - get() = kotlinOptions.outputFile - override fun findKotlinCompilerClasspath(project: Project): List = findKotlinJsCompilerClasspath(project) From 3140cca05038205aa732683fb1202b992b6f8def Mon Sep 17 00:00:00 2001 From: Dmitry Petrov Date: Thu, 14 Jan 2021 17:08:17 +0300 Subject: [PATCH 163/212] JVM_IR indy-SAM conversions, 1st passing tests KT-44278 KT-26060 KT-42621 --- .../kotlin/codegen/state/GenerationState.kt | 8 + .../arguments/K2JVMCompilerArguments.kt | 9 + .../jetbrains/kotlin/cli/jvm/jvmArguments.kt | 24 ++- .../kotlin/config/JVMConfigurationKeys.java | 3 + .../kotlin/config/JvmSamConversions.kt | 23 +++ .../FirBlackBoxCodegenTestGenerated.java | 68 +++++++ .../declarations/declarationBuilders.kt | 33 ++-- .../jvm/JvmLoweredDeclarationOrigin.kt | 1 + .../kotlin/backend/jvm/JvmSymbols.kt | 88 ++++++++- .../backend/jvm/codegen/ExpressionCodegen.kt | 2 +- .../jvm/codegen/MethodSignatureMapper.kt | 19 +- .../jvm/intrinsics/IrIntrinsicMethods.kt | 1 + .../jvm/intrinsics/JvmInvokeDynamic.kt | 133 +++++++++++++ .../jvm/lower/FunctionReferenceLowering.kt | 81 ++++++-- ...eDeclarationsThatWouldBeInlinedLowering.kt | 2 - .../backend/jvm/lower/TypeOperatorLowering.kt | 184 +++++++++++++++++- .../kotlin/ir/builders/ExpressionHelpers.kt | 6 + .../kotlin/ir/util/RenderIrElement.kt | 3 + .../box/invokedynamic/sam/boundReference.kt | 23 +++ .../sam/capturedDispatchReceiver.kt | 20 ++ .../sam/capturedExtensionReceiver.kt | 20 ++ .../sam/capturingIndyFunInterface.kt | 20 ++ .../box/invokedynamic/sam/capturingIndySam.kt | 18 ++ .../sam/primitiveVsWrapperInSam.kt | 46 +++++ .../sam/simpleIndyFunInterface.kt | 18 ++ .../box/invokedynamic/sam/simpleIndySam.kt | 17 ++ .../codegen/BlackBoxCodegenTestGenerated.java | 68 +++++++ .../IrBlackBoxCodegenTestGenerated.java | 68 +++++++ .../test/directives/CodegenTestDirectives.kt | 3 + .../AbstractJvmBlackBoxCodegenTestBase.kt | 11 ++ .../JvmEnvironmentConfigurator.kt | 1 + .../kotlin/codegen/CodegenTestCase.java | 11 -- .../LightAnalysisModeTestGenerated.java | 66 +++++++ .../IrJsCodegenBoxES6TestGenerated.java | 26 +++ .../IrJsCodegenBoxTestGenerated.java | 26 +++ .../semantics/JsCodegenBoxTestGenerated.java | 26 +++ .../IrCodegenBoxWasmTestGenerated.java | 26 +++ 37 files changed, 1144 insertions(+), 58 deletions(-) create mode 100644 compiler/config.jvm/src/org/jetbrains/kotlin/config/JvmSamConversions.kt create mode 100644 compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/intrinsics/JvmInvokeDynamic.kt create mode 100644 compiler/testData/codegen/box/invokedynamic/sam/boundReference.kt create mode 100644 compiler/testData/codegen/box/invokedynamic/sam/capturedDispatchReceiver.kt create mode 100644 compiler/testData/codegen/box/invokedynamic/sam/capturedExtensionReceiver.kt create mode 100644 compiler/testData/codegen/box/invokedynamic/sam/capturingIndyFunInterface.kt create mode 100644 compiler/testData/codegen/box/invokedynamic/sam/capturingIndySam.kt create mode 100644 compiler/testData/codegen/box/invokedynamic/sam/primitiveVsWrapperInSam.kt create mode 100644 compiler/testData/codegen/box/invokedynamic/sam/simpleIndyFunInterface.kt create mode 100644 compiler/testData/codegen/box/invokedynamic/sam/simpleIndySam.kt diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/state/GenerationState.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/state/GenerationState.kt index ddc5fc3e414..ae7ffae8b83 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/state/GenerationState.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/state/GenerationState.kt @@ -207,6 +207,14 @@ class GenerationState private constructor( configuration.get(JVMConfigurationKeys.STRING_CONCAT) ?: JvmStringConcat.INLINE else JvmStringConcat.INLINE + val samConversionsScheme = run { + val fromConfig = configuration.get(JVMConfigurationKeys.SAM_CONVERSIONS) ?: JvmSamConversions.DEFAULT + if (target >= fromConfig.minJvmTarget) + fromConfig + else + JvmSamConversions.DEFAULT + } + val moduleName: String = moduleName ?: JvmCodegenUtil.getModuleName(module) val classBuilderMode: ClassBuilderMode = builderFactory.classBuilderMode val bindingTrace: BindingTrace = DelegatingBindingTrace( diff --git a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.kt b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.kt index b31275c493d..cd7237ce2ad 100644 --- a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.kt +++ b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.kt @@ -362,6 +362,15 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { ) var stringConcat: String? by NullableStringFreezableVar(JvmStringConcat.INLINE.description) + @Argument( + value = "-Xsam-conversions", + valueDescription = "{class|indy}", + description = """Select code generation scheme for SAM conversions. +-Xsam-conversions=indy Generate SAM conversions using `invokedynamic` with `LambdaMetafactory.metafactory`. Requires `-jvm-target 8` or greater. +-Xsam-conversions=class Generate SAM conversions as explicit classes""" + ) + var samConversions: String? by NullableStringFreezableVar(JvmSamConversions.CLASS.description) + @Argument( value = "-Xklib", valueDescription = "", diff --git a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/jvmArguments.kt b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/jvmArguments.kt index c904fce6bf4..3cbe6cc8780 100644 --- a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/jvmArguments.kt +++ b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/jvmArguments.kt @@ -59,8 +59,28 @@ fun CompilerConfiguration.setupJvmSpecificArguments(arguments: K2JVMCompilerArgu } } else { messageCollector.report( - ERROR, "Unknown -Xstring-concat mode: ${arguments.jvmTarget}\n" + - "Supported versions: ${JvmStringConcat.values().joinToString { it.description }}" + ERROR, "Unknown `-Xstring-concat` mode: ${arguments.stringConcat}\n" + + "Supported modes: ${JvmStringConcat.values().joinToString { it.description }}" + ) + } + } + + if (arguments.samConversions != null) { + val samConversions = JvmSamConversions.fromString(arguments.samConversions) + if (samConversions != null) { + put(JVMConfigurationKeys.SAM_CONVERSIONS, samConversions) + if (jvmTarget < samConversions.minJvmTarget) { + messageCollector.report( + WARNING, + "`-Xsam-conversions=${arguments.samConversions}` requires JVM target at least " + + "${samConversions.minJvmTarget.description} and is ignored." + ) + } + } else { + messageCollector.report( + ERROR, + "Unknown `-Xsam-conversions` argument: ${arguments.samConversions}\n" + + "Supported arguments: ${JvmSamConversions.values().joinToString { it.description }}" ) } } diff --git a/compiler/config.jvm/src/org/jetbrains/kotlin/config/JVMConfigurationKeys.java b/compiler/config.jvm/src/org/jetbrains/kotlin/config/JVMConfigurationKeys.java index b8e6870b0a6..b1c11d8f696 100644 --- a/compiler/config.jvm/src/org/jetbrains/kotlin/config/JVMConfigurationKeys.java +++ b/compiler/config.jvm/src/org/jetbrains/kotlin/config/JVMConfigurationKeys.java @@ -114,6 +114,9 @@ public class JVMConfigurationKeys { public static final CompilerConfigurationKey STRING_CONCAT = CompilerConfigurationKey.create("Specifies string concatenation scheme"); + public static final CompilerConfigurationKey SAM_CONVERSIONS = + CompilerConfigurationKey.create("SAM conversions code generation scheme"); + public static final CompilerConfigurationKey> KLIB_PATHS = CompilerConfigurationKey.create("Paths to .klib libraries"); diff --git a/compiler/config.jvm/src/org/jetbrains/kotlin/config/JvmSamConversions.kt b/compiler/config.jvm/src/org/jetbrains/kotlin/config/JvmSamConversions.kt new file mode 100644 index 00000000000..3ed25ea0b7f --- /dev/null +++ b/compiler/config.jvm/src/org/jetbrains/kotlin/config/JvmSamConversions.kt @@ -0,0 +1,23 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.config + +enum class JvmSamConversions( + val description: String, + val minJvmTarget: JvmTarget +) { + CLASS("class", JvmTarget.JVM_1_6), + INDY("indy", JvmTarget.JVM_1_8), + ; + + companion object { + val DEFAULT = CLASS + + @JvmStatic + fun fromString(string: String?) = + values().find { it.description == string } + } +} \ No newline at end of file diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java index 48f5ada576c..ca2c208fc61 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java @@ -18379,6 +18379,74 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT } } + @Nested + @TestMetadata("compiler/testData/codegen/box/invokedynamic") + @TestDataPath("$PROJECT_ROOT") + public class Invokedynamic extends AbstractFirBlackBoxCodegenTest { + @Test + public void testAllFilesPresentInInvokedynamic() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Nested + @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam") + @TestDataPath("$PROJECT_ROOT") + public class Sam extends AbstractFirBlackBoxCodegenTest { + @Test + public void testAllFilesPresentInSam() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("boundReference.kt") + public void testBoundReference() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/boundReference.kt"); + } + + @Test + @TestMetadata("capturedDispatchReceiver.kt") + public void testCapturedDispatchReceiver() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/capturedDispatchReceiver.kt"); + } + + @Test + @TestMetadata("capturedExtensionReceiver.kt") + public void testCapturedExtensionReceiver() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/capturedExtensionReceiver.kt"); + } + + @Test + @TestMetadata("capturingIndyFunInterface.kt") + public void testCapturingIndyFunInterface() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/capturingIndyFunInterface.kt"); + } + + @Test + @TestMetadata("capturingIndySam.kt") + public void testCapturingIndySam() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/capturingIndySam.kt"); + } + + @Test + @TestMetadata("primitiveVsWrapperInSam.kt") + public void testPrimitiveVsWrapperInSam() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/primitiveVsWrapperInSam.kt"); + } + + @Test + @TestMetadata("simpleIndyFunInterface.kt") + public void testSimpleIndyFunInterface() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/simpleIndyFunInterface.kt"); + } + + @Test + @TestMetadata("simpleIndySam.kt") + public void testSimpleIndySam() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/simpleIndySam.kt"); + } + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/ir") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/ir/backend.common/src/org/jetbrains/kotlin/ir/builders/declarations/declarationBuilders.kt b/compiler/ir/backend.common/src/org/jetbrains/kotlin/ir/builders/declarations/declarationBuilders.kt index 546b0615482..f98360eeb14 100644 --- a/compiler/ir/backend.common/src/org/jetbrains/kotlin/ir/builders/declarations/declarationBuilders.kt +++ b/compiler/ir/backend.common/src/org/jetbrains/kotlin/ir/builders/declarations/declarationBuilders.kt @@ -65,7 +65,11 @@ fun IrClass.addField(fieldName: Name, fieldType: IrType, fieldVisibility: Descri visibility = fieldVisibility } -fun IrClass.addField(fieldName: String, fieldType: IrType, fieldVisibility: DescriptorVisibility = DescriptorVisibilities.PRIVATE): IrField = +fun IrClass.addField( + fieldName: String, + fieldType: IrType, + fieldVisibility: DescriptorVisibility = DescriptorVisibilities.PRIVATE +): IrField = addField(Name.identifier(fieldName), fieldType, fieldVisibility) @PublishedApi @@ -141,16 +145,16 @@ inline fun IrClass.addFunction(builder: IrFunctionBuilder.() -> Unit): IrSimpleF factory.addFunction(this, builder) fun IrClass.addFunction( - name: String, - returnType: IrType, - modality: Modality = Modality.FINAL, - visibility: DescriptorVisibility = DescriptorVisibilities.PUBLIC, - isStatic: Boolean = false, - isSuspend: Boolean = false, - isFakeOverride: Boolean = false, - origin: IrDeclarationOrigin = IrDeclarationOrigin.DEFINED, - startOffset: Int = UNDEFINED_OFFSET, - endOffset: Int = UNDEFINED_OFFSET + name: String, + returnType: IrType, + modality: Modality = Modality.FINAL, + visibility: DescriptorVisibility = DescriptorVisibilities.PUBLIC, + isStatic: Boolean = false, + isSuspend: Boolean = false, + isFakeOverride: Boolean = false, + origin: IrDeclarationOrigin = IrDeclarationOrigin.DEFINED, + startOffset: Int = UNDEFINED_OFFSET, + endOffset: Int = UNDEFINED_OFFSET ): IrSimpleFunction = addFunction { this.startOffset = startOffset @@ -216,7 +220,7 @@ internal fun IrFactory.buildValueParameter(builder: IrValueParameterBuilder, par inline fun buildValueParameter(declaration: D, builder: IrValueParameterBuilder.() -> Unit): IrValueParameter - where D : IrDeclaration, D : IrDeclarationParent = + where D : IrDeclaration, D : IrDeclarationParent = IrValueParameterBuilder().run { builder() declaration.factory.buildValueParameter(this, declaration) @@ -234,8 +238,11 @@ inline fun IrFunction.addValueParameter(builder: IrValueParameterBuilder.() -> U } fun IrFunction.addValueParameter(name: String, type: IrType, origin: IrDeclarationOrigin = IrDeclarationOrigin.DEFINED): IrValueParameter = + addValueParameter(Name.identifier(name), type, origin) + +fun IrFunction.addValueParameter(name: Name, type: IrType, origin: IrDeclarationOrigin = IrDeclarationOrigin.DEFINED): IrValueParameter = addValueParameter { - this.name = Name.identifier(name) + this.name = name this.type = type this.origin = origin } diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmLoweredDeclarationOrigin.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmLoweredDeclarationOrigin.kt index d1e7d1e1558..af7fa624ab6 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmLoweredDeclarationOrigin.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmLoweredDeclarationOrigin.kt @@ -46,4 +46,5 @@ interface JvmLoweredDeclarationOrigin : IrDeclarationOrigin { object COMPANION_PROPERTY_BACKING_FIELD : IrDeclarationOriginImpl("COMPANION_PROPERTY_BACKING_FIELD") object FIELD_FOR_STATIC_CALLABLE_REFERENCE_INSTANCE : IrDeclarationOriginImpl("FIELD_FOR_STATIC_CALLABLE_REFERENCE_INSTANCE") object ABSTRACT_BRIDGE_STUB : IrDeclarationOriginImpl("ABSTRACT_BRIDGE_STUB") + object INVOVEDYNAMIC_CALL_TARGET : IrDeclarationOriginImpl("INVOVEDYNAMIC_CALL_TARGET") } diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmSymbols.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmSymbols.kt index 2e1c2c6131b..ba61122d72f 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmSymbols.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmSymbols.kt @@ -8,7 +8,6 @@ package org.jetbrains.kotlin.backend.jvm import org.jetbrains.kotlin.backend.common.ir.Symbols -import org.jetbrains.kotlin.backend.common.ir.addChild import org.jetbrains.kotlin.backend.common.ir.createImplicitParameterDeclarationWithWrappedDescriptor import org.jetbrains.kotlin.backend.jvm.intrinsics.IrIntrinsicMethods import org.jetbrains.kotlin.builtins.StandardNames @@ -51,6 +50,17 @@ class JvmSymbols( private val kotlinReflectPackage: IrPackageFragment = createPackage(FqName("kotlin.reflect")) private val javaLangPackage: IrPackageFragment = createPackage(FqName("java.lang")) + // Special package for functions representing dynamic symbols referenced by 'INVOKEDYNAMIC' instruction - e.g., + // 'get(Ljava/lang/String;)Ljava/util/function/Supplier;' + // in + // INVOKEDYNAMIC get(Ljava/lang/String;)Ljava/util/function/Supplier; [ + // H_INVOKESTATIC java/lang/invoke/LambdaMetafactory.metafactory(...)Ljava/lang/invoke/CallSite; + // ... + // ] + // Such functions don't exist as methods in the actual bytecode + // (they are expected to be provided at run-time by the corresponding bootstrap method). + val kotlinJvmInternalInvokeDynamicPackage: IrPackageFragment = createPackage(FqName("kotlin.jvm.internal.invokeDynamic")) + private val generateOptimizedCallableReferenceSuperClasses = context.state.generateOptimizedCallableReferenceSuperClasses private fun createPackage(fqName: FqName): IrPackageFragment = @@ -535,6 +545,82 @@ class JvmSymbols( returnType = dst.defaultType }.symbol + val indySamConversionIntrinsic: IrSimpleFunctionSymbol = + irFactory.buildFun { + name = Name.special("") + origin = IrDeclarationOrigin.IR_BUILTINS_STUB + }.apply { + parent = kotlinJvmInternalPackage + val samType = addTypeParameter("SAM_TYPE", irBuiltIns.anyType) + addValueParameter("method", irBuiltIns.anyNType) + returnType = samType.defaultType + }.symbol + + val arrayOfAnyType = irBuiltIns.arrayClass.typeWith(irBuiltIns.anyType) + + // Intrinsic to represent INVOKEDYNAMIC calls in IR. + // fun ``( + // dynamicCall: T, + // bootstrapMethodTag: Int, + // bootstrapMethodOwner: String, + // bootstrapMethodName: String, + // bootstrapMethodDesc: String, + // vararg bootstrapMethodArgs: Any + // ): T + // Bootstrap method handle is encoded as a bunch of constants. + // For example, + // REF_invokeStatic java/lang/invoke/LambdaMetafactory.metafactory:( + // Ljava/lang/invoke/MethodHandles$Lookup; + // Ljava/lang/String; + // Ljava/lang/invoke/MethodType; + // Ljava/lang/invoke/MethodType; + // Ljava/lang/invoke/MethodHandle; + // Ljava/lang/invoke/MethodType; + // )Ljava/lang/invoke/CallSite; + // is represented as + // bootstrapMethodTag: IrConst(value = H_INVOKESTATIC) + // bootstrapMethodOwner: IrConst(value = "java/lang/invoke/LambdaMetafactory") + // bootstrapMethodName: IrConst(value = "metafactory") + // bootstrapMethodDesc: IrConst(value = "(...)Ljava/lang/invoke/CallSite;") + // Bootstrap method owner is assumed to be a class (which is true for both LambdaMetafactory and StringConcatFactory). + val jvmIndyIntrinsic: IrSimpleFunctionSymbol = + irFactory.buildFun { + name = Name.special("") + origin = IrDeclarationOrigin.IR_BUILTINS_STUB + }.apply { + parent = kotlinJvmInternalPackage + val t = addTypeParameter("T", irBuiltIns.anyNType) + addValueParameter("dynamicCall", t.defaultType) + addValueParameter("bootstrapMethodTag", irBuiltIns.intType) + addValueParameter("bootstrapMethodOwner", irBuiltIns.stringType) + addValueParameter("bootstrapMethodName", irBuiltIns.stringType) + addValueParameter("bootstrapMethodDesc", irBuiltIns.stringType) + addValueParameter { + name = Name.identifier("bootstrapMethodArguments") + type = arrayOfAnyType + varargElementType = irBuiltIns.anyType + } + returnType = t.defaultType + }.symbol + + // Intrinsic used to represent MethodType objects in bootstrap method arguments (see jvmInvokeDynamicIntrinsic above). + // Type argument is a possibly substituted method owner type (e.g., 'java.lang.function.Supplier'). + // Value argument is a raw function reference to a corresponding method (e.g., 'java.lang.function.Supplier#get'). + val jvmMethodTypeIntrinsic: IrSimpleFunctionSymbol = + irFactory.buildFun { + name = Name.special("") + origin = IrDeclarationOrigin.IR_BUILTINS_STUB + }.apply { + parent = kotlinJvmInternalPackage + addTypeParameter("OwnerT", irBuiltIns.anyType) + addValueParameter("method", irBuiltIns.anyType) + returnType = irBuiltIns.anyType + }.symbol + + val flexibleNullabilityAnnotationFqName = JvmGeneratorExtensions.FLEXIBLE_NULLABILITY_ANNOTATION_FQ_NAME + val enhancedNullabilityAnnotationFqName = JvmGeneratorExtensions.ENHANCED_NULLABILITY_ANNOTATION_FQ_NAME + val rawTypeAnnotationFQN = JvmGeneratorExtensions.RAW_TYPE_ANNOTATION_FQ_NAME + private val collectionToArrayClass: IrClassSymbol = createClass(FqName("kotlin.jvm.internal.CollectionToArray")) { klass -> klass.origin = JvmLoweredDeclarationOrigin.TO_ARRAY diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/ExpressionCodegen.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/ExpressionCodegen.kt index 67d2bdb3462..70dafe7c487 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/ExpressionCodegen.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/ExpressionCodegen.kt @@ -418,7 +418,7 @@ class ExpressionCodegen( val callee = expression.symbol.owner require(callee.parent is IrClass) { "Unhandled intrinsic in ExpressionCodegen: ${callee.render()}" } - val callable = methodSignatureMapper.mapToCallableMethod(irFunction, expression) + val callable = methodSignatureMapper.mapToCallableMethod(expression, irFunction) val callGenerator = getOrCreateCallGenerator(expression, data, callable.signature) val isSuspensionPoint = expression.isSuspensionPoint() diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/MethodSignatureMapper.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/MethodSignatureMapper.kt index f8b66fff13f..30b0ad3cb90 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/MethodSignatureMapper.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/MethodSignatureMapper.kt @@ -366,7 +366,8 @@ class MethodSignatureMapper(private val context: JvmBackendContext) { if (valueArgumentsCount > 0) (getValueArgument(0) as? IrConst<*>)?.value as? Boolean ?: true else null } - fun mapToCallableMethod(caller: IrFunction, expression: IrCall): IrCallableMethod { + // TODO get rid of 'caller' argument + internal fun mapToCallableMethod(expression: IrCall, caller: IrFunction?): IrCallableMethod { val callee = expression.symbol.owner val calleeParent = expression.superQualifierSymbol?.owner ?: expression.dispatchReceiver?.type?.classOrNull?.owner @@ -385,17 +386,21 @@ class MethodSignatureMapper(private val context: JvmBackendContext) { } val declaration = findSuperDeclaration(callee, isSuperCall) - val signature = mapOverriddenSpecialBuiltinIfNeeded(caller, declaration, isSuperCall) - ?: mapSignatureSkipGeneric(declaration) + val signature = + if (caller != null && caller.isBridge()) { + // Do not remap special builtin methods when called from a bridge. The bridges are there to provide the + // remapped name or signature and forward to the actually declared method. + mapSignatureSkipGeneric(declaration) + } else { + mapOverriddenSpecialBuiltinIfNeeded(declaration, isSuperCall) + ?: mapSignatureSkipGeneric(declaration) + } return IrCallableMethod(owner, invokeOpcode, signature, isInterface) } // TODO: get rid of this (probably via some special lowering) - private fun mapOverriddenSpecialBuiltinIfNeeded(caller: IrFunction, callee: IrFunction, superCall: Boolean): JvmMethodSignature? { - // Do not remap special builtin methods when called from a bridge. The bridges are there to provide the - // remapped name or signature and forward to the actually declared method. - if (caller.isBridge()) return null + private fun mapOverriddenSpecialBuiltinIfNeeded(callee: IrFunction, superCall: Boolean): JvmMethodSignature? { // Do not remap calls to static replacements of inline class methods, since they have completely different signatures. if (callee.isStaticInlineClassReplacement) return null val overriddenSpecialBuiltinFunction = diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/intrinsics/IrIntrinsicMethods.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/intrinsics/IrIntrinsicMethods.kt index 0b7e992bdfd..bce051b46e4 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/intrinsics/IrIntrinsicMethods.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/intrinsics/IrIntrinsicMethods.kt @@ -120,6 +120,7 @@ class IrIntrinsicMethods(val irBuiltIns: IrBuiltIns, val symbols: JvmSymbols) { symbols.throwTypeCastException.toKey()!! to ThrowException(Type.getObjectType("kotlin/TypeCastException")), symbols.throwUnsupportedOperationException.toKey()!! to ThrowException(Type.getObjectType("java/lang/UnsupportedOperationException")), symbols.throwKotlinNothingValueException.toKey()!! to ThrowKotlinNothingValueException, + symbols.jvmIndyIntrinsic.toKey()!! to JvmInvokeDynamic ) + numberConversionMethods() + unaryFunForPrimitives("plus", UnaryPlus) + diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/intrinsics/JvmInvokeDynamic.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/intrinsics/JvmInvokeDynamic.kt new file mode 100644 index 00000000000..f00c00d6f93 --- /dev/null +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/intrinsics/JvmInvokeDynamic.kt @@ -0,0 +1,133 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.backend.jvm.intrinsics + +import org.jetbrains.kotlin.backend.jvm.JvmLoweredDeclarationOrigin +import org.jetbrains.kotlin.backend.jvm.codegen.* +import org.jetbrains.kotlin.codegen.inline.v +import org.jetbrains.kotlin.ir.expressions.* +import org.jetbrains.kotlin.ir.util.dump +import org.jetbrains.kotlin.ir.util.parentAsClass +import org.jetbrains.kotlin.ir.util.render +import org.jetbrains.kotlin.utils.addToStdlib.safeAs +import org.jetbrains.org.objectweb.asm.Handle +import org.jetbrains.org.objectweb.asm.Opcodes +import org.jetbrains.org.objectweb.asm.Type + +object JvmInvokeDynamic : IntrinsicMethod() { + override fun invoke(expression: IrFunctionAccessExpression, codegen: ExpressionCodegen, data: BlockInfo): PromisedValue { + fun fail(message: String): Nothing = + throw AssertionError("$message; expression:\n${expression.dump()}") + + val dynamicCall = expression.getValueArgument(0) as? IrCall + ?: fail("'dynamicCall' is expected to be a call") + val dynamicCallee = dynamicCall.symbol.owner + if (dynamicCallee.parent != codegen.context.ir.symbols.kotlinJvmInternalInvokeDynamicPackage || + dynamicCallee.origin != JvmLoweredDeclarationOrigin.INVOVEDYNAMIC_CALL_TARGET + ) + fail("Unexpected dynamicCallee: '${dynamicCallee.render()}'") + + val bootstrapMethodTag = expression.getValueArgument(1)?.getIntConst() + ?: fail("'bootstrapMethodTag' is expected to be an int const") + val bootstrapMethodOwner = expression.getValueArgument(2)?.getStringConst() + ?: fail("'bootstrapMethodOwner' is expected to be a string const") + val bootstrapMethodName = expression.getValueArgument(3)?.getStringConst() + ?: fail("'bootstrapMethodName' is expected to be a string const") + val bootstrapMethodDesc = expression.getValueArgument(4)?.getStringConst() + ?: fail("'bootstrapMethodDesc' is expected to be a string const") + val bootstrapMethodArgs = (expression.getValueArgument(5)?.safeAs() + ?: fail("'bootstrapMethodArgs' is expected to be a vararg")) + + val asmBootstrapMethodArgs = bootstrapMethodArgs.elements + .map { generateBootstrapMethodArg(it, codegen) } + .toTypedArray() + + val dynamicCalleeMethod = codegen.methodSignatureMapper.mapAsmMethod(dynamicCallee) + val bootstrapMethodHandle = Handle(bootstrapMethodTag, bootstrapMethodOwner, bootstrapMethodName, bootstrapMethodDesc, false) + + val dynamicCallGenerator = IrCallGenerator.DefaultCallGenerator + val dynamicCalleeArgumentTypes = dynamicCalleeMethod.argumentTypes + for (i in dynamicCallee.valueParameters.indices) { + val dynamicCalleeParameter = dynamicCallee.valueParameters[i] + val dynamicCalleeArgument = dynamicCall.getValueArgument(i) + ?: fail("No argument #$i in 'dynamicCall'") + val dynamicCalleeArgumentType = dynamicCalleeArgumentTypes.getOrElse(i) { + fail("No argument type #$i in dynamic callee: $dynamicCalleeMethod") + } + dynamicCallGenerator.genValueAndPut(dynamicCalleeParameter, dynamicCalleeArgument, dynamicCalleeArgumentType, codegen, data) + } + + codegen.v.invokedynamic(dynamicCalleeMethod.name, dynamicCalleeMethod.descriptor, bootstrapMethodHandle, asmBootstrapMethodArgs) + + return MaterialValue(codegen, dynamicCalleeMethod.returnType, expression.type) + } + + private fun generateBootstrapMethodArg(element: IrVarargElement, codegen: ExpressionCodegen): Any = + when (element) { + is IrRawFunctionReference -> + generateMethodHandle(element, codegen) + is IrCall -> + when (element.symbol) { + codegen.context.ir.symbols.jvmMethodTypeIntrinsic -> + generateMethodType(element, codegen) + else -> + throw AssertionError("Unexpected callee in bootstrap method argument:\n${element.dump()}") + } + is IrConst<*> -> + when (element.kind) { + IrConstKind.Byte -> (element.value as Byte).toInt() + IrConstKind.Short -> (element.value as Short).toInt() + IrConstKind.Int -> element.value as Int + IrConstKind.Long -> element.value as Long + IrConstKind.Float -> element.value as Float + IrConstKind.Double -> element.value as Double + IrConstKind.String -> element.value as String + else -> + throw AssertionError("Unexpected constant expression in bootstrap method argument:\n${element.dump()}") + } + else -> + throw AssertionError("Unexpected bootstrap method argument:\n${element.dump()}") + } + + private fun generateMethodHandle(irRawFunctionReference: IrRawFunctionReference, codegen: ExpressionCodegen): Any { + val irFun = irRawFunctionReference.symbol.owner + val irParentClass = irFun.parentAsClass + val owner = codegen.typeMapper.mapOwner(irParentClass) + val asmMethod = codegen.methodSignatureMapper.mapAsmMethod(irFun) + val handleTag = when { + irFun.dispatchReceiverParameter == null -> + Opcodes.H_INVOKESTATIC + else -> + Opcodes.H_INVOKEVIRTUAL + } + return Handle(handleTag, owner.internalName, asmMethod.name, asmMethod.descriptor, irParentClass.isJvmInterface) + } + + private fun generateMethodType(jvmMethodTypeCall: IrCall, codegen: ExpressionCodegen): Any { + val irRawFunctionReference = jvmMethodTypeCall.getValueArgument(0) as? IrRawFunctionReference + ?: throw AssertionError( + "Argument in ${jvmMethodTypeCall.symbol.owner.name} call is expected to be a raw function reference:\n" + + jvmMethodTypeCall.dump() + ) + val irFun = irRawFunctionReference.symbol.owner + // TODO substitute signature + val asmMethod = codegen.methodSignatureMapper.mapAsmMethod(irFun) + return Type.getMethodType(asmMethod.descriptor) + } + + private fun IrExpression.getIntConst() = + if (this is IrConst<*> && kind == IrConstKind.Int) + this.value as Int + else + null + + private fun IrExpression.getStringConst() = + if (this is IrConst<*> && kind == IrConstKind.String) + this.value as String + else + null + +} \ No newline at end of file diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/FunctionReferenceLowering.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/FunctionReferenceLowering.kt index 88f30ab34a9..5ff5c96c21c 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/FunctionReferenceLowering.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/FunctionReferenceLowering.kt @@ -14,6 +14,7 @@ import org.jetbrains.kotlin.backend.jvm.JvmBackendContext import org.jetbrains.kotlin.backend.jvm.JvmLoweredDeclarationOrigin import org.jetbrains.kotlin.backend.jvm.ir.* import org.jetbrains.kotlin.backend.jvm.lower.inlineclasses.InlineClassAbi +import org.jetbrains.kotlin.config.JvmSamConversions import org.jetbrains.kotlin.descriptors.DescriptorVisibilities import org.jetbrains.kotlin.descriptors.Modality import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET @@ -21,10 +22,7 @@ import org.jetbrains.kotlin.ir.builders.* import org.jetbrains.kotlin.ir.builders.declarations.* import org.jetbrains.kotlin.ir.declarations.* import org.jetbrains.kotlin.ir.expressions.* -import org.jetbrains.kotlin.ir.expressions.impl.IrClassReferenceImpl -import org.jetbrains.kotlin.ir.expressions.impl.IrFunctionReferenceImpl -import org.jetbrains.kotlin.ir.expressions.impl.IrGetObjectValueImpl -import org.jetbrains.kotlin.ir.expressions.impl.IrInstanceInitializerCallImpl +import org.jetbrains.kotlin.ir.expressions.impl.* import org.jetbrains.kotlin.ir.symbols.IrFunctionSymbol import org.jetbrains.kotlin.ir.types.* import org.jetbrains.kotlin.ir.util.* @@ -80,6 +78,9 @@ internal class FunctionReferenceLowering(private val context: JvmBackendContext) FunctionReferenceBuilder(expression).build() } + private val shouldUseIndySamConversions = + context.state.samConversionsScheme == JvmSamConversions.INDY + // Handle SAM conversions which wrap a function reference: // class sam$n(private val receiver: R) : Interface { override fun method(...) = receiver.target(...) } // @@ -87,20 +88,66 @@ internal class FunctionReferenceLowering(private val context: JvmBackendContext) // This is actually very common, as `Interface { something }` is a local function + a SAM-conversion // of a reference to it into an implementation. override fun visitTypeOperator(expression: IrTypeOperatorCall): IrExpression { - if (expression.operator == IrTypeOperator.SAM_CONVERSION) { - val invokable = expression.argument - val reference = if (invokable is IrFunctionReference) { - invokable - } else if (invokable is IrBlock && invokable.origin.isLambda && invokable.statements.last() is IrFunctionReference) { - invokable.statements.dropLast(1).forEach { it.transform(this, null) } - invokable.statements.last() as IrFunctionReference - } else { - return super.visitTypeOperator(expression) - } - reference.transformChildrenVoid() - return FunctionReferenceBuilder(reference, expression.typeOperand).build() + if (expression.operator != IrTypeOperator.SAM_CONVERSION) { + return super.visitTypeOperator(expression) + } + + val invokable = expression.argument + val reference = if (invokable is IrFunctionReference) { + invokable + } else if (invokable is IrBlock && invokable.origin.isLambda && invokable.statements.last() is IrFunctionReference) { + invokable.statements.dropLast(1).forEach { it.transform(this, null) } + invokable.statements.last() as IrFunctionReference + } else { + return super.visitTypeOperator(expression) + } + reference.transformChildrenVoid() + + return if (shouldUseIndySamConversions) { + wrapSamConversionArgumentWithIndySamConversion(expression) + } else { + FunctionReferenceBuilder(reference, expression.typeOperand).build() + } + } + + private fun wrapSamConversionArgumentWithIndySamConversion(expression: IrTypeOperatorCall): IrExpression { + return when (val argument = expression.argument) { + is IrFunctionReference -> + wrapWithIndySamConversion(expression.typeOperand, argument) + is IrBlock -> { + val last = argument.statements.last() + val functionReference = last as? IrFunctionReference + ?: throw AssertionError("Function reference expected: ${last.render()}") + argument.statements[argument.statements.size - 1] = wrapWithIndySamConversion(expression.typeOperand, functionReference) + return argument + } + else -> throw AssertionError("Block or function reference expected: ${expression.render()}") + } + } + + private val jvmIndySamConversionIntrinsic = context.ir.symbols.indySamConversionIntrinsic + + private val specialNullabilityAnnotationsFqNames = + setOf( + context.ir.symbols.flexibleNullabilityAnnotationFqName, + context.ir.symbols.enhancedNullabilityAnnotationFqName + ) + + private fun wrapWithIndySamConversion(samType: IrType, irFunRef: IrFunctionReference): IrCall { + val notNullSamType = samType.makeNotNull() + .removeAnnotations { it.type.classFqName in specialNullabilityAnnotationsFqNames } + return context.createJvmIrBuilder(currentScope!!.scope.scopeOwnerSymbol).run { + // We should produce the following expression: + // ``(method) + // where: + // - 'samType' is a substituted SAM type; + // - 'method' is a function reference to the actual method we are going to call + // (note that we need an IrFunctionReference here, so that further transformations would extract closure properly). + irCall(jvmIndySamConversionIntrinsic, notNullSamType).apply { + putTypeArgument(0, notNullSamType) + putValueArgument(0, irFunRef) + } } - return super.visitTypeOperator(expression) } private inner class FunctionReferenceBuilder(val irFunctionReference: IrFunctionReference, val samSuperType: IrType? = null) { diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/RemoveDeclarationsThatWouldBeInlinedLowering.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/RemoveDeclarationsThatWouldBeInlinedLowering.kt index c48cfe9f712..c3637e0a17f 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/RemoveDeclarationsThatWouldBeInlinedLowering.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/RemoveDeclarationsThatWouldBeInlinedLowering.kt @@ -15,8 +15,6 @@ import org.jetbrains.kotlin.ir.declarations.IrClass import org.jetbrains.kotlin.ir.declarations.IrFile import org.jetbrains.kotlin.ir.declarations.IrFunction import org.jetbrains.kotlin.ir.expressions.IrFunctionReference -import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin -import org.jetbrains.kotlin.ir.util.isLambda import org.jetbrains.kotlin.ir.visitors.* internal val removeDeclarationsThatWouldBeInlined = makeIrModulePhase( diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/TypeOperatorLowering.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/TypeOperatorLowering.kt index e6400d94e35..e5e20b37442 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/TypeOperatorLowering.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/TypeOperatorLowering.kt @@ -11,26 +11,33 @@ import org.jetbrains.kotlin.backend.common.lower.at import org.jetbrains.kotlin.backend.common.lower.irNot import org.jetbrains.kotlin.backend.common.phaser.makeIrFilePhase import org.jetbrains.kotlin.backend.jvm.JvmBackendContext +import org.jetbrains.kotlin.backend.jvm.JvmLoweredDeclarationOrigin import org.jetbrains.kotlin.backend.jvm.codegen.fileParent +import org.jetbrains.kotlin.backend.jvm.ir.createJvmIrBuilder import org.jetbrains.kotlin.backend.jvm.ir.erasedUpperBound +import org.jetbrains.kotlin.descriptors.Modality import org.jetbrains.kotlin.ir.IrElement import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET import org.jetbrains.kotlin.ir.builders.* -import org.jetbrains.kotlin.ir.declarations.IrDeclaration -import org.jetbrains.kotlin.ir.declarations.IrDeclarationOrigin -import org.jetbrains.kotlin.ir.declarations.IrFile -import org.jetbrains.kotlin.ir.declarations.IrFunction +import org.jetbrains.kotlin.ir.builders.declarations.addValueParameter +import org.jetbrains.kotlin.ir.builders.declarations.buildFun +import org.jetbrains.kotlin.ir.declarations.* import org.jetbrains.kotlin.ir.expressions.* import org.jetbrains.kotlin.ir.expressions.impl.IrCompositeImpl +import org.jetbrains.kotlin.ir.symbols.IrFunctionSymbol import org.jetbrains.kotlin.ir.symbols.IrSimpleFunctionSymbol import org.jetbrains.kotlin.ir.symbols.IrTypeParameterSymbol import org.jetbrains.kotlin.ir.types.* +import org.jetbrains.kotlin.ir.util.dump +import org.jetbrains.kotlin.ir.util.functions import org.jetbrains.kotlin.ir.util.isInlined import org.jetbrains.kotlin.ir.util.render import org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid import org.jetbrains.kotlin.ir.visitors.acceptChildrenVoid import org.jetbrains.kotlin.ir.visitors.acceptVoid import org.jetbrains.kotlin.utils.addToStdlib.safeAs +import org.jetbrains.org.objectweb.asm.Handle +import org.jetbrains.org.objectweb.asm.Opcodes // After this pass runs there are only four kinds of IrTypeOperatorCalls left: // @@ -95,6 +102,175 @@ private class TypeOperatorLowering(private val context: JvmBackendContext) : Fil builder.irAs(argument, type) } + private val indySamConversionIntrinsic = context.ir.symbols.indySamConversionIntrinsic + + private val indyIntrinsic = context.ir.symbols.jvmIndyIntrinsic + + private fun IrBuilderWithScope.jvmInvokeDynamic( + dynamicCall: IrCall, + bootstrapMethod: Handle, + bootstrapMethodArguments: List + ) = + irCall(indyIntrinsic, dynamicCall.type).apply { + putTypeArgument(0, dynamicCall.type) + putValueArgument(0, dynamicCall) + putValueArgument(1, irInt(bootstrapMethod.tag)) + putValueArgument(2, irString(bootstrapMethod.owner)) + putValueArgument(3, irString(bootstrapMethod.name)) + putValueArgument(4, irString(bootstrapMethod.desc)) + putValueArgument(5, irVararg(context.irBuiltIns.anyType, bootstrapMethodArguments)) + } + + private val methodTypeIntrinsic = context.ir.symbols.jvmMethodTypeIntrinsic + + private fun IrBuilderWithScope.jvmMethodType(ownerType: IrType, methodSymbol: IrFunctionSymbol) = + irCall(methodTypeIntrinsic, context.irBuiltIns.anyType).apply { + putTypeArgument(0, ownerType) + putValueArgument(0, irRawFunctionReferefence(context.irBuiltIns.anyType, methodSymbol)) + } + + private val lambdaMetafactoryHandle = + Handle( + Opcodes.H_INVOKESTATIC, + "java/lang/invoke/LambdaMetafactory", + "metafactory", + "(" + + "Ljava/lang/invoke/MethodHandles\$Lookup;" + + "Ljava/lang/String;" + + "Ljava/lang/invoke/MethodType;" + + "Ljava/lang/invoke/MethodType;" + + "Ljava/lang/invoke/MethodHandle;" + + "Ljava/lang/invoke/MethodType;" + + ")Ljava/lang/invoke/CallSite;", + false + ) + + override fun visitCall(expression: IrCall): IrExpression { + return when (expression.symbol) { + indySamConversionIntrinsic -> updateIndySamConversionIntrinsicCall(expression) + else -> super.visitCall(expression) + } + } + + /** + * @see FunctionReferenceLowering.wrapWithIndySamConversion + */ + private fun updateIndySamConversionIntrinsicCall(call: IrCall): IrCall { + fun fail(message: String): Nothing = + throw AssertionError("$message, call:\n${call.dump()}") + + // We expect: + // ``(method) + // where + // - 'samType' is a substituted SAM type; + // - 'method' is an IrFunctionReference to an actual method that should be called, + // with arguments captured by closure stored as function reference arguments. + // We replace it with JVM INVOKEDYNAMIC intrinsic. + + val startOffset = call.startOffset + val endOffset = call.endOffset + + val samType = call.getTypeArgument(0) as? IrSimpleType + ?: fail("'samType' is expected to be a simple type") + val samClassSymbol = samType.classOrNull + ?: fail("'samType' is expected to be a class type: '${samType.render()}'") + val samMethod = samClassSymbol.owner.functions.singleOrNull { it.modality == Modality.ABSTRACT } + ?: fail("'${samType.render()}' is not a SAM-type") + + val irFunRef = call.getValueArgument(0) as? IrFunctionReference + ?: fail("'method' is expected to be 'IrFunctionReference'") + val funSymbol = irFunRef.symbol + + val erasedSamType = samClassSymbol.defaultType as IrSimpleType + val dynamicCall = wrapClosureInDynamicCall(erasedSamType, samMethod, irFunRef) + + return context.createJvmIrBuilder( + funSymbol, // TODO actual symbol for outer scope + startOffset, endOffset + ).run { + val samMethodType = jvmMethodType(erasedSamType, samMethod.symbol) + val irRawFunRef = irRawFunctionReferefence(irFunRef.type, funSymbol) + val instanceMethodType = jvmMethodType(samType, samMethod.symbol) + + jvmInvokeDynamic( + dynamicCall, + lambdaMetafactoryHandle, + listOf(samMethodType, irRawFunRef, instanceMethodType) + ) + } + } + + private fun wrapClosureInDynamicCall( + erasedSamType: IrSimpleType, + samMethod: IrSimpleFunction, + irFunRef: IrFunctionReference + ): IrCall { + fun fail(message: String): Nothing = + throw AssertionError("$message, irFunRef:\n${irFunRef.dump()}") + + val dynamicCallArguments = ArrayList() + + val irDynamicCallTarget = context.irFactory.buildFun { + origin = JvmLoweredDeclarationOrigin.INVOVEDYNAMIC_CALL_TARGET + name = samMethod.name + returnType = erasedSamType + }.apply { + parent = context.ir.symbols.kotlinJvmInternalInvokeDynamicPackage + + var syntheticParameterIndex = 0 + val targetFun = irFunRef.symbol.owner + + val targetDispatchReceiverParameter = targetFun.dispatchReceiverParameter + if (targetDispatchReceiverParameter != null) { + addValueParameter("p${syntheticParameterIndex++}", targetDispatchReceiverParameter.type) + val dispatchReceiver = irFunRef.dispatchReceiver + ?: fail("Captured dispatch receiver is not provided") + dynamicCallArguments.add(dispatchReceiver) + } + + val targetExtensionReceiverParameter = targetFun.extensionReceiverParameter + if (targetExtensionReceiverParameter != null) { + addValueParameter("p${syntheticParameterIndex++}", targetExtensionReceiverParameter.type) + val extensionReceiver = irFunRef.extensionReceiver + ?: fail("Captured extension receiver is not provided") + dynamicCallArguments.add(extensionReceiver) + } + + val samMethodValueParametersCount = samMethod.valueParameters.size + val targetFunValueParametersCount = targetFun.valueParameters.size + for (i in 0 until targetFunValueParametersCount - samMethodValueParametersCount) { + val targetFunValueParameter = targetFun.valueParameters[i] + addValueParameter("p${syntheticParameterIndex++}", targetFunValueParameter.type) + val capturedValueArgument = irFunRef.getValueArgument(i) + ?: fail("Captured value argument #$i (${targetFunValueParameter.name} not provided") + dynamicCallArguments.add(capturedValueArgument) + } + } + + if (dynamicCallArguments.size != irDynamicCallTarget.valueParameters.size) { + throw AssertionError( + "Dynamic call target value parameters (${irDynamicCallTarget.valueParameters.size}) " + + "don't match dynamic call arguments (${dynamicCallArguments.size}):\n" + + "irDynamicCallTarget:\n" + + irDynamicCallTarget.dump() + + "dynamicCallArguments:\n" + + dynamicCallArguments + .withIndex() + .joinToString(separator = "\n ", prefix = "[\n ", postfix = "\n]") { (index, irArg) -> + "#$index: ${irArg.dump()}" + } + ) + } + + return context.createJvmIrBuilder(irDynamicCallTarget.symbol) + .irCall(irDynamicCallTarget.symbol) + .apply { + for (i in dynamicCallArguments.indices) { + putValueArgument(i, dynamicCallArguments[i]) + } + } + } + override fun visitTypeOperator(expression: IrTypeOperatorCall): IrExpression = with(builder) { at(expression) return when (expression.operator) { diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/builders/ExpressionHelpers.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/builders/ExpressionHelpers.kt index f76b6a974f5..b8696213ed5 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/builders/ExpressionHelpers.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/builders/ExpressionHelpers.kt @@ -11,6 +11,7 @@ import org.jetbrains.kotlin.ir.expressions.* import org.jetbrains.kotlin.ir.expressions.impl.* import org.jetbrains.kotlin.ir.symbols.* import org.jetbrains.kotlin.ir.types.IrType +import org.jetbrains.kotlin.ir.types.typeWith import org.jetbrains.kotlin.ir.util.isImmutable import org.jetbrains.kotlin.ir.util.parentAsClass import org.jetbrains.kotlin.ir.util.render @@ -326,6 +327,11 @@ fun IrBuilderWithScope.irString(value: String) = fun IrBuilderWithScope.irConcat() = IrStringConcatenationImpl(startOffset, endOffset, context.irBuiltIns.stringType) +fun IrBuilderWithScope.irVararg(elementType: IrType, values: List) = + IrVarargImpl(startOffset, endOffset, context.irBuiltIns.arrayClass.typeWith(elementType), elementType, values) + +fun IrBuilderWithScope.irRawFunctionReferefence(type: IrType, symbol: IrFunctionSymbol) = + IrRawFunctionReferenceImpl(startOffset, endOffset, type, symbol) inline fun IrBuilderWithScope.irBlock( startOffset: Int = this.startOffset, diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/RenderIrElement.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/RenderIrElement.kt index fd6bd60ec17..d796be3d76c 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/RenderIrElement.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/RenderIrElement.kt @@ -645,6 +645,9 @@ class RenderIrElementVisitor(private val normalizeNames: Boolean = false) : IrEl "type=${expression.type.render()} origin=${expression.origin} " + "reflectionTarget=${renderReflectionTarget(expression)}" + override fun visitRawFunctionReference(expression: IrRawFunctionReference, data: Nothing?): String = + "RAW_FUNCTION_REFERENCE '${expression.symbol.renderReference()}' type=${expression.type.render()}" + private fun renderReflectionTarget(expression: IrFunctionReference) = if (expression.symbol == expression.reflectionTarget) "" diff --git a/compiler/testData/codegen/box/invokedynamic/sam/boundReference.kt b/compiler/testData/codegen/box/invokedynamic/sam/boundReference.kt new file mode 100644 index 00000000000..52fc026fe86 --- /dev/null +++ b/compiler/testData/codegen/box/invokedynamic/sam/boundReference.kt @@ -0,0 +1,23 @@ +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 +// SAM_CONVERSIONS: INDY + +fun interface KRunnable { + fun run() +} + +fun runIt(kr: KRunnable) { + kr.run() +} + +class C(var value: String) { + fun fn() { + value = "OK" + } +} + +fun box(): String { + val c = C("xxx") + runIt(c::fn) + return c.value +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/invokedynamic/sam/capturedDispatchReceiver.kt b/compiler/testData/codegen/box/invokedynamic/sam/capturedDispatchReceiver.kt new file mode 100644 index 00000000000..9b019b39a8d --- /dev/null +++ b/compiler/testData/codegen/box/invokedynamic/sam/capturedDispatchReceiver.kt @@ -0,0 +1,20 @@ +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 +// SAM_CONVERSIONS: INDY + +fun interface KRunnable { + fun run() +} + +fun runIt(kr: KRunnable) { + kr.run() +} + +class C(var value: String) { + fun test(): String { + runIt { value = "OK" } + return value + } +} + +fun box() = C("xxx").test() \ No newline at end of file diff --git a/compiler/testData/codegen/box/invokedynamic/sam/capturedExtensionReceiver.kt b/compiler/testData/codegen/box/invokedynamic/sam/capturedExtensionReceiver.kt new file mode 100644 index 00000000000..17a5655f0d3 --- /dev/null +++ b/compiler/testData/codegen/box/invokedynamic/sam/capturedExtensionReceiver.kt @@ -0,0 +1,20 @@ +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 +// SAM_CONVERSIONS: INDY + +fun interface KRunnable { + fun run() +} + +fun runIt(kr: KRunnable) { + kr.run() +} + +class C(var value: String) + +fun C.test(): String { + runIt { value = "OK" } + return value +} + +fun box() = C("xxx").test() \ No newline at end of file diff --git a/compiler/testData/codegen/box/invokedynamic/sam/capturingIndyFunInterface.kt b/compiler/testData/codegen/box/invokedynamic/sam/capturingIndyFunInterface.kt new file mode 100644 index 00000000000..aa1a5512b2f --- /dev/null +++ b/compiler/testData/codegen/box/invokedynamic/sam/capturingIndyFunInterface.kt @@ -0,0 +1,20 @@ +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 +// SAM_CONVERSIONS: INDY + +fun interface KRunnable { + fun run() +} + +fun runIt(r: KRunnable) { + r.run() +} + +var test = "Failed" + +fun box(): String { + val ok = "OK" + runIt { test = ok } + return test +} + diff --git a/compiler/testData/codegen/box/invokedynamic/sam/capturingIndySam.kt b/compiler/testData/codegen/box/invokedynamic/sam/capturingIndySam.kt new file mode 100644 index 00000000000..e31cdd70d48 --- /dev/null +++ b/compiler/testData/codegen/box/invokedynamic/sam/capturingIndySam.kt @@ -0,0 +1,18 @@ +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 +// SAM_CONVERSIONS: INDY +// FILE: capturingIndySam.kt +var test = "Failed" + +fun box(): String { + val ok = "OK" + J.run { test = ok } + return test +} + +// FILE: J.java +public class J { + public static void run(Runnable r) { + r.run(); + } +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/invokedynamic/sam/primitiveVsWrapperInSam.kt b/compiler/testData/codegen/box/invokedynamic/sam/primitiveVsWrapperInSam.kt new file mode 100644 index 00000000000..99f4aa59527 --- /dev/null +++ b/compiler/testData/codegen/box/invokedynamic/sam/primitiveVsWrapperInSam.kt @@ -0,0 +1,46 @@ +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 +// SAM_CONVERSIONS: INDY +// FILE: primitiveVsWrapperInSam.kt +var test = 0 + +fun tf2(k: Int) { test = k * 10 } + +fun tf4() = 5678 + +fun box(): String { + J.accept42 { k: Int -> test = k } + if (test != 42) return "Failed 1: test=$test" + + J.accept42(::tf2) + if (test != 420) return "Failed 2: test=$test" + + val t3 = J.get { 1234 } + if (t3 != 1234) return "Failed 3: t3=$t3" + + val t4 = J.get(::tf4) + if (t4 != 5678) return "Failed 4: t4=$t4" + + return "OK" +} + +// FILE: J.java +public class J { + public static void accept42(Sam1 sam) { + sam.accept(42); + } + + public static int get(Sam2 sam) { + return sam.get(); + } +} + +// FILE: Sam1.java +public interface Sam1 { + void accept(Integer x); +} + +// FILE: Sam2.java +public interface Sam2 { + Integer get(); +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/invokedynamic/sam/simpleIndyFunInterface.kt b/compiler/testData/codegen/box/invokedynamic/sam/simpleIndyFunInterface.kt new file mode 100644 index 00000000000..a6ff2988ea1 --- /dev/null +++ b/compiler/testData/codegen/box/invokedynamic/sam/simpleIndyFunInterface.kt @@ -0,0 +1,18 @@ +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 +// SAM_CONVERSIONS: INDY + +fun interface KRunnable { + fun run() +} + +fun runIt(r: KRunnable) { + r.run() +} + +var test = "Failed" + +fun box(): String { + runIt { test = "OK" } + return test +} diff --git a/compiler/testData/codegen/box/invokedynamic/sam/simpleIndySam.kt b/compiler/testData/codegen/box/invokedynamic/sam/simpleIndySam.kt new file mode 100644 index 00000000000..0ced7703cc1 --- /dev/null +++ b/compiler/testData/codegen/box/invokedynamic/sam/simpleIndySam.kt @@ -0,0 +1,17 @@ +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 +// SAM_CONVERSIONS: INDY +// FILE: simpleIndySam.kt +var test = "Failed" + +fun box(): String { + J.run { test = "OK" } + return test +} + +// FILE: J.java +public class J { + public static void run(Runnable r) { + r.run(); + } +} \ No newline at end of file diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index 29dde57cd24..53fb681de35 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -18379,6 +18379,74 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { } } + @Nested + @TestMetadata("compiler/testData/codegen/box/invokedynamic") + @TestDataPath("$PROJECT_ROOT") + public class Invokedynamic extends AbstractBlackBoxCodegenTest { + @Test + public void testAllFilesPresentInInvokedynamic() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); + } + + @Nested + @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam") + @TestDataPath("$PROJECT_ROOT") + public class Sam extends AbstractBlackBoxCodegenTest { + @Test + public void testAllFilesPresentInSam() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); + } + + @Test + @TestMetadata("boundReference.kt") + public void testBoundReference() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/boundReference.kt"); + } + + @Test + @TestMetadata("capturedDispatchReceiver.kt") + public void testCapturedDispatchReceiver() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/capturedDispatchReceiver.kt"); + } + + @Test + @TestMetadata("capturedExtensionReceiver.kt") + public void testCapturedExtensionReceiver() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/capturedExtensionReceiver.kt"); + } + + @Test + @TestMetadata("capturingIndyFunInterface.kt") + public void testCapturingIndyFunInterface() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/capturingIndyFunInterface.kt"); + } + + @Test + @TestMetadata("capturingIndySam.kt") + public void testCapturingIndySam() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/capturingIndySam.kt"); + } + + @Test + @TestMetadata("primitiveVsWrapperInSam.kt") + public void testPrimitiveVsWrapperInSam() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/primitiveVsWrapperInSam.kt"); + } + + @Test + @TestMetadata("simpleIndyFunInterface.kt") + public void testSimpleIndyFunInterface() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/simpleIndyFunInterface.kt"); + } + + @Test + @TestMetadata("simpleIndySam.kt") + public void testSimpleIndySam() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/simpleIndySam.kt"); + } + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/ir") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index 18fedd1f27f..32fec2dfbaf 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -18379,6 +18379,74 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes } } + @Nested + @TestMetadata("compiler/testData/codegen/box/invokedynamic") + @TestDataPath("$PROJECT_ROOT") + public class Invokedynamic extends AbstractIrBlackBoxCodegenTest { + @Test + public void testAllFilesPresentInInvokedynamic() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Nested + @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam") + @TestDataPath("$PROJECT_ROOT") + public class Sam extends AbstractIrBlackBoxCodegenTest { + @Test + public void testAllFilesPresentInSam() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("boundReference.kt") + public void testBoundReference() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/boundReference.kt"); + } + + @Test + @TestMetadata("capturedDispatchReceiver.kt") + public void testCapturedDispatchReceiver() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/capturedDispatchReceiver.kt"); + } + + @Test + @TestMetadata("capturedExtensionReceiver.kt") + public void testCapturedExtensionReceiver() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/capturedExtensionReceiver.kt"); + } + + @Test + @TestMetadata("capturingIndyFunInterface.kt") + public void testCapturingIndyFunInterface() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/capturingIndyFunInterface.kt"); + } + + @Test + @TestMetadata("capturingIndySam.kt") + public void testCapturingIndySam() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/capturingIndySam.kt"); + } + + @Test + @TestMetadata("primitiveVsWrapperInSam.kt") + public void testPrimitiveVsWrapperInSam() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/primitiveVsWrapperInSam.kt"); + } + + @Test + @TestMetadata("simpleIndyFunInterface.kt") + public void testSimpleIndyFunInterface() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/simpleIndyFunInterface.kt"); + } + + @Test + @TestMetadata("simpleIndySam.kt") + public void testSimpleIndySam() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/simpleIndySam.kt"); + } + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/ir") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/CodegenTestDirectives.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/CodegenTestDirectives.kt index dbb639e7e88..620dbdeada9 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/CodegenTestDirectives.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/CodegenTestDirectives.kt @@ -5,6 +5,7 @@ package org.jetbrains.kotlin.test.directives +import org.jetbrains.kotlin.config.JvmSamConversions import org.jetbrains.kotlin.test.TargetBackend import org.jetbrains.kotlin.test.backend.handlers.BytecodeTextHandler import org.jetbrains.kotlin.test.backend.handlers.IrPrettyKotlinDumpHandler @@ -90,4 +91,6 @@ object CodegenTestDirectives : SimpleDirectivesContainer() { val TREAT_AS_ONE_FILE by directive( description = "Treat bytecode from all files as one in ${BytecodeTextHandler::class}" ) + + val SAM_CONVERSIONS by enumDirective("SAM conversion code generation scheme") } diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/codegen/AbstractJvmBlackBoxCodegenTestBase.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/codegen/AbstractJvmBlackBoxCodegenTestBase.kt index a15425fbfbe..2548fd55c73 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/codegen/AbstractJvmBlackBoxCodegenTestBase.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/codegen/AbstractJvmBlackBoxCodegenTestBase.kt @@ -39,3 +39,14 @@ abstract class AbstractJvmBlackBoxCodegenTestBase Date: Wed, 20 Jan 2021 14:51:07 +0300 Subject: [PATCH 164/212] JVM_IR indy-SAM conversions: more cases KT-44278 KT-26060 KT-42621 --- .../FirBlackBoxCodegenTestGenerated.java | 36 +++++++++ .../kotlin/backend/jvm/JvmSymbols.kt | 20 ++++- .../jvm/intrinsics/JvmInvokeDynamic.kt | 68 ++++++++++++++--- .../jvm/lower/FunctionReferenceLowering.kt | 13 +++- .../backend/jvm/lower/TypeOperatorLowering.kt | 19 +++-- .../ir/expressions/IrDeclarationReference.kt | 3 +- .../kotlin/ir/overrides/IrOverridingUtil.kt | 75 ++++++++++--------- .../sam/builtinMemberReference.kt | 16 ++++ .../box/invokedynamic/sam/capturingVar.kt | 18 +++++ .../invokedynamic/sam/constructorReference.kt | 13 ++++ .../invokedynamic/sam/genericFunInterface.kt | 11 +++ .../sam/genericFunInterfaceWithPrimitive.kt | 16 ++++ .../sam/samConversionOnFunctionReference.kt | 22 ++++++ .../codegen/BlackBoxCodegenTestGenerated.java | 36 +++++++++ .../IrBlackBoxCodegenTestGenerated.java | 36 +++++++++ .../test/backend/handlers/JvmBoxRunner.kt | 8 +- .../LightAnalysisModeTestGenerated.java | 30 ++++++++ 17 files changed, 383 insertions(+), 57 deletions(-) create mode 100644 compiler/testData/codegen/box/invokedynamic/sam/builtinMemberReference.kt create mode 100644 compiler/testData/codegen/box/invokedynamic/sam/capturingVar.kt create mode 100644 compiler/testData/codegen/box/invokedynamic/sam/constructorReference.kt create mode 100644 compiler/testData/codegen/box/invokedynamic/sam/genericFunInterface.kt create mode 100644 compiler/testData/codegen/box/invokedynamic/sam/genericFunInterfaceWithPrimitive.kt create mode 100644 compiler/testData/codegen/box/invokedynamic/sam/samConversionOnFunctionReference.kt diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java index ca2c208fc61..7e4cee4a7cd 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java @@ -18403,6 +18403,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/invokedynamic/sam/boundReference.kt"); } + @Test + @TestMetadata("builtinMemberReference.kt") + public void testBuiltinMemberReference() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/builtinMemberReference.kt"); + } + @Test @TestMetadata("capturedDispatchReceiver.kt") public void testCapturedDispatchReceiver() throws Exception { @@ -18427,12 +18433,42 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/invokedynamic/sam/capturingIndySam.kt"); } + @Test + @TestMetadata("capturingVar.kt") + public void testCapturingVar() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/capturingVar.kt"); + } + + @Test + @TestMetadata("constructorReference.kt") + public void testConstructorReference() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/constructorReference.kt"); + } + + @Test + @TestMetadata("genericFunInterface.kt") + public void testGenericFunInterface() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/genericFunInterface.kt"); + } + + @Test + @TestMetadata("genericFunInterfaceWithPrimitive.kt") + public void testGenericFunInterfaceWithPrimitive() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/genericFunInterfaceWithPrimitive.kt"); + } + @Test @TestMetadata("primitiveVsWrapperInSam.kt") public void testPrimitiveVsWrapperInSam() throws Exception { runTest("compiler/testData/codegen/box/invokedynamic/sam/primitiveVsWrapperInSam.kt"); } + @Test + @TestMetadata("samConversionOnFunctionReference.kt") + public void testSamConversionOnFunctionReference() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/samConversionOnFunctionReference.kt"); + } + @Test @TestMetadata("simpleIndyFunInterface.kt") public void testSimpleIndyFunInterface() throws Exception { diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmSymbols.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmSymbols.kt index ba61122d72f..7b3dfb7812a 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmSymbols.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmSymbols.kt @@ -604,11 +604,25 @@ class JvmSymbols( }.symbol // Intrinsic used to represent MethodType objects in bootstrap method arguments (see jvmInvokeDynamicIntrinsic above). - // Type argument is a possibly substituted method owner type (e.g., 'java.lang.function.Supplier'). // Value argument is a raw function reference to a corresponding method (e.g., 'java.lang.function.Supplier#get'). - val jvmMethodTypeIntrinsic: IrSimpleFunctionSymbol = + // Resulting method type is unsubstituted. + val jvmOriginalMethodTypeIntrinsic: IrSimpleFunctionSymbol = irFactory.buildFun { - name = Name.special("") + name = Name.special("") + origin = IrDeclarationOrigin.IR_BUILTINS_STUB + }.apply { + parent = kotlinJvmInternalPackage + addValueParameter("method", irBuiltIns.anyType) + returnType = irBuiltIns.anyType + }.symbol + + // Intrinsic used to represent MethodType objects in bootstrap method arguments (see jvmInvokeDynamicIntrinsic above). + // Type argument is a substituted method owner type (e.g., 'java.lang.function.Supplier'). + // Value argument is a raw function reference to a corresponding method (e.g., 'java.lang.function.Supplier#get'). + // Resulting method type is substituted. + val jvmSubstitutedMethodTypeIntrinsic: IrSimpleFunctionSymbol = + irFactory.buildFun { + name = Name.special("") origin = IrDeclarationOrigin.IR_BUILTINS_STUB }.apply { parent = kotlinJvmInternalPackage diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/intrinsics/JvmInvokeDynamic.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/intrinsics/JvmInvokeDynamic.kt index f00c00d6f93..4b814c4c710 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/intrinsics/JvmInvokeDynamic.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/intrinsics/JvmInvokeDynamic.kt @@ -8,10 +8,17 @@ package org.jetbrains.kotlin.backend.jvm.intrinsics import org.jetbrains.kotlin.backend.jvm.JvmLoweredDeclarationOrigin import org.jetbrains.kotlin.backend.jvm.codegen.* import org.jetbrains.kotlin.codegen.inline.v +import org.jetbrains.kotlin.ir.builders.declarations.buildClass +import org.jetbrains.kotlin.ir.declarations.IrConstructor +import org.jetbrains.kotlin.ir.declarations.IrSimpleFunction import org.jetbrains.kotlin.ir.expressions.* +import org.jetbrains.kotlin.ir.overrides.buildFakeOverrideMember +import org.jetbrains.kotlin.ir.types.* +import org.jetbrains.kotlin.ir.types.impl.makeTypeProjection import org.jetbrains.kotlin.ir.util.dump import org.jetbrains.kotlin.ir.util.parentAsClass import org.jetbrains.kotlin.ir.util.render +import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.utils.addToStdlib.safeAs import org.jetbrains.org.objectweb.asm.Handle import org.jetbrains.org.objectweb.asm.Opcodes @@ -71,8 +78,10 @@ object JvmInvokeDynamic : IntrinsicMethod() { generateMethodHandle(element, codegen) is IrCall -> when (element.symbol) { - codegen.context.ir.symbols.jvmMethodTypeIntrinsic -> - generateMethodType(element, codegen) + codegen.context.ir.symbols.jvmOriginalMethodTypeIntrinsic -> + generateOriginalMethodType(element, codegen) + codegen.context.ir.symbols.jvmSubstitutedMethodTypeIntrinsic -> + generateSubstitutedMethodType(element, codegen) else -> throw AssertionError("Unexpected callee in bootstrap method argument:\n${element.dump()}") } @@ -92,12 +101,14 @@ object JvmInvokeDynamic : IntrinsicMethod() { throw AssertionError("Unexpected bootstrap method argument:\n${element.dump()}") } - private fun generateMethodHandle(irRawFunctionReference: IrRawFunctionReference, codegen: ExpressionCodegen): Any { + private fun generateMethodHandle(irRawFunctionReference: IrRawFunctionReference, codegen: ExpressionCodegen): Handle { val irFun = irRawFunctionReference.symbol.owner val irParentClass = irFun.parentAsClass val owner = codegen.typeMapper.mapOwner(irParentClass) val asmMethod = codegen.methodSignatureMapper.mapAsmMethod(irFun) val handleTag = when { + irFun is IrConstructor -> + Opcodes.H_NEWINVOKESPECIAL irFun.dispatchReceiverParameter == null -> Opcodes.H_INVOKESTATIC else -> @@ -106,18 +117,57 @@ object JvmInvokeDynamic : IntrinsicMethod() { return Handle(handleTag, owner.internalName, asmMethod.name, asmMethod.descriptor, irParentClass.isJvmInterface) } - private fun generateMethodType(jvmMethodTypeCall: IrCall, codegen: ExpressionCodegen): Any { - val irRawFunctionReference = jvmMethodTypeCall.getValueArgument(0) as? IrRawFunctionReference + private fun generateOriginalMethodType(irCall: IrCall, codegen: ExpressionCodegen): Type { + val irRawFunRef = irCall.getValueArgument(0) as? IrRawFunctionReference ?: throw AssertionError( - "Argument in ${jvmMethodTypeCall.symbol.owner.name} call is expected to be a raw function reference:\n" + - jvmMethodTypeCall.dump() + "Argument in ${irCall.symbol.owner.name} call is expected to be a raw function reference:\n" + + irCall.dump() ) - val irFun = irRawFunctionReference.symbol.owner - // TODO substitute signature + val irFun = irRawFunRef.symbol.owner val asmMethod = codegen.methodSignatureMapper.mapAsmMethod(irFun) return Type.getMethodType(asmMethod.descriptor) } + private fun generateSubstitutedMethodType(irCall: IrCall, codegen: ExpressionCodegen): Type { + fun fail(message: String): Nothing = + throw AssertionError("$message; irCall:\n${irCall.dump()}") + + val irRawFunRef = irCall.getValueArgument(0) as? IrRawFunctionReference + ?: fail("Argument in ${irCall.symbol.owner.name} call is expected to be a raw function reference") + val irOriginalFun = irRawFunRef.symbol.owner as? IrSimpleFunction + ?: fail("IrSimpleFunction expected: ${irRawFunRef.symbol.owner.render()}") + val substitutedType = irCall.getTypeArgument(0) as? IrSimpleType + ?: fail("Type argument expected") + + // Force boxing on primitive types, otherwise D8 fails to accept resulting MethodType in presence of primitive types in arguments + // (LambdaMetafactory is ok with such types, though). + val substitutedTypeWithNullableArgs = + substitutedType.classifier.typeWithArguments( + substitutedType.arguments.map { + when (it) { + is IrStarProjection -> it + is IrTypeProjection -> { + val type = it.type + if (type !is IrSimpleType || type.hasQuestionMark) + it + else + makeTypeProjection(type.withHasQuestionMark(true), it.variance) + } + else -> + fail("Unexpected type argument '${it}' :: ${it::class.simpleName}") + } + } + ) + + val fakeClass = codegen.context.irFactory.buildClass { name = Name.special("") } + fakeClass.parent = codegen.context.ir.symbols.kotlinJvmInternalInvokeDynamicPackage + val irFakeOverride = buildFakeOverrideMember(substitutedTypeWithNullableArgs, irOriginalFun, fakeClass) as IrSimpleFunction + irFakeOverride.overriddenSymbols = listOf(irOriginalFun.symbol) + + val asmMethod = codegen.methodSignatureMapper.mapAsmMethod(irFakeOverride) + return Type.getMethodType(asmMethod.descriptor) + } + private fun IrExpression.getIntConst() = if (this is IrConst<*> && kind == IrConstKind.Int) this.value as Int diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/FunctionReferenceLowering.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/FunctionReferenceLowering.kt index 5ff5c96c21c..3aaf90526b7 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/FunctionReferenceLowering.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/FunctionReferenceLowering.kt @@ -103,13 +103,24 @@ internal class FunctionReferenceLowering(private val context: JvmBackendContext) } reference.transformChildrenVoid() - return if (shouldUseIndySamConversions) { + return if (shouldUseIndySamConversions && canUseIndySamConversion(reference)) { wrapSamConversionArgumentWithIndySamConversion(expression) } else { FunctionReferenceBuilder(reference, expression.typeOperand).build() } } + private fun canUseIndySamConversion(reference: IrFunctionReference): Boolean { + // Can't use indy for regular function references by default (because of 'equals'). + // TODO special mode that would generate indy everywhere? + if (reference.origin != IrStatementOrigin.LAMBDA) + return false + // TODO wrap intrinsic function in lambda? + if (context.irIntrinsics.getIntrinsic(reference.symbol) != null) + return false + return true + } + private fun wrapSamConversionArgumentWithIndySamConversion(expression: IrTypeOperatorCall): IrExpression { return when (val argument = expression.argument) { is IrFunctionReference -> diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/TypeOperatorLowering.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/TypeOperatorLowering.kt index e5e20b37442..e6eac2bdb43 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/TypeOperatorLowering.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/TypeOperatorLowering.kt @@ -121,10 +121,16 @@ private class TypeOperatorLowering(private val context: JvmBackendContext) : Fil putValueArgument(5, irVararg(context.irBuiltIns.anyType, bootstrapMethodArguments)) } - private val methodTypeIntrinsic = context.ir.symbols.jvmMethodTypeIntrinsic + private val originalMethodTypeIntrinsic = context.ir.symbols.jvmOriginalMethodTypeIntrinsic + private val substitutedMethodTypeIntrinsic = context.ir.symbols.jvmSubstitutedMethodTypeIntrinsic - private fun IrBuilderWithScope.jvmMethodType(ownerType: IrType, methodSymbol: IrFunctionSymbol) = - irCall(methodTypeIntrinsic, context.irBuiltIns.anyType).apply { + private fun IrBuilderWithScope.jvmOriginalMethodType(methodSymbol: IrFunctionSymbol) = + irCall(originalMethodTypeIntrinsic, context.irBuiltIns.anyType).apply { + putValueArgument(0, irRawFunctionReferefence(context.irBuiltIns.anyType, methodSymbol)) + } + + private fun IrBuilderWithScope.jvmSubstitutedMethodType(ownerType: IrType, methodSymbol: IrFunctionSymbol) = + irCall(substitutedMethodTypeIntrinsic, context.irBuiltIns.anyType).apply { putTypeArgument(0, ownerType) putValueArgument(0, irRawFunctionReferefence(context.irBuiltIns.anyType, methodSymbol)) } @@ -181,16 +187,15 @@ private class TypeOperatorLowering(private val context: JvmBackendContext) : Fil ?: fail("'method' is expected to be 'IrFunctionReference'") val funSymbol = irFunRef.symbol - val erasedSamType = samClassSymbol.defaultType as IrSimpleType - val dynamicCall = wrapClosureInDynamicCall(erasedSamType, samMethod, irFunRef) + val dynamicCall = wrapClosureInDynamicCall(samType, samMethod, irFunRef) return context.createJvmIrBuilder( funSymbol, // TODO actual symbol for outer scope startOffset, endOffset ).run { - val samMethodType = jvmMethodType(erasedSamType, samMethod.symbol) + val samMethodType = jvmOriginalMethodType(samMethod.symbol) val irRawFunRef = irRawFunctionReferefence(irFunRef.type, funSymbol) - val instanceMethodType = jvmMethodType(samType, samMethod.symbol) + val instanceMethodType = jvmSubstitutedMethodType(samType, samMethod.symbol) jvmInvokeDynamic( dynamicCall, diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrDeclarationReference.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrDeclarationReference.kt index 494d19052d3..8536230156d 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrDeclarationReference.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/IrDeclarationReference.kt @@ -38,7 +38,8 @@ abstract class IrGetEnumValue : IrGetSingletonValue() { /** * Platform-specific low-level reference to function. * - * On JS platform represent a plain reference to JavaScript function. + * On JS platform it represents a plain reference to JavaScript function. + * On JVM platform it represents a MethodHandle constant. */ abstract class IrRawFunctionReference : IrDeclarationReference() { abstract override val symbol: IrFunctionSymbol diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/overrides/IrOverridingUtil.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/overrides/IrOverridingUtil.kt index 410bc0479c5..cf1e7c00f3e 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/overrides/IrOverridingUtil.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/overrides/IrOverridingUtil.kt @@ -23,33 +23,8 @@ import org.jetbrains.kotlin.types.AbstractTypeCheckerContext import org.jetbrains.kotlin.types.Variance abstract class FakeOverrideBuilderStrategy { - open fun fakeOverrideMember(superType: IrType, member: IrOverridableMember, clazz: IrClass): IrOverridableMember{ - require(superType is IrSimpleType) { "superType is $superType, expected IrSimpleType" } - val classifier = superType.classifier - require(classifier is IrClassSymbol) { "superType classifier is not IrClassSymbol: $classifier" } - - val typeParameters = extractTypeParameters(classifier.owner) - val superArguments = superType.arguments - assert(typeParameters.size == superArguments.size) { - "typeParameters = $typeParameters size != typeArguments = $superArguments size " - } - - val substitutionMap = mutableMapOf() - - for (i in typeParameters.indices) { - val tp = typeParameters[i] - val ta = superArguments[i] - require(ta is IrTypeProjection) { "Unexpected super type argument: $ta @ $i" } - assert(ta.variance == Variance.INVARIANT) { "Unexpected variance in super type argument: ${ta.variance} @$i" } - substitutionMap[tp.symbol] = ta.type - } - - val copier = DeepCopyIrTreeWithSymbolsForFakeOverrides(substitutionMap) - val deepCopyFakeOverride = copier.copy(member, clazz) as IrOverridableMember - deepCopyFakeOverride.parent = clazz - - return deepCopyFakeOverride - } + open fun fakeOverrideMember(superType: IrType, member: IrOverridableMember, clazz: IrClass): IrOverridableMember = + buildFakeOverrideMember(superType, member, clazz) fun linkFakeOverride(fakeOverride: IrOverridableMember) { when (fakeOverride) { @@ -66,6 +41,35 @@ abstract class FakeOverrideBuilderStrategy { val propertyOverriddenSymbols: MutableMap> = mutableMapOf() } +fun buildFakeOverrideMember(superType: IrType, member: IrOverridableMember, clazz: IrClass): IrOverridableMember { + require(superType is IrSimpleType) { "superType is $superType, expected IrSimpleType" } + val classifier = superType.classifier + require(classifier is IrClassSymbol) { "superType classifier is not IrClassSymbol: $classifier" } + + val typeParameters = extractTypeParameters(classifier.owner) + val superArguments = superType.arguments + assert(typeParameters.size == superArguments.size) { + "typeParameters = $typeParameters size != typeArguments = $superArguments size " + } + + val substitutionMap = mutableMapOf() + + for (i in typeParameters.indices) { + val tp = typeParameters[i] + val ta = superArguments[i] + require(ta is IrTypeProjection) { "Unexpected super type argument: $ta @ $i" } + assert(ta.variance == Variance.INVARIANT) { "Unexpected variance in super type argument: ${ta.variance} @$i" } + substitutionMap[tp.symbol] = ta.type + } + + val copier = DeepCopyIrTreeWithSymbolsForFakeOverrides(substitutionMap) + val deepCopyFakeOverride = copier.copy(member, clazz) as IrOverridableMember + deepCopyFakeOverride.parent = clazz + + return deepCopyFakeOverride +} + + // TODO: // The below pile of code is basically half of OverridingUtil.java // adapted to IR and converted to Kotlin. @@ -294,7 +298,7 @@ class IrOverridingUtil( } val realOverrides = members - .map{ originals[it]!! } + .map { originals[it]!! } .collectAndFilterRealOverrides() return getMinimalModality(realOverrides, transformAbstractToClassModality, current.modality) } @@ -349,7 +353,10 @@ class IrOverridingUtil( return result } - private fun IrSimpleFunction.updateAccessorModalityAndVisibility(newModality: Modality, newVisibility: DescriptorVisibility): IrSimpleFunction? { + private fun IrSimpleFunction.updateAccessorModalityAndVisibility( + newModality: Modality, + newVisibility: DescriptorVisibility + ): IrSimpleFunction? { require(this is IrFakeOverrideFunction) { "Unexpected fake override accessor kind: $this" } @@ -746,15 +753,15 @@ class IrOverridingUtil( fun IrSimpleFunction.isOverridableFunction(): Boolean = this.visibility != DescriptorVisibilities.PRIVATE && - this.dispatchReceiverParameter != null + this.dispatchReceiverParameter != null fun IrProperty.isOverridableProperty(): Boolean = this.visibility != DescriptorVisibilities.PRIVATE && - (this.getter?.dispatchReceiverParameter != null || - this.setter?.dispatchReceiverParameter != null) + (this.getter?.dispatchReceiverParameter != null || + this.setter?.dispatchReceiverParameter != null) -fun IrDeclaration.isOverridableMemberOrAccessor(): Boolean = when(this) { +fun IrDeclaration.isOverridableMemberOrAccessor(): Boolean = when (this) { is IrSimpleFunction -> isOverridableFunction() is IrProperty -> isOverridableProperty() else -> false -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/invokedynamic/sam/builtinMemberReference.kt b/compiler/testData/codegen/box/invokedynamic/sam/builtinMemberReference.kt new file mode 100644 index 00000000000..b740f66d10d --- /dev/null +++ b/compiler/testData/codegen/box/invokedynamic/sam/builtinMemberReference.kt @@ -0,0 +1,16 @@ +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 +// SAM_CONVERSIONS: INDY + +fun interface IntFun { + fun invoke(i: Int): Int +} + +fun invoke1(intFun: IntFun) = intFun.invoke(1) + +fun box(): String { + val test = invoke1(41::plus) + if (test != 42) return "Failed: $test" + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/invokedynamic/sam/capturingVar.kt b/compiler/testData/codegen/box/invokedynamic/sam/capturingVar.kt new file mode 100644 index 00000000000..154375280e5 --- /dev/null +++ b/compiler/testData/codegen/box/invokedynamic/sam/capturingVar.kt @@ -0,0 +1,18 @@ +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 +// SAM_CONVERSIONS: INDY + +fun interface KRunnable { + fun run() +} + +fun runIt(r: KRunnable) { + r.run() +} + +fun box(): String { + var test = "Failed" + runIt { test = "OK" } + return test +} + diff --git a/compiler/testData/codegen/box/invokedynamic/sam/constructorReference.kt b/compiler/testData/codegen/box/invokedynamic/sam/constructorReference.kt new file mode 100644 index 00000000000..2dc2e0eba45 --- /dev/null +++ b/compiler/testData/codegen/box/invokedynamic/sam/constructorReference.kt @@ -0,0 +1,13 @@ +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 +// SAM_CONVERSIONS: INDY + +class C(val test: String) + +fun interface MakeC { + fun make(x: String): C +} + +fun make(makeC: MakeC) = makeC.make("OK") + +fun box() = make(::C).test \ No newline at end of file diff --git a/compiler/testData/codegen/box/invokedynamic/sam/genericFunInterface.kt b/compiler/testData/codegen/box/invokedynamic/sam/genericFunInterface.kt new file mode 100644 index 00000000000..cad954025dc --- /dev/null +++ b/compiler/testData/codegen/box/invokedynamic/sam/genericFunInterface.kt @@ -0,0 +1,11 @@ +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 +// SAM_CONVERSIONS: INDY + +fun interface IFoo { + fun foo(x: T): T +} + +fun foo(fs: IFoo) = fs.foo("O") + +fun box() = foo { "${it}K" } \ No newline at end of file diff --git a/compiler/testData/codegen/box/invokedynamic/sam/genericFunInterfaceWithPrimitive.kt b/compiler/testData/codegen/box/invokedynamic/sam/genericFunInterfaceWithPrimitive.kt new file mode 100644 index 00000000000..39720de74a1 --- /dev/null +++ b/compiler/testData/codegen/box/invokedynamic/sam/genericFunInterfaceWithPrimitive.kt @@ -0,0 +1,16 @@ +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 +// SAM_CONVERSIONS: INDY + +fun interface IFoo { + fun foo(x: T): T +} + +fun foo1(fs: IFoo) = fs.foo(1) + +fun box(): String { + val t = foo1 { it + 41 } + if (t != 42) return "Failed: t=$t" + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/invokedynamic/sam/samConversionOnFunctionReference.kt b/compiler/testData/codegen/box/invokedynamic/sam/samConversionOnFunctionReference.kt new file mode 100644 index 00000000000..5f3b249bd09 --- /dev/null +++ b/compiler/testData/codegen/box/invokedynamic/sam/samConversionOnFunctionReference.kt @@ -0,0 +1,22 @@ +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 +// SAM_CONVERSIONS: INDY + +fun interface KRunnable { + fun run() +} + +fun runnable(kr: KRunnable) = kr + +fun foo() {} + +fun box(): String { + val foo1 = runnable(::foo) + val foo2 = runnable(::foo) + + if (foo1 != foo2) { + return "Failed: foo1 != foo2" + } + + return "OK" +} \ No newline at end of file diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index 53fb681de35..b852eac241a 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -18403,6 +18403,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/invokedynamic/sam/boundReference.kt"); } + @Test + @TestMetadata("builtinMemberReference.kt") + public void testBuiltinMemberReference() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/builtinMemberReference.kt"); + } + @Test @TestMetadata("capturedDispatchReceiver.kt") public void testCapturedDispatchReceiver() throws Exception { @@ -18427,12 +18433,42 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/invokedynamic/sam/capturingIndySam.kt"); } + @Test + @TestMetadata("capturingVar.kt") + public void testCapturingVar() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/capturingVar.kt"); + } + + @Test + @TestMetadata("constructorReference.kt") + public void testConstructorReference() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/constructorReference.kt"); + } + + @Test + @TestMetadata("genericFunInterface.kt") + public void testGenericFunInterface() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/genericFunInterface.kt"); + } + + @Test + @TestMetadata("genericFunInterfaceWithPrimitive.kt") + public void testGenericFunInterfaceWithPrimitive() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/genericFunInterfaceWithPrimitive.kt"); + } + @Test @TestMetadata("primitiveVsWrapperInSam.kt") public void testPrimitiveVsWrapperInSam() throws Exception { runTest("compiler/testData/codegen/box/invokedynamic/sam/primitiveVsWrapperInSam.kt"); } + @Test + @TestMetadata("samConversionOnFunctionReference.kt") + public void testSamConversionOnFunctionReference() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/samConversionOnFunctionReference.kt"); + } + @Test @TestMetadata("simpleIndyFunInterface.kt") public void testSimpleIndyFunInterface() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index 32fec2dfbaf..37d1b98a5ab 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -18403,6 +18403,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/invokedynamic/sam/boundReference.kt"); } + @Test + @TestMetadata("builtinMemberReference.kt") + public void testBuiltinMemberReference() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/builtinMemberReference.kt"); + } + @Test @TestMetadata("capturedDispatchReceiver.kt") public void testCapturedDispatchReceiver() throws Exception { @@ -18427,12 +18433,42 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/invokedynamic/sam/capturingIndySam.kt"); } + @Test + @TestMetadata("capturingVar.kt") + public void testCapturingVar() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/capturingVar.kt"); + } + + @Test + @TestMetadata("constructorReference.kt") + public void testConstructorReference() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/constructorReference.kt"); + } + + @Test + @TestMetadata("genericFunInterface.kt") + public void testGenericFunInterface() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/genericFunInterface.kt"); + } + + @Test + @TestMetadata("genericFunInterfaceWithPrimitive.kt") + public void testGenericFunInterfaceWithPrimitive() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/genericFunInterfaceWithPrimitive.kt"); + } + @Test @TestMetadata("primitiveVsWrapperInSam.kt") public void testPrimitiveVsWrapperInSam() throws Exception { runTest("compiler/testData/codegen/box/invokedynamic/sam/primitiveVsWrapperInSam.kt"); } + @Test + @TestMetadata("samConversionOnFunctionReference.kt") + public void testSamConversionOnFunctionReference() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/samConversionOnFunctionReference.kt"); + } + @Test @TestMetadata("simpleIndyFunInterface.kt") public void testSimpleIndyFunInterface() throws Exception { diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/JvmBoxRunner.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/JvmBoxRunner.kt index 241a386ba7a..bc6d0f08b22 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/JvmBoxRunner.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/JvmBoxRunner.kt @@ -46,7 +46,11 @@ class JvmBoxRunner(testServices: TestServices) : JvmBinaryArtifactHandler(testSe try { for (ktFile in ktFiles) { val className = ktFile.getFacadeFqName() ?: continue - val clazz = classLoader.getGeneratedClass(className) + val clazz = try { + classLoader.getGeneratedClass(className) + } catch (e: LinkageError) { + throw AssertionError("Failed to load class '$className':\n${info.classFileFactory.createText()}", e) + } val method = clazz.getBoxMethodOrNull() ?: continue boxMethodFound = true callBoxMethodAndCheckResultWithCleanup( @@ -128,7 +132,7 @@ class JvmBoxRunner(testServices: TestServices) : JvmBinaryArtifactHandler(testSe ): GeneratedClassLoader { val classLoader = createClassLoader(module, classFileFactory) val verificationSucceeded = CodegenTestUtil.verifyAllFilesWithAsm(classFileFactory, classLoader, reportProblems) - if (!verificationSucceeded ) { + if (!verificationSucceeded) { assertions.fail { "Verification failed: see exceptions above" } } return classLoader diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 66256fab17f..9dc6251ccc7 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -16138,6 +16138,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/invokedynamic/sam/boundReference.kt"); } + @TestMetadata("builtinMemberReference.kt") + public void testBuiltinMemberReference() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/builtinMemberReference.kt"); + } + @TestMetadata("capturedDispatchReceiver.kt") public void testCapturedDispatchReceiver() throws Exception { runTest("compiler/testData/codegen/box/invokedynamic/sam/capturedDispatchReceiver.kt"); @@ -16158,11 +16163,36 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/invokedynamic/sam/capturingIndySam.kt"); } + @TestMetadata("capturingVar.kt") + public void testCapturingVar() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/capturingVar.kt"); + } + + @TestMetadata("constructorReference.kt") + public void testConstructorReference() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/constructorReference.kt"); + } + + @TestMetadata("genericFunInterface.kt") + public void testGenericFunInterface() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/genericFunInterface.kt"); + } + + @TestMetadata("genericFunInterfaceWithPrimitive.kt") + public void testGenericFunInterfaceWithPrimitive() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/genericFunInterfaceWithPrimitive.kt"); + } + @TestMetadata("primitiveVsWrapperInSam.kt") public void testPrimitiveVsWrapperInSam() throws Exception { runTest("compiler/testData/codegen/box/invokedynamic/sam/primitiveVsWrapperInSam.kt"); } + @TestMetadata("samConversionOnFunctionReference.kt") + public void testSamConversionOnFunctionReference() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/samConversionOnFunctionReference.kt"); + } + @TestMetadata("simpleIndyFunInterface.kt") public void testSimpleIndyFunInterface() throws Exception { runTest("compiler/testData/codegen/box/invokedynamic/sam/simpleIndyFunInterface.kt"); From 1f16b9679652b8bdc432e6ea4547bbfb077ce565 Mon Sep 17 00:00:00 2001 From: Dmitry Petrov Date: Thu, 21 Jan 2021 17:39:46 +0300 Subject: [PATCH 165/212] JVM_IR indy-SAM conversions: inline classes KT-44278 KT-26060 KT-42621 --- .../FirBlackBoxCodegenTestGenerated.java | 82 ++++++++++++++++++ .../kotlin/backend/jvm/JvmSymbols.kt | 4 +- .../jvm/intrinsics/JvmInvokeDynamic.kt | 54 ++++++------ .../jvm/lower/FunctionReferenceLowering.kt | 84 ++++++++++++++++++- .../sam/genericFunInterfaceWithPrimitive.kt | 12 ++- .../funInterfaceWithInlineAny.kt | 18 ++++ .../funInterfaceWithInlineInt.kt | 18 ++++ .../funInterfaceWithInlineNAny.kt | 18 ++++ .../funInterfaceWithInlineNInt.kt | 18 ++++ .../funInterfaceWithInlineNString.kt | 18 ++++ .../funInterfaceWithInlineString.kt | 18 ++++ .../genericFunInterfaceWithInlineAny.kt | 18 ++++ .../genericFunInterfaceWithInlineInt.kt | 18 ++++ .../genericFunInterfaceWithInlineNAny.kt | 18 ++++ .../genericFunInterfaceWithInlineNInt.kt | 18 ++++ .../genericFunInterfaceWithInlineNString.kt | 18 ++++ .../genericFunInterfaceWithInlineString.kt | 18 ++++ .../codegen/BlackBoxCodegenTestGenerated.java | 82 ++++++++++++++++++ .../IrBlackBoxCodegenTestGenerated.java | 82 ++++++++++++++++++ .../test/directives/CodegenTestDirectives.kt | 3 - .../JvmEnvironmentConfigurationDirectives.kt | 10 ++- .../AbstractJvmBlackBoxCodegenTestBase.kt | 10 --- .../JvmEnvironmentConfigurator.kt | 7 +- .../LightAnalysisModeTestGenerated.java | 73 ++++++++++++++++ .../IrJsCodegenBoxES6TestGenerated.java | 13 +++ .../IrJsCodegenBoxTestGenerated.java | 13 +++ .../semantics/JsCodegenBoxTestGenerated.java | 13 +++ .../IrCodegenBoxWasmTestGenerated.java | 13 +++ 28 files changed, 721 insertions(+), 50 deletions(-) create mode 100644 compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineAny.kt create mode 100644 compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineInt.kt create mode 100644 compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineNAny.kt create mode 100644 compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineNInt.kt create mode 100644 compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineNString.kt create mode 100644 compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineString.kt create mode 100644 compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineAny.kt create mode 100644 compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineInt.kt create mode 100644 compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineNAny.kt create mode 100644 compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineNInt.kt create mode 100644 compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineNString.kt create mode 100644 compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineString.kt diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java index 7e4cee4a7cd..b053ab04fff 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java @@ -18480,6 +18480,88 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT public void testSimpleIndySam() throws Exception { runTest("compiler/testData/codegen/box/invokedynamic/sam/simpleIndySam.kt"); } + + @Nested + @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature") + @TestDataPath("$PROJECT_ROOT") + public class InlineClassInSignature extends AbstractFirBlackBoxCodegenTest { + @Test + public void testAllFilesPresentInInlineClassInSignature() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("funInterfaceWithInlineAny.kt") + public void testFunInterfaceWithInlineAny() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineAny.kt"); + } + + @Test + @TestMetadata("funInterfaceWithInlineInt.kt") + public void testFunInterfaceWithInlineInt() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineInt.kt"); + } + + @Test + @TestMetadata("funInterfaceWithInlineNAny.kt") + public void testFunInterfaceWithInlineNAny() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineNAny.kt"); + } + + @Test + @TestMetadata("funInterfaceWithInlineNInt.kt") + public void testFunInterfaceWithInlineNInt() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineNInt.kt"); + } + + @Test + @TestMetadata("funInterfaceWithInlineNString.kt") + public void testFunInterfaceWithInlineNString() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineNString.kt"); + } + + @Test + @TestMetadata("funInterfaceWithInlineString.kt") + public void testFunInterfaceWithInlineString() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineString.kt"); + } + + @Test + @TestMetadata("genericFunInterfaceWithInlineAny.kt") + public void testGenericFunInterfaceWithInlineAny() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineAny.kt"); + } + + @Test + @TestMetadata("genericFunInterfaceWithInlineInt.kt") + public void testGenericFunInterfaceWithInlineInt() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineInt.kt"); + } + + @Test + @TestMetadata("genericFunInterfaceWithInlineNAny.kt") + public void testGenericFunInterfaceWithInlineNAny() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineNAny.kt"); + } + + @Test + @TestMetadata("genericFunInterfaceWithInlineNInt.kt") + public void testGenericFunInterfaceWithInlineNInt() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineNInt.kt"); + } + + @Test + @TestMetadata("genericFunInterfaceWithInlineNString.kt") + public void testGenericFunInterfaceWithInlineNString() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineNString.kt"); + } + + @Test + @TestMetadata("genericFunInterfaceWithInlineString.kt") + public void testGenericFunInterfaceWithInlineString() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineString.kt"); + } + } } } diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmSymbols.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmSymbols.kt index 7b3dfb7812a..185fdb02864 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmSymbols.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/JvmSymbols.kt @@ -454,7 +454,7 @@ class JvmSymbols( } val receiverFieldName = Name.identifier("receiver") - klass.addProperty() { + klass.addProperty { name = receiverFieldName }.apply { backingField = irFactory.buildField { @@ -658,7 +658,7 @@ class JvmSymbols( collectionToArrayClass.functions.single { it.owner.name.asString() == "toArray" && it.owner.valueParameters.size == 2 } val kClassJava: IrPropertySymbol = - irFactory.buildProperty() { + irFactory.buildProperty { name = Name.identifier("java") }.apply { parent = kotlinJvmPackage diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/intrinsics/JvmInvokeDynamic.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/intrinsics/JvmInvokeDynamic.kt index 4b814c4c710..a7911e1bd52 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/intrinsics/JvmInvokeDynamic.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/intrinsics/JvmInvokeDynamic.kt @@ -15,9 +15,7 @@ import org.jetbrains.kotlin.ir.expressions.* import org.jetbrains.kotlin.ir.overrides.buildFakeOverrideMember import org.jetbrains.kotlin.ir.types.* import org.jetbrains.kotlin.ir.types.impl.makeTypeProjection -import org.jetbrains.kotlin.ir.util.dump -import org.jetbrains.kotlin.ir.util.parentAsClass -import org.jetbrains.kotlin.ir.util.render +import org.jetbrains.kotlin.ir.util.* import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.utils.addToStdlib.safeAs import org.jetbrains.org.objectweb.asm.Handle @@ -136,38 +134,46 @@ object JvmInvokeDynamic : IntrinsicMethod() { ?: fail("Argument in ${irCall.symbol.owner.name} call is expected to be a raw function reference") val irOriginalFun = irRawFunRef.symbol.owner as? IrSimpleFunction ?: fail("IrSimpleFunction expected: ${irRawFunRef.symbol.owner.render()}") - val substitutedType = irCall.getTypeArgument(0) as? IrSimpleType + val superType = irCall.getTypeArgument(0) as? IrSimpleType ?: fail("Type argument expected") - // Force boxing on primitive types, otherwise D8 fails to accept resulting MethodType in presence of primitive types in arguments - // (LambdaMetafactory is ok with such types, though). - val substitutedTypeWithNullableArgs = - substitutedType.classifier.typeWithArguments( - substitutedType.arguments.map { - when (it) { - is IrStarProjection -> it - is IrTypeProjection -> { - val type = it.type - if (type !is IrSimpleType || type.hasQuestionMark) - it - else - makeTypeProjection(type.withHasQuestionMark(true), it.variance) - } - else -> - fail("Unexpected type argument '${it}' :: ${it::class.simpleName}") - } - } - ) + val patchedSuperType = replaceTypeArgumentsWithNullable(superType) val fakeClass = codegen.context.irFactory.buildClass { name = Name.special("") } fakeClass.parent = codegen.context.ir.symbols.kotlinJvmInternalInvokeDynamicPackage - val irFakeOverride = buildFakeOverrideMember(substitutedTypeWithNullableArgs, irOriginalFun, fakeClass) as IrSimpleFunction + val irFakeOverride = buildFakeOverrideMember(patchedSuperType, irOriginalFun, fakeClass) as IrSimpleFunction irFakeOverride.overriddenSymbols = listOf(irOriginalFun.symbol) val asmMethod = codegen.methodSignatureMapper.mapAsmMethod(irFakeOverride) return Type.getMethodType(asmMethod.descriptor) } + // Given the following functional interface + // fun interface IFoo { + // fun foo(x: T): T + // } + // To comply with java.lang.invoke.LambdaMetafactory requirements, we need an instance method that accepts references + // (not primitives, and not unboxed inline classes). + // In order to do so, we replace type arguments with nullable types. + private fun replaceTypeArgumentsWithNullable(substitutedType: IrSimpleType) = + substitutedType.classifier.typeWithArguments( + substitutedType.arguments.map { typeArgument -> + when (typeArgument) { + is IrStarProjection -> typeArgument + is IrTypeProjection -> { + val type = typeArgument.type + if (type !is IrSimpleType || type.hasQuestionMark) + typeArgument + else { + makeTypeProjection(type.withHasQuestionMark(true), typeArgument.variance) + } + } + else -> + throw AssertionError("Unexpected type argument '$typeArgument' :: ${typeArgument::class.simpleName}") + } + } + ) + private fun IrExpression.getIntConst() = if (this is IrConst<*> && kind == IrConstKind.Int) this.value as Int diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/FunctionReferenceLowering.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/FunctionReferenceLowering.kt index 3aaf90526b7..afecc5eaefc 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/FunctionReferenceLowering.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/FunctionReferenceLowering.kt @@ -12,6 +12,7 @@ import org.jetbrains.kotlin.backend.common.lower.SamEqualsHashCodeMethodsGenerat import org.jetbrains.kotlin.backend.common.phaser.makeIrFilePhase import org.jetbrains.kotlin.backend.jvm.JvmBackendContext import org.jetbrains.kotlin.backend.jvm.JvmLoweredDeclarationOrigin +import org.jetbrains.kotlin.backend.jvm.codegen.representativeUpperBound import org.jetbrains.kotlin.backend.jvm.ir.* import org.jetbrains.kotlin.backend.jvm.lower.inlineclasses.InlineClassAbi import org.jetbrains.kotlin.config.JvmSamConversions @@ -29,6 +30,7 @@ import org.jetbrains.kotlin.ir.util.* import org.jetbrains.kotlin.ir.visitors.transformChildrenVoid import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.name.SpecialNames +import org.jetbrains.kotlin.utils.addIfNotNull internal val functionReferencePhase = makeIrFilePhase( ::FunctionReferenceLowering, @@ -115,21 +117,54 @@ internal class FunctionReferenceLowering(private val context: JvmBackendContext) // TODO special mode that would generate indy everywhere? if (reference.origin != IrStatementOrigin.LAMBDA) return false + // TODO wrap intrinsic function in lambda? if (context.irIntrinsics.getIntrinsic(reference.symbol) != null) return false + + // Can't use JDK LambdaMetafactory if lambda signature contains an inline class mapped to a non-null reference type. + val target = reference.symbol.owner + if (target.extensionReceiverParameter?.run { type.isProhibitedTypeForIndySamConversion() } == true || + target.valueParameters.any { it.type.isProhibitedTypeForIndySamConversion() } || + target.returnType.isProhibitedTypeForIndySamConversion() + ) + return false + return true } + private fun IrType.isProhibitedTypeForIndySamConversion(): Boolean { + if (this !is IrSimpleType) return false + + val erasedType = when (val classifier = classifier.owner) { + is IrTypeParameter -> + classifier.representativeUpperBound.withHasQuestionMark(hasQuestionMark) + else -> + this + } + val erasedClass = erasedType.getClass() ?: return false + + if (!erasedType.isInlined()) return false + + val underlyingType = getInlineClassUnderlyingType(erasedClass) as? IrSimpleType + ?: throw AssertionError("Underlying type for inline class should be a simple type: ${erasedClass.render()}") + return !underlyingType.hasQuestionMark && !underlyingType.isJvmPrimitiveType() + } + + private fun IrType.isJvmPrimitiveType() = + isBoolean() || isChar() || isByte() || isShort() || isInt() || isLong() || isFloat() || isDouble() + private fun wrapSamConversionArgumentWithIndySamConversion(expression: IrTypeOperatorCall): IrExpression { + val samType = expression.typeOperand return when (val argument = expression.argument) { - is IrFunctionReference -> - wrapWithIndySamConversion(expression.typeOperand, argument) + is IrFunctionReference -> { + wrapWithIndySamConversion(samType, argument) + } is IrBlock -> { val last = argument.statements.last() val functionReference = last as? IrFunctionReference ?: throw AssertionError("Function reference expected: ${last.render()}") - argument.statements[argument.statements.size - 1] = wrapWithIndySamConversion(expression.typeOperand, functionReference) + argument.statements[argument.statements.size - 1] = wrapWithIndySamConversion(samType, functionReference) return argument } else -> throw AssertionError("Block or function reference expected: ${expression.render()}") @@ -145,6 +180,7 @@ internal class FunctionReferenceLowering(private val context: JvmBackendContext) ) private fun wrapWithIndySamConversion(samType: IrType, irFunRef: IrFunctionReference): IrCall { + patchSignatureForIndySamConversion(irFunRef.symbol.owner, samType) val notNullSamType = samType.makeNotNull() .removeAnnotations { it.type.classFqName in specialNullabilityAnnotationsFqNames } return context.createJvmIrBuilder(currentScope!!.scope.scopeOwnerSymbol).run { @@ -161,6 +197,48 @@ internal class FunctionReferenceLowering(private val context: JvmBackendContext) } } + private fun patchSignatureForIndySamConversion(irLambda: IrFunction, samType: IrType) { + if (irLambda.origin != IrDeclarationOrigin.LOCAL_FUNCTION_FOR_LAMBDA) + throw AssertionError("Can't patch a signature of a non-lambda: ${irLambda.render()}") + + val samClass = samType.classOrNull?.owner + ?: throw AssertionError("SAM type should be a class type: '${samType.render()}'") + val samMethod = samClass.functions.singleOrNull { it.modality == Modality.ABSTRACT } + ?: throw AssertionError("SAM method not found:\n${samClass.dump()}") + + val samMethodParameters = collectValueParameters(samMethod) + val irLambdaParameters = collectValueParameters(irLambda) + if (samMethodParameters.size != irLambdaParameters.size) { + throw AssertionError( + "SAM method and implementing lambda have mismatching value parameters " + + "(${samMethodParameters.size} != ${irLambdaParameters.size}:\n" + + "samMethod: ${samMethod.render()}\n" + + "lambda: ${irLambda.render()}" + ) + } + + for ((irLambdaParameter, samMethodParameter) in irLambdaParameters.zip(samMethodParameters)) { + irLambdaParameter.type = patchTypeForIndySamConversion(irLambdaParameter.type, samMethodParameter.type) + } + + irLambda.returnType = patchTypeForIndySamConversion(irLambda.returnType, samMethod.returnType) + } + + private fun collectValueParameters(irFunction: IrFunction): List = + ArrayList().apply { + addIfNotNull(irFunction.extensionReceiverParameter) + addAll(irFunction.valueParameters) + } + + private fun patchTypeForIndySamConversion(originalType: IrType, targetType: IrType): IrType { + if (originalType.isUnboxedInlineClassType() && !targetType.isUnboxedInlineClassType()) + return targetType + return originalType + } + + private fun IrType.isUnboxedInlineClassType() = + this is IrSimpleType && isInlined() && !hasQuestionMark + private inner class FunctionReferenceBuilder(val irFunctionReference: IrFunctionReference, val samSuperType: IrType? = null) { private val isLambda = irFunctionReference.origin.isLambda diff --git a/compiler/testData/codegen/box/invokedynamic/sam/genericFunInterfaceWithPrimitive.kt b/compiler/testData/codegen/box/invokedynamic/sam/genericFunInterfaceWithPrimitive.kt index 39720de74a1..1e0089f0b94 100644 --- a/compiler/testData/codegen/box/invokedynamic/sam/genericFunInterfaceWithPrimitive.kt +++ b/compiler/testData/codegen/box/invokedynamic/sam/genericFunInterfaceWithPrimitive.kt @@ -6,11 +6,21 @@ fun interface IFoo { fun foo(x: T): T } -fun foo1(fs: IFoo) = fs.foo(1) +fun interface IBar { + fun bar(x: T): T +} + + +fun foo1(foo: IFoo) = foo.foo(1) + +fun bar1(bar: IBar) = bar.bar(1) fun box(): String { val t = foo1 { it + 41 } if (t != 42) return "Failed: t=$t" + val tt = bar1 { it + 41 } + if (tt != 42) return "Failed: tt=$tt" + return "OK" } \ No newline at end of file diff --git a/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineAny.kt b/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineAny.kt new file mode 100644 index 00000000000..2de01599722 --- /dev/null +++ b/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineAny.kt @@ -0,0 +1,18 @@ +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 +// SAM_CONVERSIONS: INDY + +inline class Z(val value: Any) + +fun interface IFooZ { + fun foo(x: Z): Z +} + +fun foo1(fs: IFooZ) = fs.foo(Z(1)) + +fun box(): String { + val t = foo1 { Z((it.value as Int) + 41) } + if (t.value != 42) return "Failed: t=$t" + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineInt.kt b/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineInt.kt new file mode 100644 index 00000000000..56dd6f9f7a7 --- /dev/null +++ b/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineInt.kt @@ -0,0 +1,18 @@ +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 +// SAM_CONVERSIONS: INDY + +inline class Z(val value: Int) + +fun interface IFooZ { + fun foo(x: Z): Z +} + +fun foo1(fs: IFooZ) = fs.foo(Z(1)) + +fun box(): String { + val t = foo1 { Z(it.value + 41) } + if (t.value != 42) return "Failed: t=$t" + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineNAny.kt b/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineNAny.kt new file mode 100644 index 00000000000..cb73273e940 --- /dev/null +++ b/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineNAny.kt @@ -0,0 +1,18 @@ +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 +// SAM_CONVERSIONS: INDY + +inline class Z(val value: Any?) + +fun interface IFooZ { + fun foo(x: Z): Z +} + +fun foo1(fs: IFooZ) = fs.foo(Z(1)) + +fun box(): String { + val t = foo1 { Z((it.value as Int) + 41) } + if (t.value != 42) return "Failed: t=$t" + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineNInt.kt b/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineNInt.kt new file mode 100644 index 00000000000..772f4ce7d5f --- /dev/null +++ b/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineNInt.kt @@ -0,0 +1,18 @@ +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 +// SAM_CONVERSIONS: INDY + +inline class Z(val value: Int?) + +fun interface IFooZ { + fun foo(x: Z): Z +} + +fun foo1(fs: IFooZ) = fs.foo(Z(1)) + +fun box(): String { + val t = foo1 { Z(it.value!! + 41) } + if (t.value != 42) return "Failed: t=$t" + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineNString.kt b/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineNString.kt new file mode 100644 index 00000000000..eea458ecb5d --- /dev/null +++ b/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineNString.kt @@ -0,0 +1,18 @@ +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 +// SAM_CONVERSIONS: INDY + +inline class Z(val value: String?) + +fun interface IFooZ { + fun foo(x: Z): Z +} + +fun foo1(fs: IFooZ) = fs.foo(Z("O")) + +fun box(): String { + val t = foo1 { Z(it.value!! + "K") } + if (t.value != "OK") return "Failed: t=$t" + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineString.kt b/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineString.kt new file mode 100644 index 00000000000..0406d90261f --- /dev/null +++ b/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineString.kt @@ -0,0 +1,18 @@ +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 +// SAM_CONVERSIONS: INDY + +inline class Z(val value: String) + +fun interface IFooZ { + fun foo(x: Z): Z +} + +fun foo1(fs: IFooZ) = fs.foo(Z("O")) + +fun box(): String { + val t = foo1 { Z(it.value + "K") } + if (t.value != "OK") return "Failed: t=$t" + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineAny.kt b/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineAny.kt new file mode 100644 index 00000000000..fd947fd82a5 --- /dev/null +++ b/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineAny.kt @@ -0,0 +1,18 @@ +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 +// SAM_CONVERSIONS: INDY + +inline class Z(val value: Any) + +fun interface IFoo { + fun foo(x: T): T +} + +fun foo1(fs: IFoo) = fs.foo(Z(1)) + +fun box(): String { + val t = foo1 { Z((it.value as Int) + 41) } + if (t.value != 42) return "Failed: t=$t" + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineInt.kt b/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineInt.kt new file mode 100644 index 00000000000..09a6bdb34c8 --- /dev/null +++ b/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineInt.kt @@ -0,0 +1,18 @@ +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 +// SAM_CONVERSIONS: INDY + +inline class Z(val value: Int) + +fun interface IFoo { + fun foo(x: T): T +} + +fun foo1(fs: IFoo) = fs.foo(Z(1)) + +fun box(): String { + val t = foo1 { Z(it.value + 41) } + if (t.value != 42) return "Failed: t=$t" + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineNAny.kt b/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineNAny.kt new file mode 100644 index 00000000000..1f78a6f08c5 --- /dev/null +++ b/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineNAny.kt @@ -0,0 +1,18 @@ +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 +// SAM_CONVERSIONS: INDY + +inline class Z(val value: Any?) + +fun interface IFoo { + fun foo(x: T): T +} + +fun foo1(fs: IFoo) = fs.foo(Z(1)) + +fun box(): String { + val t = foo1 { Z((it.value as Int) + 41) } + if (t.value != 42) return "Failed: t=$t" + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineNInt.kt b/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineNInt.kt new file mode 100644 index 00000000000..e25d329567e --- /dev/null +++ b/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineNInt.kt @@ -0,0 +1,18 @@ +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 +// SAM_CONVERSIONS: INDY + +inline class Z(val value: Int?) + +fun interface IFoo { + fun foo(x: T): T +} + +fun foo1(fs: IFoo) = fs.foo(Z(1)) + +fun box(): String { + val t = foo1 { Z(it.value!! + 41) } + if (t.value != 42) return "Failed: t=$t" + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineNString.kt b/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineNString.kt new file mode 100644 index 00000000000..2117696068f --- /dev/null +++ b/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineNString.kt @@ -0,0 +1,18 @@ +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 +// SAM_CONVERSIONS: INDY + +inline class Z(val value: String?) + +fun interface IFoo { + fun foo(x: T): T +} + +fun foo1(fs: IFoo) = fs.foo(Z("O")) + +fun box(): String { + val t = foo1 { Z(it.value!! + "K") } + if (t.value != "OK") return "Failed: t=$t" + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineString.kt b/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineString.kt new file mode 100644 index 00000000000..972673c3156 --- /dev/null +++ b/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineString.kt @@ -0,0 +1,18 @@ +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 +// SAM_CONVERSIONS: INDY + +inline class Z(val value: String) + +fun interface IFoo { + fun foo(x: T): T +} + +fun foo1(fs: IFoo) = fs.foo(Z("O")) + +fun box(): String { + val t = foo1 { Z(it.value + "K") } + if (t.value != "OK") return "Failed: t=$t" + + return "OK" +} \ No newline at end of file diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index b852eac241a..cdce1fbec58 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -18480,6 +18480,88 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { public void testSimpleIndySam() throws Exception { runTest("compiler/testData/codegen/box/invokedynamic/sam/simpleIndySam.kt"); } + + @Nested + @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature") + @TestDataPath("$PROJECT_ROOT") + public class InlineClassInSignature extends AbstractBlackBoxCodegenTest { + @Test + public void testAllFilesPresentInInlineClassInSignature() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); + } + + @Test + @TestMetadata("funInterfaceWithInlineAny.kt") + public void testFunInterfaceWithInlineAny() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineAny.kt"); + } + + @Test + @TestMetadata("funInterfaceWithInlineInt.kt") + public void testFunInterfaceWithInlineInt() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineInt.kt"); + } + + @Test + @TestMetadata("funInterfaceWithInlineNAny.kt") + public void testFunInterfaceWithInlineNAny() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineNAny.kt"); + } + + @Test + @TestMetadata("funInterfaceWithInlineNInt.kt") + public void testFunInterfaceWithInlineNInt() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineNInt.kt"); + } + + @Test + @TestMetadata("funInterfaceWithInlineNString.kt") + public void testFunInterfaceWithInlineNString() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineNString.kt"); + } + + @Test + @TestMetadata("funInterfaceWithInlineString.kt") + public void testFunInterfaceWithInlineString() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineString.kt"); + } + + @Test + @TestMetadata("genericFunInterfaceWithInlineAny.kt") + public void testGenericFunInterfaceWithInlineAny() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineAny.kt"); + } + + @Test + @TestMetadata("genericFunInterfaceWithInlineInt.kt") + public void testGenericFunInterfaceWithInlineInt() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineInt.kt"); + } + + @Test + @TestMetadata("genericFunInterfaceWithInlineNAny.kt") + public void testGenericFunInterfaceWithInlineNAny() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineNAny.kt"); + } + + @Test + @TestMetadata("genericFunInterfaceWithInlineNInt.kt") + public void testGenericFunInterfaceWithInlineNInt() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineNInt.kt"); + } + + @Test + @TestMetadata("genericFunInterfaceWithInlineNString.kt") + public void testGenericFunInterfaceWithInlineNString() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineNString.kt"); + } + + @Test + @TestMetadata("genericFunInterfaceWithInlineString.kt") + public void testGenericFunInterfaceWithInlineString() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineString.kt"); + } + } } } diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index 37d1b98a5ab..43130867dd2 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -18480,6 +18480,88 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes public void testSimpleIndySam() throws Exception { runTest("compiler/testData/codegen/box/invokedynamic/sam/simpleIndySam.kt"); } + + @Nested + @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature") + @TestDataPath("$PROJECT_ROOT") + public class InlineClassInSignature extends AbstractIrBlackBoxCodegenTest { + @Test + public void testAllFilesPresentInInlineClassInSignature() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("funInterfaceWithInlineAny.kt") + public void testFunInterfaceWithInlineAny() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineAny.kt"); + } + + @Test + @TestMetadata("funInterfaceWithInlineInt.kt") + public void testFunInterfaceWithInlineInt() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineInt.kt"); + } + + @Test + @TestMetadata("funInterfaceWithInlineNAny.kt") + public void testFunInterfaceWithInlineNAny() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineNAny.kt"); + } + + @Test + @TestMetadata("funInterfaceWithInlineNInt.kt") + public void testFunInterfaceWithInlineNInt() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineNInt.kt"); + } + + @Test + @TestMetadata("funInterfaceWithInlineNString.kt") + public void testFunInterfaceWithInlineNString() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineNString.kt"); + } + + @Test + @TestMetadata("funInterfaceWithInlineString.kt") + public void testFunInterfaceWithInlineString() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineString.kt"); + } + + @Test + @TestMetadata("genericFunInterfaceWithInlineAny.kt") + public void testGenericFunInterfaceWithInlineAny() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineAny.kt"); + } + + @Test + @TestMetadata("genericFunInterfaceWithInlineInt.kt") + public void testGenericFunInterfaceWithInlineInt() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineInt.kt"); + } + + @Test + @TestMetadata("genericFunInterfaceWithInlineNAny.kt") + public void testGenericFunInterfaceWithInlineNAny() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineNAny.kt"); + } + + @Test + @TestMetadata("genericFunInterfaceWithInlineNInt.kt") + public void testGenericFunInterfaceWithInlineNInt() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineNInt.kt"); + } + + @Test + @TestMetadata("genericFunInterfaceWithInlineNString.kt") + public void testGenericFunInterfaceWithInlineNString() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineNString.kt"); + } + + @Test + @TestMetadata("genericFunInterfaceWithInlineString.kt") + public void testGenericFunInterfaceWithInlineString() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineString.kt"); + } + } } } diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/CodegenTestDirectives.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/CodegenTestDirectives.kt index 620dbdeada9..dbb639e7e88 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/CodegenTestDirectives.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/CodegenTestDirectives.kt @@ -5,7 +5,6 @@ package org.jetbrains.kotlin.test.directives -import org.jetbrains.kotlin.config.JvmSamConversions import org.jetbrains.kotlin.test.TargetBackend import org.jetbrains.kotlin.test.backend.handlers.BytecodeTextHandler import org.jetbrains.kotlin.test.backend.handlers.IrPrettyKotlinDumpHandler @@ -91,6 +90,4 @@ object CodegenTestDirectives : SimpleDirectivesContainer() { val TREAT_AS_ONE_FILE by directive( description = "Treat bytecode from all files as one in ${BytecodeTextHandler::class}" ) - - val SAM_CONVERSIONS by enumDirective("SAM conversion code generation scheme") } diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/JvmEnvironmentConfigurationDirectives.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/JvmEnvironmentConfigurationDirectives.kt index 23b8513d982..7284c782bea 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/JvmEnvironmentConfigurationDirectives.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/JvmEnvironmentConfigurationDirectives.kt @@ -5,10 +5,7 @@ package org.jetbrains.kotlin.test.directives -import org.jetbrains.kotlin.config.JVMAssertionsMode -import org.jetbrains.kotlin.config.JVMConstructorCallNormalizationMode -import org.jetbrains.kotlin.config.JvmStringConcat -import org.jetbrains.kotlin.config.JvmTarget +import org.jetbrains.kotlin.config.* import org.jetbrains.kotlin.test.TestJdkKind import org.jetbrains.kotlin.test.directives.model.SimpleDirectivesContainer @@ -56,4 +53,9 @@ object JvmEnvironmentConfigurationDirectives : SimpleDirectivesContainer() { description = "Configure jvm constructor call normalization mode", additionalParser = JVMConstructorCallNormalizationMode.Companion::fromStringOrNull ) + + val SAM_CONVERSIONS by enumDirective( + description = "SAM conversion code generation scheme", + additionalParser = JvmSamConversions.Companion::fromString + ) } diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/codegen/AbstractJvmBlackBoxCodegenTestBase.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/codegen/AbstractJvmBlackBoxCodegenTestBase.kt index 2548fd55c73..39058915bb5 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/codegen/AbstractJvmBlackBoxCodegenTestBase.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/codegen/AbstractJvmBlackBoxCodegenTestBase.kt @@ -40,13 +40,3 @@ abstract class AbstractJvmBlackBoxCodegenTestBase Date: Tue, 26 Jan 2021 14:40:55 +0300 Subject: [PATCH 166/212] JVM_IR indy-SAM conversions: use old scheme for suspend funs KT-44278 KT-26060 KT-42621 --- .../FirBlackBoxCodegenTestGenerated.java | 6 +++ .../kotlin/backend/jvm/ir/IrUtils.kt | 6 +++ .../jvm/lower/FunctionReferenceLowering.kt | 26 +++++++----- .../backend/jvm/lower/TypeOperatorLowering.kt | 7 +--- .../kotlin/ir/declarations/IrFunction.kt | 1 - .../invokedynamic/sam/suspendFunInterface.kt | 42 +++++++++++++++++++ .../codegen/BlackBoxCodegenTestGenerated.java | 6 +++ .../IrBlackBoxCodegenTestGenerated.java | 6 +++ .../LightAnalysisModeTestGenerated.java | 5 +++ 9 files changed, 88 insertions(+), 17 deletions(-) create mode 100644 compiler/testData/codegen/box/invokedynamic/sam/suspendFunInterface.kt diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java index b053ab04fff..c498716f469 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java @@ -18481,6 +18481,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/invokedynamic/sam/simpleIndySam.kt"); } + @Test + @TestMetadata("suspendFunInterface.kt") + public void testSuspendFunInterface() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/suspendFunInterface.kt"); + } + @Nested @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/ir/IrUtils.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/ir/IrUtils.kt index e0839712178..efacfe337ae 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/ir/IrUtils.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/ir/IrUtils.kt @@ -389,3 +389,9 @@ private fun JvmBackendContext.makeRawTypeAnnotation() = fun IrClass.rawType(context: JvmBackendContext): IrType = defaultType.addAnnotations(listOf(context.makeRawTypeAnnotation())) + +fun IrType.getSingleAbstractMethod(): IrSimpleFunction? = + getClass()?.getSingleAbstractMethod() + +fun IrClass.getSingleAbstractMethod(): IrSimpleFunction? = + functions.singleOrNull { it.modality == Modality.ABSTRACT } \ No newline at end of file diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/FunctionReferenceLowering.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/FunctionReferenceLowering.kt index afecc5eaefc..72c541077a1 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/FunctionReferenceLowering.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/FunctionReferenceLowering.kt @@ -105,14 +105,15 @@ internal class FunctionReferenceLowering(private val context: JvmBackendContext) } reference.transformChildrenVoid() - return if (shouldUseIndySamConversions && canUseIndySamConversion(reference)) { + val samSuperType = expression.typeOperand + return if (shouldUseIndySamConversions && canUseIndySamConversion(reference, samSuperType)) { wrapSamConversionArgumentWithIndySamConversion(expression) } else { - FunctionReferenceBuilder(reference, expression.typeOperand).build() + FunctionReferenceBuilder(reference, samSuperType).build() } } - private fun canUseIndySamConversion(reference: IrFunctionReference): Boolean { + private fun canUseIndySamConversion(reference: IrFunctionReference, samSuperType: IrType): Boolean { // Can't use indy for regular function references by default (because of 'equals'). // TODO special mode that would generate indy everywhere? if (reference.origin != IrStatementOrigin.LAMBDA) @@ -122,6 +123,10 @@ internal class FunctionReferenceLowering(private val context: JvmBackendContext) if (context.irIntrinsics.getIntrinsic(reference.symbol) != null) return false + // Can't use JDK LambdaMetafactory for fun interface with suspend fun + if (samSuperType.getSingleAbstractMethod()?.isSuspend == true) + return false + // Can't use JDK LambdaMetafactory if lambda signature contains an inline class mapped to a non-null reference type. val target = reference.symbol.owner if (target.extensionReceiverParameter?.run { type.isProhibitedTypeForIndySamConversion() } == true || @@ -201,10 +206,8 @@ internal class FunctionReferenceLowering(private val context: JvmBackendContext) if (irLambda.origin != IrDeclarationOrigin.LOCAL_FUNCTION_FOR_LAMBDA) throw AssertionError("Can't patch a signature of a non-lambda: ${irLambda.render()}") - val samClass = samType.classOrNull?.owner - ?: throw AssertionError("SAM type should be a class type: '${samType.render()}'") - val samMethod = samClass.functions.singleOrNull { it.modality == Modality.ABSTRACT } - ?: throw AssertionError("SAM method not found:\n${samClass.dump()}") + val samMethod = samType.getSingleAbstractMethod() + ?: throw AssertionError("SAM method not found:\n${samType.render()}") val samMethodParameters = collectValueParameters(samMethod) val irLambdaParameters = collectValueParameters(irLambda) @@ -265,7 +268,8 @@ internal class FunctionReferenceLowering(private val context: JvmBackendContext) else context.ir.symbols.getJvmFunctionClass(argumentTypes.size) private val superMethod = - functionSuperClass.functions.single { it.owner.modality == Modality.ABSTRACT } + functionSuperClass.owner.getSingleAbstractMethod() + ?: throw AssertionError("Not a SAM class: ${functionSuperClass.owner.render()}") private val useOptimizedSuperClass = context.state.generateOptimizedCallableReferenceSuperClasses @@ -546,12 +550,12 @@ internal class FunctionReferenceLowering(private val context: JvmBackendContext) // For functions with inline class return type we need to mangle the invoke method. // Otherwise, bridge lowering may fail to generate bridges for inline class types erasing to Any. val suffix = InlineClassAbi.hashReturnSuffix(callee) - Name.identifier("${superMethod.owner.name.asString()}-${suffix}") - } else superMethod.owner.name + Name.identifier("${superMethod.name.asString()}-${suffix}") + } else superMethod.name returnType = callee.returnType isSuspend = callee.isSuspend }.apply { - overriddenSymbols += superMethod + overriddenSymbols += superMethod.symbol dispatchReceiverParameter = buildReceiverParameter( this, IrDeclarationOrigin.INSTANCE_RECEIVER, diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/TypeOperatorLowering.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/TypeOperatorLowering.kt index e6eac2bdb43..44e90ea38ea 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/TypeOperatorLowering.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/TypeOperatorLowering.kt @@ -15,7 +15,7 @@ import org.jetbrains.kotlin.backend.jvm.JvmLoweredDeclarationOrigin import org.jetbrains.kotlin.backend.jvm.codegen.fileParent import org.jetbrains.kotlin.backend.jvm.ir.createJvmIrBuilder import org.jetbrains.kotlin.backend.jvm.ir.erasedUpperBound -import org.jetbrains.kotlin.descriptors.Modality +import org.jetbrains.kotlin.backend.jvm.ir.getSingleAbstractMethod import org.jetbrains.kotlin.ir.IrElement import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET import org.jetbrains.kotlin.ir.builders.* @@ -29,7 +29,6 @@ import org.jetbrains.kotlin.ir.symbols.IrSimpleFunctionSymbol import org.jetbrains.kotlin.ir.symbols.IrTypeParameterSymbol import org.jetbrains.kotlin.ir.types.* import org.jetbrains.kotlin.ir.util.dump -import org.jetbrains.kotlin.ir.util.functions import org.jetbrains.kotlin.ir.util.isInlined import org.jetbrains.kotlin.ir.util.render import org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid @@ -178,9 +177,7 @@ private class TypeOperatorLowering(private val context: JvmBackendContext) : Fil val samType = call.getTypeArgument(0) as? IrSimpleType ?: fail("'samType' is expected to be a simple type") - val samClassSymbol = samType.classOrNull - ?: fail("'samType' is expected to be a class type: '${samType.render()}'") - val samMethod = samClassSymbol.owner.functions.singleOrNull { it.modality == Modality.ABSTRACT } + val samMethod = samType.getSingleAbstractMethod() ?: fail("'${samType.render()}' is not a SAM-type") val irFunRef = call.getValueArgument(0) as? IrFunctionReference diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrFunction.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrFunction.kt index d00c6c18dc3..05e9f6a524a 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrFunction.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrFunction.kt @@ -26,7 +26,6 @@ import org.jetbrains.kotlin.ir.types.IrType import org.jetbrains.kotlin.ir.util.transformIfNeeded import org.jetbrains.kotlin.ir.visitors.IrElementTransformer import org.jetbrains.kotlin.ir.visitors.IrElementVisitor -import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedContainerSource abstract class IrFunction : IrDeclarationBase(), diff --git a/compiler/testData/codegen/box/invokedynamic/sam/suspendFunInterface.kt b/compiler/testData/codegen/box/invokedynamic/sam/suspendFunInterface.kt new file mode 100644 index 00000000000..23047631362 --- /dev/null +++ b/compiler/testData/codegen/box/invokedynamic/sam/suspendFunInterface.kt @@ -0,0 +1,42 @@ +// !LANGUAGE: +SuspendFunctionsInFunInterfaces +JvmIrEnabledByDefault +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 +// SAM_CONVERSIONS: INDY +// WITH_RUNTIME +// WITH_COROUTINES +import kotlin.coroutines.* + +var c: Continuation? = null + +suspend fun suspendMe() = suspendCoroutine { continuation -> + c = continuation +} + +fun builder(c: suspend () -> Unit) { + c.startCoroutine(object: Continuation { + override val context = EmptyCoroutineContext + override fun resumeWith(result: Result) { + result.getOrThrow() + } + }) +} + +fun interface SuspendFoo { + suspend fun foo() +} + +fun box(): String { + var test = "" + val lambda = SuspendFoo { + suspendMe() + test += "O" + suspendMe() + test += "K" + } + builder { + lambda.foo() + } + c?.resume(Unit) + c?.resume(Unit) + return test +} diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index cdce1fbec58..f34dd817d01 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -18481,6 +18481,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/invokedynamic/sam/simpleIndySam.kt"); } + @Test + @TestMetadata("suspendFunInterface.kt") + public void testSuspendFunInterface() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/suspendFunInterface.kt"); + } + @Nested @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index 43130867dd2..40c583ba90d 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -18481,6 +18481,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/invokedynamic/sam/simpleIndySam.kt"); } + @Test + @TestMetadata("suspendFunInterface.kt") + public void testSuspendFunInterface() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/suspendFunInterface.kt"); + } + @Nested @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index e747e044247..d609c82ae46 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -16203,6 +16203,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/invokedynamic/sam/simpleIndySam.kt"); } + @TestMetadata("suspendFunInterface.kt") + public void testSuspendFunInterface() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/suspendFunInterface.kt"); + } + @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) From 98b0c07b18675b27c67411dade8e5fb76fa4e02a Mon Sep 17 00:00:00 2001 From: Dmitry Petrov Date: Tue, 26 Jan 2021 15:30:41 +0300 Subject: [PATCH 167/212] JVM_IR indy-SAM conversions: inline funs and lambdas KT-44278 KT-26060 KT-42621 --- .../FirBlackBoxCodegenTestGenerated.java | 22 ++++++++++++++++ .../jvm/lower/FunctionReferenceLowering.kt | 5 ++++ .../inlineFunInDifferentPackage.kt | 20 +++++++++++++++ .../sam/inlineContext/inlineLambda1.kt | 25 +++++++++++++++++++ .../codegen/BlackBoxCodegenTestGenerated.java | 22 ++++++++++++++++ .../IrBlackBoxCodegenTestGenerated.java | 22 ++++++++++++++++ .../LightAnalysisModeTestGenerated.java | 23 +++++++++++++++++ .../IrJsCodegenBoxES6TestGenerated.java | 13 ++++++++++ .../IrJsCodegenBoxTestGenerated.java | 13 ++++++++++ .../semantics/JsCodegenBoxTestGenerated.java | 13 ++++++++++ .../IrCodegenBoxWasmTestGenerated.java | 13 ++++++++++ 11 files changed, 191 insertions(+) create mode 100644 compiler/testData/codegen/box/invokedynamic/sam/inlineContext/inlineFunInDifferentPackage.kt create mode 100644 compiler/testData/codegen/box/invokedynamic/sam/inlineContext/inlineLambda1.kt diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java index c498716f469..18a24e94a93 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java @@ -18568,6 +18568,28 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineString.kt"); } } + + @Nested + @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineContext") + @TestDataPath("$PROJECT_ROOT") + public class InlineContext extends AbstractFirBlackBoxCodegenTest { + @Test + public void testAllFilesPresentInInlineContext() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inlineContext"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("inlineFunInDifferentPackage.kt") + public void testInlineFunInDifferentPackage() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineContext/inlineFunInDifferentPackage.kt"); + } + + @Test + @TestMetadata("inlineLambda1.kt") + public void testInlineLambda1() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineContext/inlineLambda1.kt"); + } + } } } diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/FunctionReferenceLowering.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/FunctionReferenceLowering.kt index 72c541077a1..4654ddf6dc5 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/FunctionReferenceLowering.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/FunctionReferenceLowering.kt @@ -9,6 +9,7 @@ import org.jetbrains.kotlin.backend.common.FileLoweringPass import org.jetbrains.kotlin.backend.common.IrElementTransformerVoidWithContext import org.jetbrains.kotlin.backend.common.ir.* import org.jetbrains.kotlin.backend.common.lower.SamEqualsHashCodeMethodsGenerator +import org.jetbrains.kotlin.backend.common.lower.parents import org.jetbrains.kotlin.backend.common.phaser.makeIrFilePhase import org.jetbrains.kotlin.backend.jvm.JvmBackendContext import org.jetbrains.kotlin.backend.jvm.JvmLoweredDeclarationOrigin @@ -135,6 +136,10 @@ internal class FunctionReferenceLowering(private val context: JvmBackendContext) ) return false + // Can't use indy-based SAM conversion inside inline fun (Ok in inline lambda). + if (target.parents.any { it is IrSimpleFunction && it.isInline && it.origin != IrDeclarationOrigin.LOCAL_FUNCTION_FOR_LAMBDA }) + return false + return true } diff --git a/compiler/testData/codegen/box/invokedynamic/sam/inlineContext/inlineFunInDifferentPackage.kt b/compiler/testData/codegen/box/invokedynamic/sam/inlineContext/inlineFunInDifferentPackage.kt new file mode 100644 index 00000000000..df4a44b7b64 --- /dev/null +++ b/compiler/testData/codegen/box/invokedynamic/sam/inlineContext/inlineFunInDifferentPackage.kt @@ -0,0 +1,20 @@ +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 +// SAM_CONVERSIONS: INDY +// WITH_RUNTIME +// FILE: inlineFunInDifferentPackage.kt +import a.* + +fun box() = test { k -> "O" + k } + +// FILE: a.kt +package a + +fun interface IFoo { + fun foo(k: String): String +} + +fun fooK(iFoo: IFoo) = iFoo.foo("K") + +inline fun test(crossinline lambda: (String) -> String) = + fooK { k -> lambda(k) } \ No newline at end of file diff --git a/compiler/testData/codegen/box/invokedynamic/sam/inlineContext/inlineLambda1.kt b/compiler/testData/codegen/box/invokedynamic/sam/inlineContext/inlineLambda1.kt new file mode 100644 index 00000000000..47d7f8411ea --- /dev/null +++ b/compiler/testData/codegen/box/invokedynamic/sam/inlineContext/inlineLambda1.kt @@ -0,0 +1,25 @@ +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 +// SAM_CONVERSIONS: INDY +// WITH_RUNTIME +fun interface IFoo { + fun foo() +} + +fun foo(iFoo: IFoo) = iFoo.foo() + +inline fun twice(fn: () -> Unit) { + fn() + fn() +} + +fun box(): String { + var test = 0 + twice { + foo { test += 1 } + } + if (test != 2) + return "Failed: test=$test" + + return "OK" +} \ No newline at end of file diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index f34dd817d01..a1281d8134a 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -18568,6 +18568,28 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineString.kt"); } } + + @Nested + @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineContext") + @TestDataPath("$PROJECT_ROOT") + public class InlineContext extends AbstractBlackBoxCodegenTest { + @Test + public void testAllFilesPresentInInlineContext() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inlineContext"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); + } + + @Test + @TestMetadata("inlineFunInDifferentPackage.kt") + public void testInlineFunInDifferentPackage() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineContext/inlineFunInDifferentPackage.kt"); + } + + @Test + @TestMetadata("inlineLambda1.kt") + public void testInlineLambda1() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineContext/inlineLambda1.kt"); + } + } } } diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index 40c583ba90d..2c8fb657361 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -18568,6 +18568,28 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineString.kt"); } } + + @Nested + @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineContext") + @TestDataPath("$PROJECT_ROOT") + public class InlineContext extends AbstractIrBlackBoxCodegenTest { + @Test + public void testAllFilesPresentInInlineContext() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inlineContext"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("inlineFunInDifferentPackage.kt") + public void testInlineFunInDifferentPackage() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineContext/inlineFunInDifferentPackage.kt"); + } + + @Test + @TestMetadata("inlineLambda1.kt") + public void testInlineLambda1() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineContext/inlineLambda1.kt"); + } + } } } diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index d609c82ae46..9354811bff6 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -16280,6 +16280,29 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineString.kt"); } } + + @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineContext") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class InlineContext extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInInlineContext() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inlineContext"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); + } + + @TestMetadata("inlineFunInDifferentPackage.kt") + public void testInlineFunInDifferentPackage() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineContext/inlineFunInDifferentPackage.kt"); + } + + @TestMetadata("inlineLambda1.kt") + public void testInlineLambda1() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineContext/inlineLambda1.kt"); + } + } } } diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java index b20b0f768a4..81156d68bfe 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java @@ -13915,6 +13915,19 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); } } + + @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineContext") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class InlineContext extends AbstractIrJsCodegenBoxES6Test { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR_ES6, testDataFilePath); + } + + public void testAllFilesPresentInInlineContext() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inlineContext"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + } } } diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java index cdcef275234..949f18a22be 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java @@ -13915,6 +13915,19 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); } } + + @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineContext") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class InlineContext extends AbstractIrJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); + } + + public void testAllFilesPresentInInlineContext() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inlineContext"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); + } + } } } diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index 486ca13b279..af9a372d26b 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -13980,6 +13980,19 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true); } } + + @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineContext") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class InlineContext extends AbstractJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInInlineContext() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inlineContext"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true); + } + } } } diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java index a978a8889d1..d464975739d 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java @@ -8076,6 +8076,19 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true); } } + + @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineContext") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class InlineContext extends AbstractIrCodegenBoxWasmTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.WASM, testDataFilePath); + } + + public void testAllFilesPresentInInlineContext() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inlineContext"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true); + } + } } } From ad1d80d70082b0a5be6e1c615d461db81568bacc Mon Sep 17 00:00:00 2001 From: Dmitry Petrov Date: Tue, 26 Jan 2021 17:28:40 +0300 Subject: [PATCH 168/212] JVM_IR indy-SAM conversions: add more tests KT-44278 KT-26060 KT-42621 --- .../FirBlackBoxCodegenTestGenerated.java | 12 ++++++++++ .../codegen/FirBytecodeTextTestGenerated.java | 16 +++++++++++++ .../box/invokedynamic/sam/streamApi1.kt | 13 +++++++++++ .../box/invokedynamic/sam/streamApi2.kt | 21 +++++++++++++++++ .../bytecodeText/invokedynamic/streamApi.kt | 23 +++++++++++++++++++ .../codegen/BlackBoxCodegenTestGenerated.java | 12 ++++++++++ .../codegen/BytecodeTextTestGenerated.java | 16 +++++++++++++ .../IrBlackBoxCodegenTestGenerated.java | 12 ++++++++++ .../codegen/IrBytecodeTextTestGenerated.java | 16 +++++++++++++ .../LightAnalysisModeTestGenerated.java | 10 ++++++++ 10 files changed, 151 insertions(+) create mode 100644 compiler/testData/codegen/box/invokedynamic/sam/streamApi1.kt create mode 100644 compiler/testData/codegen/box/invokedynamic/sam/streamApi2.kt create mode 100644 compiler/testData/codegen/bytecodeText/invokedynamic/streamApi.kt diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java index 18a24e94a93..018b0c8519b 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java @@ -18481,6 +18481,18 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/invokedynamic/sam/simpleIndySam.kt"); } + @Test + @TestMetadata("streamApi1.kt") + public void testStreamApi1() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/streamApi1.kt"); + } + + @Test + @TestMetadata("streamApi2.kt") + public void testStreamApi2() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/streamApi2.kt"); + } + @Test @TestMetadata("suspendFunInterface.kt") public void testSuspendFunInterface() throws Exception { diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBytecodeTextTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBytecodeTextTestGenerated.java index 164c8ac8a44..115fc4cd7da 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBytecodeTextTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBytecodeTextTestGenerated.java @@ -3923,6 +3923,22 @@ public class FirBytecodeTextTestGenerated extends AbstractFirBytecodeTextTest { } } + @Nested + @TestMetadata("compiler/testData/codegen/bytecodeText/invokedynamic") + @TestDataPath("$PROJECT_ROOT") + public class Invokedynamic extends AbstractFirBytecodeTextTest { + @Test + public void testAllFilesPresentInInvokedynamic() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/invokedynamic"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("streamApi.kt") + public void testStreamApi() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/invokedynamic/streamApi.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/jvm8") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/testData/codegen/box/invokedynamic/sam/streamApi1.kt b/compiler/testData/codegen/box/invokedynamic/sam/streamApi1.kt new file mode 100644 index 00000000000..ecda6899ee7 --- /dev/null +++ b/compiler/testData/codegen/box/invokedynamic/sam/streamApi1.kt @@ -0,0 +1,13 @@ +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 +// SAM_CONVERSIONS: INDY +// WITH_RUNTIME +// FULL_JDK +import java.util.stream.Collectors + +fun box(): String { + return listOf("o", "k") + .stream() + .map { it.toUpperCase() } + .collect(Collectors.joining()) +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/invokedynamic/sam/streamApi2.kt b/compiler/testData/codegen/box/invokedynamic/sam/streamApi2.kt new file mode 100644 index 00000000000..0f0683fe00a --- /dev/null +++ b/compiler/testData/codegen/box/invokedynamic/sam/streamApi2.kt @@ -0,0 +1,21 @@ +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 +// SAM_CONVERSIONS: INDY +// WITH_RUNTIME +// FULL_JDK +import java.util.stream.* + +fun box(): String { + val xs = IntStream.of(1, 1, 4, 5, 1, 4) + .map { a: Int -> a + 1 } + .map { a: Int -> a - 1 } + .filter { a: Int -> a > 3 } + .flatMap { a: Int -> IntStream.of(a, a, a) } + .boxed() + .collect(Collectors.toList()) + + if (xs != listOf(4, 4, 4, 5, 5, 5, 4, 4, 4)) + return "Failed: xs=$xs" + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeText/invokedynamic/streamApi.kt b/compiler/testData/codegen/bytecodeText/invokedynamic/streamApi.kt new file mode 100644 index 00000000000..99dad35114a --- /dev/null +++ b/compiler/testData/codegen/bytecodeText/invokedynamic/streamApi.kt @@ -0,0 +1,23 @@ +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 +// SAM_CONVERSIONS: INDY +// WITH_RUNTIME +// FULL_JDK +import java.util.stream.* + +fun test() = + IntStream.of(1, 1, 4, 5, 1, 4) + .map { a: Int -> a + 1 } + .map { a: Int -> a - 1 } + .filter { a: Int -> a > 3 } + .flatMap { a: Int -> IntStream.of(a, a, a) } + .boxed() + .collect(Collectors.toList()) + +// JVM_IR_TEMPLATES +// 4 INVOKEDYNAMIC +// 0 class StreamApiKt\$test\$ + +// JVM_TEMPLATES +// 0 INVOKEDYNAMIC +// 4 class StreamApiKt\$test\$ diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index a1281d8134a..fab16cfd3bb 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -18481,6 +18481,18 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/invokedynamic/sam/simpleIndySam.kt"); } + @Test + @TestMetadata("streamApi1.kt") + public void testStreamApi1() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/streamApi1.kt"); + } + + @Test + @TestMetadata("streamApi2.kt") + public void testStreamApi2() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/streamApi2.kt"); + } + @Test @TestMetadata("suspendFunInterface.kt") public void testSuspendFunInterface() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BytecodeTextTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BytecodeTextTestGenerated.java index ee7b88542b0..bd3bd77533e 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BytecodeTextTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BytecodeTextTestGenerated.java @@ -3791,6 +3791,22 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest { } } + @Nested + @TestMetadata("compiler/testData/codegen/bytecodeText/invokedynamic") + @TestDataPath("$PROJECT_ROOT") + public class Invokedynamic extends AbstractBytecodeTextTest { + @Test + public void testAllFilesPresentInInvokedynamic() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/invokedynamic"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); + } + + @Test + @TestMetadata("streamApi.kt") + public void testStreamApi() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/invokedynamic/streamApi.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/jvm8") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index 2c8fb657361..f9254bc5b6d 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -18481,6 +18481,18 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/invokedynamic/sam/simpleIndySam.kt"); } + @Test + @TestMetadata("streamApi1.kt") + public void testStreamApi1() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/streamApi1.kt"); + } + + @Test + @TestMetadata("streamApi2.kt") + public void testStreamApi2() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/streamApi2.kt"); + } + @Test @TestMetadata("suspendFunInterface.kt") public void testSuspendFunInterface() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBytecodeTextTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBytecodeTextTestGenerated.java index fcd726e793a..697ca637506 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBytecodeTextTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBytecodeTextTestGenerated.java @@ -3923,6 +3923,22 @@ public class IrBytecodeTextTestGenerated extends AbstractIrBytecodeTextTest { } } + @Nested + @TestMetadata("compiler/testData/codegen/bytecodeText/invokedynamic") + @TestDataPath("$PROJECT_ROOT") + public class Invokedynamic extends AbstractIrBytecodeTextTest { + @Test + public void testAllFilesPresentInInvokedynamic() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/invokedynamic"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("streamApi.kt") + public void testStreamApi() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/invokedynamic/streamApi.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/bytecodeText/jvm8") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 9354811bff6..02a38cf4c29 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -16203,6 +16203,16 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/invokedynamic/sam/simpleIndySam.kt"); } + @TestMetadata("streamApi1.kt") + public void testStreamApi1() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/streamApi1.kt"); + } + + @TestMetadata("streamApi2.kt") + public void testStreamApi2() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/streamApi2.kt"); + } + @TestMetadata("suspendFunInterface.kt") public void testSuspendFunInterface() throws Exception { runTest("compiler/testData/codegen/box/invokedynamic/sam/suspendFunInterface.kt"); From f0abd8bc68c1af175fae19a998ed2b1c0797b4c2 Mon Sep 17 00:00:00 2001 From: Dmitry Petrov Date: Wed, 27 Jan 2021 15:39:48 +0300 Subject: [PATCH 169/212] JVM_IR indy-SAM conversions: prohibit in crossinline lambdas KT-44278 KT-26060 KT-42621 --- .../FirBlackBoxCodegenTestGenerated.java | 62 ++++++++++++------- .../FakeInliningLocalVariablesLowering.kt | 15 +++-- .../jvm/lower/FunctionReferenceLowering.kt | 28 ++++++++- .../jvm/lower/GenerateMultifileFacades.kt | 1 + .../sam/inline/crossinlineLambda1.kt | 20 ++++++ .../sam/inline/crossinlineLambda2.kt | 26 ++++++++ .../inlineFunInDifferentPackage.kt | 4 +- .../inlineLambda1.kt | 2 + .../sam/possibleOverrideClash.kt | 19 ++++++ .../codegen/BlackBoxCodegenTestGenerated.java | 62 ++++++++++++------- .../IrBlackBoxCodegenTestGenerated.java | 62 ++++++++++++------- .../LightAnalysisModeTestGenerated.java | 61 +++++++++++------- .../IrJsCodegenBoxES6TestGenerated.java | 26 ++++---- .../IrJsCodegenBoxTestGenerated.java | 26 ++++---- .../semantics/JsCodegenBoxTestGenerated.java | 26 ++++---- .../IrCodegenBoxWasmTestGenerated.java | 26 ++++---- 16 files changed, 317 insertions(+), 149 deletions(-) create mode 100644 compiler/testData/codegen/box/invokedynamic/sam/inline/crossinlineLambda1.kt create mode 100644 compiler/testData/codegen/box/invokedynamic/sam/inline/crossinlineLambda2.kt rename compiler/testData/codegen/box/invokedynamic/sam/{inlineContext => inline}/inlineFunInDifferentPackage.kt (85%) rename compiler/testData/codegen/box/invokedynamic/sam/{inlineContext => inline}/inlineLambda1.kt (92%) create mode 100644 compiler/testData/codegen/box/invokedynamic/sam/possibleOverrideClash.kt diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java index 018b0c8519b..713269121e5 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java @@ -18457,6 +18457,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/invokedynamic/sam/genericFunInterfaceWithPrimitive.kt"); } + @Test + @TestMetadata("possibleOverrideClash.kt") + public void testPossibleOverrideClash() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/possibleOverrideClash.kt"); + } + @Test @TestMetadata("primitiveVsWrapperInSam.kt") public void testPrimitiveVsWrapperInSam() throws Exception { @@ -18499,6 +18505,40 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/invokedynamic/sam/suspendFunInterface.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inline") + @TestDataPath("$PROJECT_ROOT") + public class Inline extends AbstractFirBlackBoxCodegenTest { + @Test + public void testAllFilesPresentInInline() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inline"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("crossinlineLambda1.kt") + public void testCrossinlineLambda1() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/crossinlineLambda1.kt"); + } + + @Test + @TestMetadata("crossinlineLambda2.kt") + public void testCrossinlineLambda2() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/crossinlineLambda2.kt"); + } + + @Test + @TestMetadata("inlineFunInDifferentPackage.kt") + public void testInlineFunInDifferentPackage() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/inlineFunInDifferentPackage.kt"); + } + + @Test + @TestMetadata("inlineLambda1.kt") + public void testInlineLambda1() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/inlineLambda1.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature") @TestDataPath("$PROJECT_ROOT") @@ -18580,28 +18620,6 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineString.kt"); } } - - @Nested - @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineContext") - @TestDataPath("$PROJECT_ROOT") - public class InlineContext extends AbstractFirBlackBoxCodegenTest { - @Test - public void testAllFilesPresentInInlineContext() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inlineContext"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); - } - - @Test - @TestMetadata("inlineFunInDifferentPackage.kt") - public void testInlineFunInDifferentPackage() throws Exception { - runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineContext/inlineFunInDifferentPackage.kt"); - } - - @Test - @TestMetadata("inlineLambda1.kt") - public void testInlineLambda1() throws Exception { - runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineContext/inlineLambda1.kt"); - } - } } } diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/FakeInliningLocalVariablesLowering.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/FakeInliningLocalVariablesLowering.kt index 1393c400322..95a60e2d392 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/FakeInliningLocalVariablesLowering.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/FakeInliningLocalVariablesLowering.kt @@ -19,6 +19,7 @@ import org.jetbrains.kotlin.ir.declarations.* import org.jetbrains.kotlin.ir.expressions.IrBlockBody import org.jetbrains.kotlin.ir.expressions.IrExpressionBody import org.jetbrains.kotlin.ir.expressions.IrFunctionReference +import org.jetbrains.kotlin.ir.util.dump import org.jetbrains.kotlin.load.java.JvmAbi internal val fakeInliningLocalVariablesLowering = makeIrFilePhase( @@ -56,16 +57,22 @@ internal class FakeInliningLocalVariablesLowering(val context: JvmBackendContext } private fun IrFunction.addFakeLocalVariable(name: String) { + val oldBody = body context.createIrBuilder(symbol).run { body = irBlockBody { // Create temporary variable, but make sure it's origin is `DEFINED` so that // it will materialize in the code. // Also, do not forget to remove $$forInline suffix, otherwise, IDE will not be able to navigate to inline function. createTmpVariable(irInt(0), name.removeSuffix(FOR_INLINE_SUFFIX), origin = IrDeclarationOrigin.DEFINED) - if (body is IrExpressionBody) { - +irReturn((body as IrExpressionBody).expression) - } else { - (body as IrBlockBody).statements.forEach { +it } + when (oldBody) { + is IrExpressionBody -> { + +irReturn(oldBody.expression) + } + is IrBlockBody -> + oldBody.statements.forEach { +it } + else -> { + throw AssertionError("Unexpected body:\n${this@addFakeLocalVariable.dump()}") + } } } } diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/FunctionReferenceLowering.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/FunctionReferenceLowering.kt index 4654ddf6dc5..84c43490af6 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/FunctionReferenceLowering.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/FunctionReferenceLowering.kt @@ -45,6 +45,8 @@ internal class FunctionReferenceLowering(private val context: JvmBackendContext) // function reference classes needed. private val ignoredFunctionReferences = mutableSetOf>() + private val inlineLambdaToValueParameter = HashMap() + private val IrFunctionReference.isIgnored: Boolean get() = (!type.isFunctionOrKFunction() && !isSuspendFunctionReference()) || ignoredFunctionReferences.contains(this) @@ -56,7 +58,20 @@ internal class FunctionReferenceLowering(private val context: JvmBackendContext) (origin == null || origin == IrStatementOrigin.ADAPTED_FUNCTION_REFERENCE || origin == IrStatementOrigin.SUSPEND_CONVERSION) override fun lower(irFile: IrFile) { - ignoredFunctionReferences.addAll(IrInlineReferenceLocator.scan(context, irFile)) + irFile.accept( + object : IrInlineReferenceLocator(context) { + override fun visitInlineLambda( + argument: IrFunctionReference, + callee: IrFunction, + parameter: IrValueParameter, + scope: IrDeclaration + ) { + ignoredFunctionReferences.add(argument) + inlineLambdaToValueParameter[argument.symbol.owner] = parameter + } + }, + null + ) irFile.transformChildrenVoid(this) } @@ -137,12 +152,21 @@ internal class FunctionReferenceLowering(private val context: JvmBackendContext) return false // Can't use indy-based SAM conversion inside inline fun (Ok in inline lambda). - if (target.parents.any { it is IrSimpleFunction && it.isInline && it.origin != IrDeclarationOrigin.LOCAL_FUNCTION_FOR_LAMBDA }) + if (target.parents.any { it.isInlineFunction() || it.isCrossinlineLambda() }) return false return true } + private fun IrDeclarationParent.isInlineFunction() = + this is IrSimpleFunction && isInline && origin != IrDeclarationOrigin.LOCAL_FUNCTION_FOR_LAMBDA + + private fun IrDeclarationParent.isCrossinlineLambda(): Boolean { + val irFun = this as? IrSimpleFunction ?: return false + return origin == IrDeclarationOrigin.LOCAL_FUNCTION_FOR_LAMBDA && + inlineLambdaToValueParameter[irFun]?.isCrossinline == true + } + private fun IrType.isProhibitedTypeForIndySamConversion(): Boolean { if (this !is IrSimpleType) return false diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/GenerateMultifileFacades.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/GenerateMultifileFacades.kt index b2f51286227..c20f7f72cfd 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/GenerateMultifileFacades.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/GenerateMultifileFacades.kt @@ -221,6 +221,7 @@ private fun IrSimpleFunction.createMultifileDelegateIfNeeded( if (DescriptorVisibilities.isPrivate(originalVisibility) || name == StaticInitializersLowering.clinitName || origin == JvmLoweredDeclarationOrigin.SYNTHETIC_ACCESSOR || + origin == IrDeclarationOrigin.LOCAL_FUNCTION_FOR_LAMBDA || // $annotations methods in the facade are only needed for const properties. (origin == JvmLoweredDeclarationOrigin.SYNTHETIC_METHOD_FOR_PROPERTY_OR_TYPEALIAS_ANNOTATIONS && (metadata as? MetadataSource.Property)?.isConst != true) diff --git a/compiler/testData/codegen/box/invokedynamic/sam/inline/crossinlineLambda1.kt b/compiler/testData/codegen/box/invokedynamic/sam/inline/crossinlineLambda1.kt new file mode 100644 index 00000000000..21e8936805c --- /dev/null +++ b/compiler/testData/codegen/box/invokedynamic/sam/inline/crossinlineLambda1.kt @@ -0,0 +1,20 @@ +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 +// SAM_CONVERSIONS: INDY +// FILE: 1.kt +inline fun cross(crossinline fn: () -> String) : Any = + object { + override fun toString(): String = fn() + } + +fun interface IFoo { + fun foo(): String +} + +fun foo(iFoo: IFoo) = iFoo.foo() + +// FILE: 2.kt +fun box() = + cross { + foo { "OK" } + }.toString() \ No newline at end of file diff --git a/compiler/testData/codegen/box/invokedynamic/sam/inline/crossinlineLambda2.kt b/compiler/testData/codegen/box/invokedynamic/sam/inline/crossinlineLambda2.kt new file mode 100644 index 00000000000..fa184cf4d9a --- /dev/null +++ b/compiler/testData/codegen/box/invokedynamic/sam/inline/crossinlineLambda2.kt @@ -0,0 +1,26 @@ +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 +// SAM_CONVERSIONS: INDY +// FILE: 1.kt +class C { + fun test() = + cross { + foo { "OK" } + }.toString() +} + +inline fun cross(crossinline fn: () -> String) : Any = + object { + override fun toString(): String = fn() + } + +fun interface IFoo { + fun foo(): String +} + +fun foo(iFoo: IFoo) = iFoo.foo() + +// FILE: 2.kt +fun box() = + C().test() + diff --git a/compiler/testData/codegen/box/invokedynamic/sam/inlineContext/inlineFunInDifferentPackage.kt b/compiler/testData/codegen/box/invokedynamic/sam/inline/inlineFunInDifferentPackage.kt similarity index 85% rename from compiler/testData/codegen/box/invokedynamic/sam/inlineContext/inlineFunInDifferentPackage.kt rename to compiler/testData/codegen/box/invokedynamic/sam/inline/inlineFunInDifferentPackage.kt index df4a44b7b64..29b1ef040c9 100644 --- a/compiler/testData/codegen/box/invokedynamic/sam/inlineContext/inlineFunInDifferentPackage.kt +++ b/compiler/testData/codegen/box/invokedynamic/sam/inline/inlineFunInDifferentPackage.kt @@ -2,12 +2,12 @@ // JVM_TARGET: 1.8 // SAM_CONVERSIONS: INDY // WITH_RUNTIME -// FILE: inlineFunInDifferentPackage.kt +// FILE: 2.kt import a.* fun box() = test { k -> "O" + k } -// FILE: a.kt +// FILE: 1.kt package a fun interface IFoo { diff --git a/compiler/testData/codegen/box/invokedynamic/sam/inlineContext/inlineLambda1.kt b/compiler/testData/codegen/box/invokedynamic/sam/inline/inlineLambda1.kt similarity index 92% rename from compiler/testData/codegen/box/invokedynamic/sam/inlineContext/inlineLambda1.kt rename to compiler/testData/codegen/box/invokedynamic/sam/inline/inlineLambda1.kt index 47d7f8411ea..d025660c159 100644 --- a/compiler/testData/codegen/box/invokedynamic/sam/inlineContext/inlineLambda1.kt +++ b/compiler/testData/codegen/box/invokedynamic/sam/inline/inlineLambda1.kt @@ -2,6 +2,7 @@ // JVM_TARGET: 1.8 // SAM_CONVERSIONS: INDY // WITH_RUNTIME +// FILE: 1.kt fun interface IFoo { fun foo() } @@ -13,6 +14,7 @@ inline fun twice(fn: () -> Unit) { fn() } +// FILE: 2.kt fun box(): String { var test = 0 twice { diff --git a/compiler/testData/codegen/box/invokedynamic/sam/possibleOverrideClash.kt b/compiler/testData/codegen/box/invokedynamic/sam/possibleOverrideClash.kt new file mode 100644 index 00000000000..4220b4aa931 --- /dev/null +++ b/compiler/testData/codegen/box/invokedynamic/sam/possibleOverrideClash.kt @@ -0,0 +1,19 @@ +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 +// SAM_CONVERSIONS: INDY +fun interface IFoo { + fun foo(): String +} + +fun foo(iFoo: IFoo) = iFoo.foo() + +open class C1 { + open fun test() = foo { "O" } +} + +class C2 : C1() { + override fun test() = foo { "K" } +} + +fun box() = + C1().test() + C2().test() diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index fab16cfd3bb..2bd48b10080 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -18457,6 +18457,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/invokedynamic/sam/genericFunInterfaceWithPrimitive.kt"); } + @Test + @TestMetadata("possibleOverrideClash.kt") + public void testPossibleOverrideClash() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/possibleOverrideClash.kt"); + } + @Test @TestMetadata("primitiveVsWrapperInSam.kt") public void testPrimitiveVsWrapperInSam() throws Exception { @@ -18499,6 +18505,40 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/invokedynamic/sam/suspendFunInterface.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inline") + @TestDataPath("$PROJECT_ROOT") + public class Inline extends AbstractBlackBoxCodegenTest { + @Test + public void testAllFilesPresentInInline() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inline"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); + } + + @Test + @TestMetadata("crossinlineLambda1.kt") + public void testCrossinlineLambda1() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/crossinlineLambda1.kt"); + } + + @Test + @TestMetadata("crossinlineLambda2.kt") + public void testCrossinlineLambda2() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/crossinlineLambda2.kt"); + } + + @Test + @TestMetadata("inlineFunInDifferentPackage.kt") + public void testInlineFunInDifferentPackage() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/inlineFunInDifferentPackage.kt"); + } + + @Test + @TestMetadata("inlineLambda1.kt") + public void testInlineLambda1() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/inlineLambda1.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature") @TestDataPath("$PROJECT_ROOT") @@ -18580,28 +18620,6 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineString.kt"); } } - - @Nested - @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineContext") - @TestDataPath("$PROJECT_ROOT") - public class InlineContext extends AbstractBlackBoxCodegenTest { - @Test - public void testAllFilesPresentInInlineContext() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inlineContext"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); - } - - @Test - @TestMetadata("inlineFunInDifferentPackage.kt") - public void testInlineFunInDifferentPackage() throws Exception { - runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineContext/inlineFunInDifferentPackage.kt"); - } - - @Test - @TestMetadata("inlineLambda1.kt") - public void testInlineLambda1() throws Exception { - runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineContext/inlineLambda1.kt"); - } - } } } diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index f9254bc5b6d..a31d49d27ae 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -18457,6 +18457,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/invokedynamic/sam/genericFunInterfaceWithPrimitive.kt"); } + @Test + @TestMetadata("possibleOverrideClash.kt") + public void testPossibleOverrideClash() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/possibleOverrideClash.kt"); + } + @Test @TestMetadata("primitiveVsWrapperInSam.kt") public void testPrimitiveVsWrapperInSam() throws Exception { @@ -18499,6 +18505,40 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/invokedynamic/sam/suspendFunInterface.kt"); } + @Nested + @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inline") + @TestDataPath("$PROJECT_ROOT") + public class Inline extends AbstractIrBlackBoxCodegenTest { + @Test + public void testAllFilesPresentInInline() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inline"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("crossinlineLambda1.kt") + public void testCrossinlineLambda1() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/crossinlineLambda1.kt"); + } + + @Test + @TestMetadata("crossinlineLambda2.kt") + public void testCrossinlineLambda2() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/crossinlineLambda2.kt"); + } + + @Test + @TestMetadata("inlineFunInDifferentPackage.kt") + public void testInlineFunInDifferentPackage() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/inlineFunInDifferentPackage.kt"); + } + + @Test + @TestMetadata("inlineLambda1.kt") + public void testInlineLambda1() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/inlineLambda1.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature") @TestDataPath("$PROJECT_ROOT") @@ -18580,28 +18620,6 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineString.kt"); } } - - @Nested - @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineContext") - @TestDataPath("$PROJECT_ROOT") - public class InlineContext extends AbstractIrBlackBoxCodegenTest { - @Test - public void testAllFilesPresentInInlineContext() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inlineContext"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); - } - - @Test - @TestMetadata("inlineFunInDifferentPackage.kt") - public void testInlineFunInDifferentPackage() throws Exception { - runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineContext/inlineFunInDifferentPackage.kt"); - } - - @Test - @TestMetadata("inlineLambda1.kt") - public void testInlineLambda1() throws Exception { - runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineContext/inlineLambda1.kt"); - } - } } } diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 02a38cf4c29..1253e91d528 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -16183,6 +16183,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/invokedynamic/sam/genericFunInterfaceWithPrimitive.kt"); } + @TestMetadata("possibleOverrideClash.kt") + public void testPossibleOverrideClash() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/possibleOverrideClash.kt"); + } + @TestMetadata("primitiveVsWrapperInSam.kt") public void testPrimitiveVsWrapperInSam() throws Exception { runTest("compiler/testData/codegen/box/invokedynamic/sam/primitiveVsWrapperInSam.kt"); @@ -16218,6 +16223,39 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/invokedynamic/sam/suspendFunInterface.kt"); } + @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inline") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Inline extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInInline() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inline"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); + } + + @TestMetadata("crossinlineLambda1.kt") + public void testCrossinlineLambda1() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/crossinlineLambda1.kt"); + } + + @TestMetadata("crossinlineLambda2.kt") + public void testCrossinlineLambda2() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/crossinlineLambda2.kt"); + } + + @TestMetadata("inlineFunInDifferentPackage.kt") + public void testInlineFunInDifferentPackage() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/inlineFunInDifferentPackage.kt"); + } + + @TestMetadata("inlineLambda1.kt") + public void testInlineLambda1() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/inlineLambda1.kt"); + } + } + @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) @@ -16290,29 +16328,6 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineString.kt"); } } - - @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineContext") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class InlineContext extends AbstractLightAnalysisModeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - - public void testAllFilesPresentInInlineContext() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inlineContext"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); - } - - @TestMetadata("inlineFunInDifferentPackage.kt") - public void testInlineFunInDifferentPackage() throws Exception { - runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineContext/inlineFunInDifferentPackage.kt"); - } - - @TestMetadata("inlineLambda1.kt") - public void testInlineLambda1() throws Exception { - runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineContext/inlineLambda1.kt"); - } - } } } diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java index 81156d68bfe..21993b93b26 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java @@ -13903,6 +13903,19 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); } + @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inline") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Inline extends AbstractIrJsCodegenBoxES6Test { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR_ES6, testDataFilePath); + } + + public void testAllFilesPresentInInline() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inline"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + } + @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) @@ -13915,19 +13928,6 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); } } - - @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineContext") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class InlineContext extends AbstractIrJsCodegenBoxES6Test { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR_ES6, testDataFilePath); - } - - public void testAllFilesPresentInInlineContext() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inlineContext"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); - } - } } } diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java index 949f18a22be..b947ffc7c3d 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java @@ -13903,6 +13903,19 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); } + @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inline") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Inline extends AbstractIrJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); + } + + public void testAllFilesPresentInInline() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inline"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); + } + } + @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) @@ -13915,19 +13928,6 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); } } - - @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineContext") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class InlineContext extends AbstractIrJsCodegenBoxTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); - } - - public void testAllFilesPresentInInlineContext() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inlineContext"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); - } - } } } diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index af9a372d26b..85bb3588fd6 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -13968,6 +13968,19 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true); } + @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inline") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Inline extends AbstractJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInInline() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inline"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true); + } + } + @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) @@ -13980,19 +13993,6 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true); } } - - @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineContext") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class InlineContext extends AbstractJsCodegenBoxTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); - } - - public void testAllFilesPresentInInlineContext() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inlineContext"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true); - } - } } } diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java index d464975739d..94605af3d16 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java @@ -8064,6 +8064,19 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true); } + @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inline") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Inline extends AbstractIrCodegenBoxWasmTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.WASM, testDataFilePath); + } + + public void testAllFilesPresentInInline() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inline"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true); + } + } + @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) @@ -8076,19 +8089,6 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true); } } - - @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineContext") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class InlineContext extends AbstractIrCodegenBoxWasmTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest0(this::doTest, TargetBackend.WASM, testDataFilePath); - } - - public void testAllFilesPresentInInlineContext() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inlineContext"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true); - } - } } } From f34224eceec036c580a74b868286a43a74781afb Mon Sep 17 00:00:00 2001 From: Dmitry Petrov Date: Wed, 27 Jan 2021 16:33:16 +0300 Subject: [PATCH 170/212] JVM_IR indy-SAM conversions: tests for function references equality (SAM conversion using LambdaMetafactory is not used for function refs). KT-44278 KT-26060 KT-42621 --- .../FirBlackBoxCodegenTestGenerated.java | 12 ++++ .../sam/boundFunctionReferenceEquality.kt | 57 +++++++++++++++++++ .../sam/unboundFunctionReferenceEquality.kt | 48 ++++++++++++++++ .../codegen/BlackBoxCodegenTestGenerated.java | 12 ++++ .../IrBlackBoxCodegenTestGenerated.java | 12 ++++ .../LightAnalysisModeTestGenerated.java | 10 ++++ 6 files changed, 151 insertions(+) create mode 100644 compiler/testData/codegen/box/invokedynamic/sam/boundFunctionReferenceEquality.kt create mode 100644 compiler/testData/codegen/box/invokedynamic/sam/unboundFunctionReferenceEquality.kt diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java index 713269121e5..2a336c39aa8 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java @@ -18397,6 +18397,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test + @TestMetadata("boundFunctionReferenceEquality.kt") + public void testBoundFunctionReferenceEquality() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/boundFunctionReferenceEquality.kt"); + } + @Test @TestMetadata("boundReference.kt") public void testBoundReference() throws Exception { @@ -18505,6 +18511,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/invokedynamic/sam/suspendFunInterface.kt"); } + @Test + @TestMetadata("unboundFunctionReferenceEquality.kt") + public void testUnboundFunctionReferenceEquality() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/unboundFunctionReferenceEquality.kt"); + } + @Nested @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inline") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/testData/codegen/box/invokedynamic/sam/boundFunctionReferenceEquality.kt b/compiler/testData/codegen/box/invokedynamic/sam/boundFunctionReferenceEquality.kt new file mode 100644 index 00000000000..6cec5948027 --- /dev/null +++ b/compiler/testData/codegen/box/invokedynamic/sam/boundFunctionReferenceEquality.kt @@ -0,0 +1,57 @@ +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 +// SAM_CONVERSIONS: INDY +// WITH_RUNTIME +// FILE: boundAdaptedFunctionReference.kt +fun checkEqual(x: Any, y: Any) { + if (x != y || y != x) throw AssertionError("$x and $y should be equal") + if (x.hashCode() != y.hashCode()) throw AssertionError("$x and $y should have the same hash code") +} + +fun checkNotEqual(x: Any, y: Any) { + if (x == y || y == x) throw AssertionError("$x and $y should NOT be equal") +} + +fun interface FunInterface { + fun invoke() +} + +private fun id(f: FunInterface): Any = f + +class C { + fun target1() {} + fun target2() {} + + fun adapted1(s: String? = null): String = s!! + fun adapted2(vararg s: String): String = s[0] +} + +fun box(): String { + val c0 = C() + + checkEqual(id(c0::target1), id(c0::target1)) + checkEqual(id(c0::target1), target1FromOtherFile(c0)) + + checkNotEqual(id(c0::target1), id(c0::target2)) + + checkEqual(id(c0::adapted1), id(c0::adapted1)) + checkEqual(id(c0::adapted1), adapted1FromOtherFile(c0)) + checkEqual(id(c0::adapted2), id(c0::adapted2)) + checkEqual(id(c0::adapted2), adapted2FromOtherFile(c0)) + checkNotEqual(id(c0::adapted1), id(c0::adapted2)) + + val c1 = C() + checkNotEqual(id(c0::target1), id(c1::target1)) + checkNotEqual(id(c0::target1), id(c1::target2)) + checkNotEqual(id(c0::adapted1), id(c1::adapted1)) + + return "OK" +} + +// FILE: fromOtherFile.kt + +private fun id(f: FunInterface): Any = f + +fun target1FromOtherFile(c0: C): Any = id(c0::target1) +fun adapted1FromOtherFile(c0: C): Any = id(c0::adapted1) +fun adapted2FromOtherFile(c0: C): Any = id(c0::adapted2) diff --git a/compiler/testData/codegen/box/invokedynamic/sam/unboundFunctionReferenceEquality.kt b/compiler/testData/codegen/box/invokedynamic/sam/unboundFunctionReferenceEquality.kt new file mode 100644 index 00000000000..2058123e499 --- /dev/null +++ b/compiler/testData/codegen/box/invokedynamic/sam/unboundFunctionReferenceEquality.kt @@ -0,0 +1,48 @@ +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 +// SAM_CONVERSIONS: INDY +// WITH_RUNTIME +// FILE: unboundAdaptedFunctionReference.kt +fun checkEqual(x: Any, y: Any) { + if (x != y || y != x) throw AssertionError("$x and $y should be equal") + if (x.hashCode() != y.hashCode()) throw AssertionError("$x and $y should have the same hash code") +} + +fun checkNotEqual(x: Any, y: Any) { + if (x == y || y == x) throw AssertionError("$x and $y should NOT be equal") +} + +fun interface FunInterface { + fun invoke() +} + +private fun id(f: FunInterface): Any = f + +fun target1() {} +fun target2() {} + +fun adapted1(s: String? = null): String = s!! +fun adapted2(vararg s: String): String = s[0] + +fun box(): String { + checkEqual(id(::target1), id(::target1)) + checkEqual(id(::target1), target1FromOtherFile()) + + checkNotEqual(id(::target1), id(::target2)) + + checkEqual(id(::adapted1), id(::adapted1)) + checkEqual(id(::adapted1), adapted1FromOtherFile()) + checkEqual(id(::adapted2), id(::adapted2)) + checkEqual(id(::adapted2), adapted2FromOtherFile()) + checkNotEqual(id(::adapted1), id(::adapted2)) + + return "OK" +} + +// FILE: fromOtherFile.kt + +private fun id(f: FunInterface): Any = f + +fun target1FromOtherFile(): Any = id(::target1) +fun adapted1FromOtherFile(): Any = id(::adapted1) +fun adapted2FromOtherFile(): Any = id(::adapted2) diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index 2bd48b10080..46135a7b9eb 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -18397,6 +18397,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Test + @TestMetadata("boundFunctionReferenceEquality.kt") + public void testBoundFunctionReferenceEquality() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/boundFunctionReferenceEquality.kt"); + } + @Test @TestMetadata("boundReference.kt") public void testBoundReference() throws Exception { @@ -18505,6 +18511,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/invokedynamic/sam/suspendFunInterface.kt"); } + @Test + @TestMetadata("unboundFunctionReferenceEquality.kt") + public void testUnboundFunctionReferenceEquality() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/unboundFunctionReferenceEquality.kt"); + } + @Nested @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inline") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index a31d49d27ae..796a43c4270 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -18397,6 +18397,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Test + @TestMetadata("boundFunctionReferenceEquality.kt") + public void testBoundFunctionReferenceEquality() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/boundFunctionReferenceEquality.kt"); + } + @Test @TestMetadata("boundReference.kt") public void testBoundReference() throws Exception { @@ -18505,6 +18511,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/invokedynamic/sam/suspendFunInterface.kt"); } + @Test + @TestMetadata("unboundFunctionReferenceEquality.kt") + public void testUnboundFunctionReferenceEquality() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/unboundFunctionReferenceEquality.kt"); + } + @Nested @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inline") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 1253e91d528..6b69b50e143 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -16133,6 +16133,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @TestMetadata("boundFunctionReferenceEquality.kt") + public void testBoundFunctionReferenceEquality() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/boundFunctionReferenceEquality.kt"); + } + @TestMetadata("boundReference.kt") public void testBoundReference() throws Exception { runTest("compiler/testData/codegen/box/invokedynamic/sam/boundReference.kt"); @@ -16223,6 +16228,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/invokedynamic/sam/suspendFunInterface.kt"); } + @TestMetadata("unboundFunctionReferenceEquality.kt") + public void testUnboundFunctionReferenceEquality() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/unboundFunctionReferenceEquality.kt"); + } + @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inline") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) From 5d7dc5fa396cd1973daaf218a24cba8739571e7e Mon Sep 17 00:00:00 2001 From: Dmitry Petrov Date: Wed, 27 Jan 2021 16:43:48 +0300 Subject: [PATCH 171/212] JVM_IR indy-SAM conversions: minor updates See: KT-44575 KT-44577 KT-44278 KT-26060 KT-42621 --- .../FirBlackBoxCodegenTestGenerated.java | 6 ++ .../jvm/lower/FunctionReferenceLowering.kt | 14 ++-- compiler/testData/cli/jvm/extraHelp.out | 3 + .../funInterfaceWithInlineAny.kt | 2 + .../funInterfaceWithInlineInt.kt | 2 + .../funInterfaceWithInlineNAny.kt | 2 + .../funInterfaceWithInlineNInt.kt | 2 + .../funInterfaceWithInlineNString.kt | 2 + .../funInterfaceWithInlineString.kt | 2 + .../samConversionInsideSamConvertedLambda.kt | 16 ++++ .../box/invokedynamic/sam/streamApi1.kt | 1 + .../box/invokedynamic/sam/streamApi2.kt | 1 + .../invokedynamic/sam/suspendFunInterface.kt | 2 + .../bytecodeText/invokedynamic/streamApi.kt | 1 + .../codegen/BlackBoxCodegenTestGenerated.java | 6 ++ .../IrBlackBoxCodegenTestGenerated.java | 6 ++ .../LightAnalysisModeTestGenerated.java | 75 ++++++++++--------- 17 files changed, 99 insertions(+), 44 deletions(-) create mode 100644 compiler/testData/codegen/box/invokedynamic/sam/samConversionInsideSamConvertedLambda.kt diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java index 2a336c39aa8..6441ede6b42 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java @@ -18475,6 +18475,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/invokedynamic/sam/primitiveVsWrapperInSam.kt"); } + @Test + @TestMetadata("samConversionInsideSamConvertedLambda.kt") + public void testSamConversionInsideSamConvertedLambda() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/samConversionInsideSamConvertedLambda.kt"); + } + @Test @TestMetadata("samConversionOnFunctionReference.kt") public void testSamConversionOnFunctionReference() throws Exception { diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/FunctionReferenceLowering.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/FunctionReferenceLowering.kt index 84c43490af6..3f06295dccd 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/FunctionReferenceLowering.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/FunctionReferenceLowering.kt @@ -13,7 +13,6 @@ import org.jetbrains.kotlin.backend.common.lower.parents import org.jetbrains.kotlin.backend.common.phaser.makeIrFilePhase import org.jetbrains.kotlin.backend.jvm.JvmBackendContext import org.jetbrains.kotlin.backend.jvm.JvmLoweredDeclarationOrigin -import org.jetbrains.kotlin.backend.jvm.codegen.representativeUpperBound import org.jetbrains.kotlin.backend.jvm.ir.* import org.jetbrains.kotlin.backend.jvm.lower.inlineclasses.InlineClassAbi import org.jetbrains.kotlin.config.JvmSamConversions @@ -170,15 +169,12 @@ internal class FunctionReferenceLowering(private val context: JvmBackendContext) private fun IrType.isProhibitedTypeForIndySamConversion(): Boolean { if (this !is IrSimpleType) return false - val erasedType = when (val classifier = classifier.owner) { - is IrTypeParameter -> - classifier.representativeUpperBound.withHasQuestionMark(hasQuestionMark) - else -> - this + val erasedClass = when (val classifier = classifier.owner) { + is IrTypeParameter -> classifier.erasedUpperBound + is IrClass -> classifier + else -> throw AssertionError("Unexpected classifier: ${classifier.render()}") } - val erasedClass = erasedType.getClass() ?: return false - - if (!erasedType.isInlined()) return false + if (!erasedClass.isInline) return false val underlyingType = getInlineClassUnderlyingType(erasedClass) as? IrSimpleType ?: throw AssertionError("Underlying type for inline class should be a simple type: ${erasedClass.render()}") diff --git a/compiler/testData/cli/jvm/extraHelp.out b/compiler/testData/cli/jvm/extraHelp.out index 27aabe3201f..9d5a61915f4 100644 --- a/compiler/testData/cli/jvm/extraHelp.out +++ b/compiler/testData/cli/jvm/extraHelp.out @@ -92,6 +92,9 @@ where advanced options include: profilerPath is a path to libasyncProfiler.so Example: -Xprofile=/async-profiler/build/libasyncProfiler.so:event=cpu,interval=1ms,threads,start,framebuf=50000000: -Xrepeat= Debug option: Repeats modules compilation times + -Xsam-conversions={class|indy} Select code generation scheme for SAM conversions. + -Xsam-conversions=indy Generate SAM conversions using `invokedynamic` with `LambdaMetafactory.metafactory`. Requires `-jvm-target 8` or greater. + -Xsam-conversions=class Generate SAM conversions as explicit classes -Xsanitize-parentheses Transform '(' and ')' in method names to some other character sequence. This mode can BREAK BINARY COMPATIBILITY and is only supposed to be used to workaround problems with parentheses in identifiers on certain platforms diff --git a/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineAny.kt b/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineAny.kt index 2de01599722..b6a56cecbad 100644 --- a/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineAny.kt +++ b/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineAny.kt @@ -1,4 +1,6 @@ // TARGET_BACKEND: JVM +// IGNORE_BACKEND: JVM +// IGNORE_LIGHT_ANALYSIS // JVM_TARGET: 1.8 // SAM_CONVERSIONS: INDY diff --git a/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineInt.kt b/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineInt.kt index 56dd6f9f7a7..caa814094ed 100644 --- a/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineInt.kt +++ b/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineInt.kt @@ -1,4 +1,6 @@ // TARGET_BACKEND: JVM +// IGNORE_BACKEND: JVM +// IGNORE_LIGHT_ANALYSIS // JVM_TARGET: 1.8 // SAM_CONVERSIONS: INDY diff --git a/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineNAny.kt b/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineNAny.kt index cb73273e940..7d76740d04b 100644 --- a/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineNAny.kt +++ b/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineNAny.kt @@ -1,4 +1,6 @@ // TARGET_BACKEND: JVM +// IGNORE_BACKEND: JVM +// IGNORE_LIGHT_ANALYSIS // JVM_TARGET: 1.8 // SAM_CONVERSIONS: INDY diff --git a/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineNInt.kt b/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineNInt.kt index 772f4ce7d5f..2ad8e8cce29 100644 --- a/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineNInt.kt +++ b/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineNInt.kt @@ -1,4 +1,6 @@ // TARGET_BACKEND: JVM +// IGNORE_BACKEND: JVM +// IGNORE_LIGHT_ANALYSIS // JVM_TARGET: 1.8 // SAM_CONVERSIONS: INDY diff --git a/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineNString.kt b/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineNString.kt index eea458ecb5d..47eae7cd1be 100644 --- a/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineNString.kt +++ b/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineNString.kt @@ -1,4 +1,6 @@ // TARGET_BACKEND: JVM +// IGNORE_BACKEND: JVM +// IGNORE_LIGHT_ANALYSIS // JVM_TARGET: 1.8 // SAM_CONVERSIONS: INDY diff --git a/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineString.kt b/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineString.kt index 0406d90261f..6f6aa813c4b 100644 --- a/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineString.kt +++ b/compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineString.kt @@ -1,4 +1,6 @@ // TARGET_BACKEND: JVM +// IGNORE_BACKEND: JVM +// IGNORE_LIGHT_ANALYSIS // JVM_TARGET: 1.8 // SAM_CONVERSIONS: INDY diff --git a/compiler/testData/codegen/box/invokedynamic/sam/samConversionInsideSamConvertedLambda.kt b/compiler/testData/codegen/box/invokedynamic/sam/samConversionInsideSamConvertedLambda.kt new file mode 100644 index 00000000000..760a18d50aa --- /dev/null +++ b/compiler/testData/codegen/box/invokedynamic/sam/samConversionInsideSamConvertedLambda.kt @@ -0,0 +1,16 @@ +// TARGET_BACKEND: JVM +// JVM_TARGET: 1.8 +// SAM_CONVERSIONS: INDY + +fun interface IFoo { + fun foo(k: String): String +} + +fun fooK(iFoo: IFoo) = iFoo.foo("K") + +fun box() = + fooK { + fooK { + fooK { k -> "O" + k } + } + } \ No newline at end of file diff --git a/compiler/testData/codegen/box/invokedynamic/sam/streamApi1.kt b/compiler/testData/codegen/box/invokedynamic/sam/streamApi1.kt index ecda6899ee7..9ca50ed75bc 100644 --- a/compiler/testData/codegen/box/invokedynamic/sam/streamApi1.kt +++ b/compiler/testData/codegen/box/invokedynamic/sam/streamApi1.kt @@ -1,4 +1,5 @@ // TARGET_BACKEND: JVM +// IGNORE_BACKEND_FIR: JVM_IR // JVM_TARGET: 1.8 // SAM_CONVERSIONS: INDY // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/invokedynamic/sam/streamApi2.kt b/compiler/testData/codegen/box/invokedynamic/sam/streamApi2.kt index 0f0683fe00a..7463f0f7d5e 100644 --- a/compiler/testData/codegen/box/invokedynamic/sam/streamApi2.kt +++ b/compiler/testData/codegen/box/invokedynamic/sam/streamApi2.kt @@ -1,4 +1,5 @@ // TARGET_BACKEND: JVM +// IGNORE_BACKEND_FIR: JVM_IR // JVM_TARGET: 1.8 // SAM_CONVERSIONS: INDY // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/invokedynamic/sam/suspendFunInterface.kt b/compiler/testData/codegen/box/invokedynamic/sam/suspendFunInterface.kt index 23047631362..99927451d01 100644 --- a/compiler/testData/codegen/box/invokedynamic/sam/suspendFunInterface.kt +++ b/compiler/testData/codegen/box/invokedynamic/sam/suspendFunInterface.kt @@ -1,5 +1,7 @@ // !LANGUAGE: +SuspendFunctionsInFunInterfaces +JvmIrEnabledByDefault // TARGET_BACKEND: JVM +// IGNORE_BACKEND: JVM +// IGNORE_LIGHT_ANALYSIS // JVM_TARGET: 1.8 // SAM_CONVERSIONS: INDY // WITH_RUNTIME diff --git a/compiler/testData/codegen/bytecodeText/invokedynamic/streamApi.kt b/compiler/testData/codegen/bytecodeText/invokedynamic/streamApi.kt index 99dad35114a..52f0ae1029c 100644 --- a/compiler/testData/codegen/bytecodeText/invokedynamic/streamApi.kt +++ b/compiler/testData/codegen/bytecodeText/invokedynamic/streamApi.kt @@ -1,4 +1,5 @@ // TARGET_BACKEND: JVM +// IGNORE_BACKEND_FIR: JVM_IR // JVM_TARGET: 1.8 // SAM_CONVERSIONS: INDY // WITH_RUNTIME diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index 46135a7b9eb..241a846a4dd 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -18475,6 +18475,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/invokedynamic/sam/primitiveVsWrapperInSam.kt"); } + @Test + @TestMetadata("samConversionInsideSamConvertedLambda.kt") + public void testSamConversionInsideSamConvertedLambda() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/samConversionInsideSamConvertedLambda.kt"); + } + @Test @TestMetadata("samConversionOnFunctionReference.kt") public void testSamConversionOnFunctionReference() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index 796a43c4270..f89dfecb257 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -18475,6 +18475,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/invokedynamic/sam/primitiveVsWrapperInSam.kt"); } + @Test + @TestMetadata("samConversionInsideSamConvertedLambda.kt") + public void testSamConversionInsideSamConvertedLambda() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/samConversionInsideSamConvertedLambda.kt"); + } + @Test @TestMetadata("samConversionOnFunctionReference.kt") public void testSamConversionOnFunctionReference() throws Exception { diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 6b69b50e143..45e0b541a0d 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -16125,6 +16125,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class Sam extends AbstractLightAnalysisModeTest { + @TestMetadata("suspendFunInterface.kt") + public void ignoreSuspendFunInterface() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/suspendFunInterface.kt"); + } + private void runTest(String testDataFilePath) throws Exception { KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } @@ -16198,6 +16203,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/invokedynamic/sam/primitiveVsWrapperInSam.kt"); } + @TestMetadata("samConversionInsideSamConvertedLambda.kt") + public void testSamConversionInsideSamConvertedLambda() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/samConversionInsideSamConvertedLambda.kt"); + } + @TestMetadata("samConversionOnFunctionReference.kt") public void testSamConversionOnFunctionReference() throws Exception { runTest("compiler/testData/codegen/box/invokedynamic/sam/samConversionOnFunctionReference.kt"); @@ -16223,11 +16233,6 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/invokedynamic/sam/streamApi2.kt"); } - @TestMetadata("suspendFunInterface.kt") - public void testSuspendFunInterface() throws Exception { - runTest("compiler/testData/codegen/box/invokedynamic/sam/suspendFunInterface.kt"); - } - @TestMetadata("unboundFunctionReferenceEquality.kt") public void testUnboundFunctionReferenceEquality() throws Exception { runTest("compiler/testData/codegen/box/invokedynamic/sam/unboundFunctionReferenceEquality.kt"); @@ -16270,6 +16275,36 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class InlineClassInSignature extends AbstractLightAnalysisModeTest { + @TestMetadata("funInterfaceWithInlineAny.kt") + public void ignoreFunInterfaceWithInlineAny() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineAny.kt"); + } + + @TestMetadata("funInterfaceWithInlineInt.kt") + public void ignoreFunInterfaceWithInlineInt() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineInt.kt"); + } + + @TestMetadata("funInterfaceWithInlineNAny.kt") + public void ignoreFunInterfaceWithInlineNAny() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineNAny.kt"); + } + + @TestMetadata("funInterfaceWithInlineNInt.kt") + public void ignoreFunInterfaceWithInlineNInt() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineNInt.kt"); + } + + @TestMetadata("funInterfaceWithInlineNString.kt") + public void ignoreFunInterfaceWithInlineNString() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineNString.kt"); + } + + @TestMetadata("funInterfaceWithInlineString.kt") + public void ignoreFunInterfaceWithInlineString() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineString.kt"); + } + private void runTest(String testDataFilePath) throws Exception { KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } @@ -16278,36 +16313,6 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } - @TestMetadata("funInterfaceWithInlineAny.kt") - public void testFunInterfaceWithInlineAny() throws Exception { - runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineAny.kt"); - } - - @TestMetadata("funInterfaceWithInlineInt.kt") - public void testFunInterfaceWithInlineInt() throws Exception { - runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineInt.kt"); - } - - @TestMetadata("funInterfaceWithInlineNAny.kt") - public void testFunInterfaceWithInlineNAny() throws Exception { - runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineNAny.kt"); - } - - @TestMetadata("funInterfaceWithInlineNInt.kt") - public void testFunInterfaceWithInlineNInt() throws Exception { - runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineNInt.kt"); - } - - @TestMetadata("funInterfaceWithInlineNString.kt") - public void testFunInterfaceWithInlineNString() throws Exception { - runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineNString.kt"); - } - - @TestMetadata("funInterfaceWithInlineString.kt") - public void testFunInterfaceWithInlineString() throws Exception { - runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/funInterfaceWithInlineString.kt"); - } - @TestMetadata("genericFunInterfaceWithInlineAny.kt") public void testGenericFunInterfaceWithInlineAny() throws Exception { runTest("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature/genericFunInterfaceWithInlineAny.kt"); From 9efac8f68b35c7c95cb19d635ef257c175d1d75d Mon Sep 17 00:00:00 2001 From: Victor Petukhov Date: Wed, 27 Jan 2021 16:27:20 +0300 Subject: [PATCH 172/212] Propagate all annotations during creating simple functional types ^KT-44563 Fixed --- ...irOldFrontendDiagnosticsTestGenerated.java | 6 +++++ .../kotlin/fir/types/ConeInferenceContext.kt | 3 ++- .../kotlin/fir/types/ConeTypeContext.kt | 5 ++++ .../kotlin/ir/types/IrTypeSystemContext.kt | 23 +++++++++++++--- .../PostponedArgumentInputTypesResolver.kt | 9 +++++-- .../propagteAnyAnnotations.fir.kt | 12 +++++++++ .../functionalTypes/propagteAnyAnnotations.kt | 12 +++++++++ .../propagteAnyAnnotations.txt | 12 +++++++++ .../test/runners/DiagnosticTestGenerated.java | 6 +++++ .../kotlin/types/model/TypeSystemContext.kt | 6 ++++- .../annotations/AnnotationDescriptor.kt | 3 ++- .../descriptors/annotations/Annotations.kt | 1 + .../types/checker/ClassicTypeSystemContext.kt | 26 ++++++++++++++----- 13 files changed, 109 insertions(+), 15 deletions(-) create mode 100644 compiler/testData/diagnostics/tests/annotations/functionalTypes/propagteAnyAnnotations.fir.kt create mode 100644 compiler/testData/diagnostics/tests/annotations/functionalTypes/propagteAnyAnnotations.kt create mode 100644 compiler/testData/diagnostics/tests/annotations/functionalTypes/propagteAnyAnnotations.txt diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java index ff5f288d125..4f3716e24a4 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java @@ -1457,6 +1457,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti public void testParenthesizedAnnotations() throws Exception { runTest("compiler/testData/diagnostics/tests/annotations/functionalTypes/parenthesizedAnnotations.kt"); } + + @Test + @TestMetadata("propagteAnyAnnotations.kt") + public void testPropagteAnyAnnotations() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/functionalTypes/propagteAnyAnnotations.kt"); + } } @Nested diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/types/ConeInferenceContext.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/types/ConeInferenceContext.kt index 0b16784e182..eafd1ba2afb 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/types/ConeInferenceContext.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/types/ConeInferenceContext.kt @@ -58,7 +58,8 @@ interface ConeInferenceContext : TypeSystemInferenceExtensionContext, ConeTypeCo constructor: TypeConstructorMarker, arguments: List, nullable: Boolean, - isExtensionFunction: Boolean + isExtensionFunction: Boolean, + annotations: List? // TODO: process annotations ): SimpleTypeMarker { val attributes = if (isExtensionFunction) // TODO: assert correct type constructor ConeAttributes.WithExtensionFunctionType diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/types/ConeTypeContext.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/types/ConeTypeContext.kt index 169e38722e2..91df2893bea 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/types/ConeTypeContext.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/types/ConeTypeContext.kt @@ -402,6 +402,11 @@ interface ConeTypeContext : TypeSystemContext, TypeSystemOptimizationContext, Ty return false } + override fun KotlinTypeMarker.getAnnotations(): List { + require(this is ConeKotlinType) + return emptyList() // TODO + } + override fun SimpleTypeMarker.isStubType(): Boolean { return this is StubTypeMarker } diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/types/IrTypeSystemContext.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/types/IrTypeSystemContext.kt index e6a34e2a4ed..2b89a9ab30e 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/types/IrTypeSystemContext.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/types/IrTypeSystemContext.kt @@ -10,9 +10,12 @@ import org.jetbrains.kotlin.builtins.PrimitiveType import org.jetbrains.kotlin.descriptors.ClassKind import org.jetbrains.kotlin.descriptors.Modality import org.jetbrains.kotlin.descriptors.DescriptorVisibilities +import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor +import org.jetbrains.kotlin.ir.IrElement import org.jetbrains.kotlin.ir.declarations.* import org.jetbrains.kotlin.ir.descriptors.IrBuiltIns import org.jetbrains.kotlin.ir.expressions.IrConst +import org.jetbrains.kotlin.ir.expressions.IrConstructorCall import org.jetbrains.kotlin.ir.symbols.FqNameEqualityChecker import org.jetbrains.kotlin.ir.symbols.IrClassSymbol import org.jetbrains.kotlin.ir.symbols.IrClassifierSymbol @@ -237,13 +240,22 @@ interface IrTypeSystemContext : TypeSystemContext, TypeSystemCommonSuperTypesCon return IrDynamicTypeImpl(null, emptyList(), Variance.INVARIANT) } - // TODO: implement taking into account `isExtensionFunction` override fun createSimpleType( constructor: TypeConstructorMarker, arguments: List, nullable: Boolean, - isExtensionFunction: Boolean - ): SimpleTypeMarker = IrSimpleTypeImpl(constructor as IrClassifierSymbol, nullable, arguments.map { it as IrTypeArgument }, emptyList()) + isExtensionFunction: Boolean, + annotations: List? + ): SimpleTypeMarker { + val ourAnnotations = annotations?.filterIsInstance() + require(ourAnnotations?.size == annotations?.size) + return IrSimpleTypeImpl( + constructor as IrClassifierSymbol, + nullable, + arguments.map { it as IrTypeArgument }, + ourAnnotations ?: emptyList() + ) + } private fun TypeVariance.convertVariance(): Variance { return when (this) { @@ -298,6 +310,11 @@ interface IrTypeSystemContext : TypeSystemContext, TypeSystemCommonSuperTypesCon override fun SimpleTypeMarker.isPrimitiveType(): Boolean = this is IrSimpleType && irTypePredicates_isPrimitiveType() + override fun KotlinTypeMarker.getAnnotations(): List { + require(this is IrType) + return this.annotations.map { object : AnnotationMarker, IrElement by it {} } + } + override fun createErrorType(debugName: String): SimpleTypeMarker { TODO("IrTypeSystemContext doesn't support constraint system resolution") } diff --git a/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/inference/components/PostponedArgumentInputTypesResolver.kt b/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/inference/components/PostponedArgumentInputTypesResolver.kt index 4fa73b17809..14a1ceba84c 100644 --- a/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/inference/components/PostponedArgumentInputTypesResolver.kt +++ b/compiler/resolution.common/src/org/jetbrains/kotlin/resolve/calls/inference/components/PostponedArgumentInputTypesResolver.kt @@ -24,6 +24,7 @@ class PostponedArgumentInputTypesResolver( val parametersFromDeclaration: List?, val parametersFromDeclarationOfRelatedLambdas: Set>?, val parametersFromConstraints: Set>?, + val annotations: List?, val isExtensionFunction: Boolean, val isSuspend: Boolean, val isNullable: Boolean @@ -57,7 +58,7 @@ class PostponedArgumentInputTypesResolver( argument: PostponedAtomWithRevisableExpectedType, postponedArguments: List, variableDependencyProvider: TypeVariableDependencyInformationProvider - ): ParameterTypesInfo? = with(resolutionTypeSystemContext) { + ): ParameterTypesInfo? { val expectedType = argument.expectedType ?: return null val variableWithConstraints = notFixedTypeVariables[expectedType.typeConstructor()] ?: return null val functionalTypesFromConstraints = findFunctionalTypesInConstraints(variableWithConstraints, variableDependencyProvider) @@ -76,6 +77,8 @@ class PostponedArgumentInputTypesResolver( } } + val annotations = functionalTypesFromConstraints?.map { it.type.getAnnotations() }?.flatten()?.distinct() + // An extension function flag can only come from a declaration of anonymous function: `select({ this + it }, fun Int.(x: Int) = 10)` val (parameterTypesFromDeclarationOfRelatedLambdas, isThereExtensionFunctionAmongRelatedLambdas) = getDeclaredParametersFromRelatedLambdas(argument, postponedArguments, variableDependencyProvider) @@ -96,6 +99,7 @@ class PostponedArgumentInputTypesResolver( parameterTypesFromDeclaration, parameterTypesFromDeclarationOfRelatedLambdas, parameterTypesFromConstraints, + annotations = annotations, isExtensionFunction = isThereExtensionFunctionAmongRelatedLambdas || extensionFunctionTypePresentInConstraints, isSuspend = isSuspend, isNullable = isNullable @@ -344,7 +348,8 @@ class PostponedArgumentInputTypesResolver( shouldDiscriminateExtensionFunctionAnnotation -> false argument.isFunctionExpressionWithReceiver() -> true else -> parameterTypesInfo.isExtensionFunction - } + }, + annotations = parameterTypesInfo.annotations ) getBuilder().addSubtypeConstraint( diff --git a/compiler/testData/diagnostics/tests/annotations/functionalTypes/propagteAnyAnnotations.fir.kt b/compiler/testData/diagnostics/tests/annotations/functionalTypes/propagteAnyAnnotations.fir.kt new file mode 100644 index 00000000000..3e194a67450 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/functionalTypes/propagteAnyAnnotations.fir.kt @@ -0,0 +1,12 @@ +// !DIAGNOSTICS: -UNUSED_PARAMETER + +@Target(AnnotationTarget.FUNCTION, AnnotationTarget.TYPE) +annotation class Composable + +fun bar(p: @Composable ()->Unit) {} + +@Composable fun foo() {} + +fun main() { + bar(if(true) { { foo() } } else { { } }) +} diff --git a/compiler/testData/diagnostics/tests/annotations/functionalTypes/propagteAnyAnnotations.kt b/compiler/testData/diagnostics/tests/annotations/functionalTypes/propagteAnyAnnotations.kt new file mode 100644 index 00000000000..bc85c6650c9 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/functionalTypes/propagteAnyAnnotations.kt @@ -0,0 +1,12 @@ +// !DIAGNOSTICS: -UNUSED_PARAMETER + +@Target(AnnotationTarget.FUNCTION, AnnotationTarget.TYPE) +annotation class Composable + +fun bar(p: @Composable ()->Unit) {} + +@Composable fun foo() {} + +fun main() { + bar( kotlin.Unit")!>if(true) { { foo() } } else { { } }) +} diff --git a/compiler/testData/diagnostics/tests/annotations/functionalTypes/propagteAnyAnnotations.txt b/compiler/testData/diagnostics/tests/annotations/functionalTypes/propagteAnyAnnotations.txt new file mode 100644 index 00000000000..3a62a513f88 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/functionalTypes/propagteAnyAnnotations.txt @@ -0,0 +1,12 @@ +package + +public fun bar(/*0*/ p: @Composable () -> kotlin.Unit): kotlin.Unit +@Composable public fun foo(): kotlin.Unit +public fun main(): kotlin.Unit + +@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.FUNCTION, AnnotationTarget.TYPE}) public final annotation class Composable : kotlin.Annotation { + public constructor Composable() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java index 378bdfa2eff..9944b7b6e2c 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java @@ -1463,6 +1463,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { public void testParenthesizedAnnotations() throws Exception { runTest("compiler/testData/diagnostics/tests/annotations/functionalTypes/parenthesizedAnnotations.kt"); } + + @Test + @TestMetadata("propagteAnyAnnotations.kt") + public void testPropagteAnyAnnotations() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/functionalTypes/propagteAnyAnnotations.kt"); + } } @Nested diff --git a/core/compiler.common/src/org/jetbrains/kotlin/types/model/TypeSystemContext.kt b/core/compiler.common/src/org/jetbrains/kotlin/types/model/TypeSystemContext.kt index 6c7f40d41b6..81a35b99371 100644 --- a/core/compiler.common/src/org/jetbrains/kotlin/types/model/TypeSystemContext.kt +++ b/core/compiler.common/src/org/jetbrains/kotlin/types/model/TypeSystemContext.kt @@ -36,6 +36,7 @@ interface IntersectionTypeConstructorMarker : TypeConstructorMarker interface TypeSubstitutorMarker +interface AnnotationMarker enum class TypeVariance(val presentation: String) { IN("in"), @@ -73,7 +74,8 @@ interface TypeSystemTypeFactoryContext { constructor: TypeConstructorMarker, arguments: List, nullable: Boolean, - isExtensionFunction: Boolean = false + isExtensionFunction: Boolean = false, + annotations: List? = null ): SimpleTypeMarker fun createTypeArgument(type: KotlinTypeMarker, variance: TypeVariance): TypeArgumentMarker @@ -391,6 +393,8 @@ interface TypeSystemContext : TypeSystemOptimizationContext { fun prepareType(type: KotlinTypeMarker): KotlinTypeMarker fun SimpleTypeMarker.isPrimitiveType(): Boolean + + fun KotlinTypeMarker.getAnnotations(): List } enum class CaptureStatus { diff --git a/core/descriptors/src/org/jetbrains/kotlin/descriptors/annotations/AnnotationDescriptor.kt b/core/descriptors/src/org/jetbrains/kotlin/descriptors/annotations/AnnotationDescriptor.kt index b6dec08742d..6dda57cb627 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/descriptors/annotations/AnnotationDescriptor.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/descriptors/annotations/AnnotationDescriptor.kt @@ -25,8 +25,9 @@ import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameOrNull import org.jetbrains.kotlin.types.ErrorUtils import org.jetbrains.kotlin.types.KotlinType import org.jetbrains.kotlin.types.getAbbreviation +import org.jetbrains.kotlin.types.model.AnnotationMarker -interface AnnotationDescriptor { +interface AnnotationDescriptor : AnnotationMarker { val type: KotlinType val fqName: FqName? diff --git a/core/descriptors/src/org/jetbrains/kotlin/descriptors/annotations/Annotations.kt b/core/descriptors/src/org/jetbrains/kotlin/descriptors/annotations/Annotations.kt index 90beb46f1ac..b173d458db9 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/descriptors/annotations/Annotations.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/descriptors/annotations/Annotations.kt @@ -17,6 +17,7 @@ package org.jetbrains.kotlin.descriptors.annotations import org.jetbrains.kotlin.name.FqName +import org.jetbrains.kotlin.types.model.AnnotationMarker interface Annotated { val annotations: Annotations diff --git a/core/descriptors/src/org/jetbrains/kotlin/types/checker/ClassicTypeSystemContext.kt b/core/descriptors/src/org/jetbrains/kotlin/types/checker/ClassicTypeSystemContext.kt index fa3f585b72e..4bc8700e92f 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/types/checker/ClassicTypeSystemContext.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/types/checker/ClassicTypeSystemContext.kt @@ -29,8 +29,6 @@ import org.jetbrains.kotlin.types.typeUtil.asTypeProjection import org.jetbrains.kotlin.types.typeUtil.contains import org.jetbrains.kotlin.types.typeUtil.representativeUpperBound import org.jetbrains.kotlin.utils.addToStdlib.safeAs -import kotlin.contracts.ExperimentalContracts -import kotlin.contracts.contract import org.jetbrains.kotlin.types.typeUtil.isSignedOrUnsignedNumberType as classicIsSignedOrUnsignedNumberType interface ClassicTypeSystemContext : TypeSystemInferenceExtensionContext, TypeSystemCommonBackendContext { @@ -437,16 +435,25 @@ interface ClassicTypeSystemContext : TypeSystemInferenceExtensionContext, TypeSy constructor: TypeConstructorMarker, arguments: List, nullable: Boolean, - isExtensionFunction: Boolean + isExtensionFunction: Boolean, + annotations: List? ): SimpleTypeMarker { require(constructor is TypeConstructor, constructor::errorMessage) - val annotations = if (isExtensionFunction) { - Annotations.create(listOf(BuiltInAnnotationDescriptor(builtIns, FqNames.extensionFunctionType, emptyMap()))) - } else Annotations.EMPTY + val ourAnnotations = annotations?.filterIsInstance() + require(ourAnnotations?.size == annotations?.size) + + fun createExtensionFunctionAnnotation() = BuiltInAnnotationDescriptor(builtIns, FqNames.extensionFunctionType, emptyMap()) + + val resultingAnnotations = when { + ourAnnotations.isNullOrEmpty() && isExtensionFunction -> Annotations.create(listOf(createExtensionFunctionAnnotation())) + !ourAnnotations.isNullOrEmpty() && !isExtensionFunction -> Annotations.create(ourAnnotations.filter { it.fqName != FqNames.extensionFunctionType }) + !ourAnnotations.isNullOrEmpty() && isExtensionFunction -> Annotations.create(ourAnnotations + createExtensionFunctionAnnotation()) + else -> Annotations.EMPTY + } @Suppress("UNCHECKED_CAST") - return KotlinTypeFactory.simpleType(annotations, constructor, arguments as List, nullable) + return KotlinTypeFactory.simpleType(resultingAnnotations, constructor, arguments as List, nullable) } override fun createTypeArgument(type: KotlinTypeMarker, variance: TypeVariance): TypeArgumentMarker { @@ -557,6 +564,11 @@ interface ClassicTypeSystemContext : TypeSystemInferenceExtensionContext, TypeSy return KotlinBuiltIns.isPrimitiveType(this) } + override fun KotlinTypeMarker.getAnnotations(): List { + require(this is KotlinType, this::errorMessage) + return this.annotations.toList() + } + override fun captureFromExpression(type: KotlinTypeMarker): KotlinTypeMarker? { return captureFromExpressionInternal(type as UnwrappedType) } From fd29fab971dae5a536b21a53e034e4ec7e8b35c2 Mon Sep 17 00:00:00 2001 From: Ilya Goncharov Date: Thu, 28 Jan 2021 17:51:52 +0300 Subject: [PATCH 173/212] [Gradle, JS] Update tool versions - Node.js - 14.15.4 - Yarn - 1.22.10 ^KT-44614 fixed --- .../kotlin/gradle/targets/js/nodejs/NodeJsRootExtension.kt | 2 +- .../kotlin/gradle/targets/js/yarn/YarnRootExtension.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/js/nodejs/NodeJsRootExtension.kt b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/js/nodejs/NodeJsRootExtension.kt index ed95e35e6ff..9add2d34d71 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/js/nodejs/NodeJsRootExtension.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/js/nodejs/NodeJsRootExtension.kt @@ -35,7 +35,7 @@ open class NodeJsRootExtension(@Transient val rootProject: Project) : Configurat var download by Property(true) var nodeDownloadBaseUrl by Property("https://nodejs.org/dist") - var nodeVersion by Property("12.16.1") + var nodeVersion by Property("14.15.4") var nodeCommand by Property("node") diff --git a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/js/yarn/YarnRootExtension.kt b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/js/yarn/YarnRootExtension.kt index af0a7acb21e..fa6c33e3471 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/js/yarn/YarnRootExtension.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/targets/js/yarn/YarnRootExtension.kt @@ -29,7 +29,7 @@ open class YarnRootExtension(val project: Project) : ConfigurationPhaseAware Date: Fri, 29 Jan 2021 07:47:08 +0100 Subject: [PATCH 174/212] Set ANDROID_HOME/ANDROID_SDK_ROOT for android box tests In some cases emulator execution on TC fails cause of problem with pathes --- .../org/jetbrains/kotlin/android/tests/emulator/Emulator.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler/android-tests/tests/org/jetbrains/kotlin/android/tests/emulator/Emulator.java b/compiler/android-tests/tests/org/jetbrains/kotlin/android/tests/emulator/Emulator.java index 79fe6e5b066..5524656a3b9 100644 --- a/compiler/android-tests/tests/org/jetbrains/kotlin/android/tests/emulator/Emulator.java +++ b/compiler/android-tests/tests/org/jetbrains/kotlin/android/tests/emulator/Emulator.java @@ -144,6 +144,10 @@ public class Emulator { bootCheckCommand.addParameter("shell"); bootCheckCommand.addParameter("getprop"); bootCheckCommand.addParameter("sys.boot_completed"); + System.out.println("Setting ANDROID_HOME/ANDROID_SDK_ROOT:" + pathManager.getAndroidSdkRoot()); + bootCheckCommand.withEnvironment("ANDROID_SDK_ROOT", pathManager.getAndroidSdkRoot()); + bootCheckCommand.withEnvironment("ANDROID_HOME", pathManager.getAndroidSdkRoot()); + int counter = 0; RunResult execute = RunUtils.execute(bootCheckCommand); while (counter < 20) { From c5baf3fdd21276d4d327f03eb0f056446e9499d1 Mon Sep 17 00:00:00 2001 From: Mikhael Bogdanov Date: Fri, 29 Jan 2021 09:47:55 +0100 Subject: [PATCH 175/212] Upgrade gradle plugin to 4.1. and build tools to 29.0.3 for android box tests --- compiler/android-tests/android-module/build.gradle | 4 ++-- .../kotlin/android/tests/CodegenTestsOnAndroidGenerator.kt | 4 ++-- dependencies/android-sdk/build.gradle.kts | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/compiler/android-tests/android-module/build.gradle b/compiler/android-tests/android-module/build.gradle index 81d244ad1c1..91bbd497f93 100644 --- a/compiler/android-tests/android-module/build.gradle +++ b/compiler/android-tests/android-module/build.gradle @@ -5,7 +5,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.5.3' + classpath 'com.android.tools.build:gradle:4.1.1' } } apply plugin: 'com.android.application' @@ -17,7 +17,7 @@ repositories { android { compileSdkVersion 26 - buildToolsVersion "28.0.3" + buildToolsVersion "29.0.3" defaultConfig { applicationId "org.jetbrains.kotlin.android.tests" diff --git a/compiler/android-tests/tests/org/jetbrains/kotlin/android/tests/CodegenTestsOnAndroidGenerator.kt b/compiler/android-tests/tests/org/jetbrains/kotlin/android/tests/CodegenTestsOnAndroidGenerator.kt index d11d15d3c30..28c8dd9799a 100644 --- a/compiler/android-tests/tests/org/jetbrains/kotlin/android/tests/CodegenTestsOnAndroidGenerator.kt +++ b/compiler/android-tests/tests/org/jetbrains/kotlin/android/tests/CodegenTestsOnAndroidGenerator.kt @@ -321,8 +321,8 @@ class CodegenTestsOnAndroidGenerator private constructor(private val pathManager CodegenTestCase.createTestFilesFromFile(file, expectedText, false, TargetBackend.JVM) companion object { - const val GRADLE_VERSION = "5.6.4" // update GRADLE_SHA_256 on change - const val GRADLE_SHA_256 = "1f3067073041bc44554d0efe5d402a33bc3d3c93cc39ab684f308586d732a80d" + const val GRADLE_VERSION = "6.8.1" // update GRADLE_SHA_256 on change + const val GRADLE_SHA_256 = "fd591a34af7385730970399f473afabdb8b28d57fd97d6625c388d090039d6fd" const val testClassPackage = "org.jetbrains.kotlin.android.tests" const val testClassName = "CodegenTestCaseOnAndroid" const val baseTestClassPackage = "org.jetbrains.kotlin.android.tests" diff --git a/dependencies/android-sdk/build.gradle.kts b/dependencies/android-sdk/build.gradle.kts index ae84734bb74..9503c4bc95e 100644 --- a/dependencies/android-sdk/build.gradle.kts +++ b/dependencies/android-sdk/build.gradle.kts @@ -119,6 +119,7 @@ unzipSdkTask("android_m2repository", "r44", "extras/android", "") unzipSdkTask("platform-tools", "r28.0.1", "", toolsOsDarwin) unzipSdkTask("sdk-tools-$toolsOsDarwin", "4333796"/*26.1.1*/, "", "") unzipSdkTask("build-tools", "r28.0.3", "build-tools/28.0.3", toolsOs, buildTools, 1) +unzipSdkTask("build-tools", "r29.0.3", "build-tools/29.0.3", toolsOs, buildTools, 1) unzipSdkTask("emulator-$toolsOsDarwin", "5264690", "", "", prepareTask = prepareEmulator) unzipSdkTask("armeabi-v7a", "19", "system-images/android-19/default","r05", prepareTask = prepareEmulator) if (!kotlinBuildProperties.isTeamcityBuild) { From 7e3802bde30281f560926895751bc82c4c1d5811 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Thu, 28 Jan 2021 14:29:29 +0300 Subject: [PATCH 176/212] Advance bootstrap to 1.5.0-dev-2205 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 3c804e7e43a..dca4c7278db 100644 --- a/gradle.properties +++ b/gradle.properties @@ -17,7 +17,7 @@ kotlin.build.useIR=true #maven.repository.mirror=http://repository.jetbrains.com/remote-repos/ #bootstrap.kotlin.repo=https://dl.bintray.com/kotlin/kotlin-dev #bootstrap.kotlin.version=1.1.50-dev-1451 -bootstrap.kotlin.default.version=1.5.0-dev-1141 +bootstrap.kotlin.default.version=1.5.0-dev-2205 kotlin.build.publishing.attempts=20 #signingRequired=true From 0769157a1612e9db0d109b86d144cb815b6c0eb2 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Thu, 28 Jan 2021 16:59:47 +0300 Subject: [PATCH 177/212] Revert "Revert "Build: enable -Werror in stdlib/core/compiler/plugins modules"" This reverts commit 1300ec3e --- build.gradle.kts | 34 +++++++++++++++++++ compiler/build.gradle.kts | 12 +++++++ compiler/cli/build.gradle.kts | 2 +- libraries/commonConfiguration.gradle | 10 ++++++ .../scripting-compiler/build.gradle.kts | 2 +- 5 files changed, 58 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index bd6351e925b..7fdbcc9da7c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -320,6 +320,25 @@ extra["compilerModulesForJps"] = listOf( ":compiler:compiler.version" ) +// TODO: fix remaining warnings and remove this property. +extra["tasksWithWarnings"] = listOf( + ":kotlin-stdlib:compileTestKotlin", + ":kotlin-stdlib-jdk7:compileTestKotlin", + ":kotlin-stdlib-jdk8:compileTestKotlin", + ":compiler:cli:compileKotlin", + ":compiler:frontend:compileKotlin", + ":compiler:fir:tree:compileKotlin", + ":compiler:fir:resolve:compileKotlin", + ":compiler:fir:checkers:compileKotlin", + ":compiler:fir:java:compileKotlin", + ":kotlin-scripting-compiler:compileKotlin", + ":plugins:uast-kotlin:compileKotlin", + ":plugins:uast-kotlin:compileTestKotlin", + ":plugins:uast-kotlin-idea:compileKotlin" +) + +val tasksWithWarnings: List by extra + val coreLibProjects = listOfNotNull( ":kotlin-stdlib", ":kotlin-stdlib-common", @@ -452,6 +471,21 @@ allprojects { } } + if (!kotlinBuildProperties.isInJpsBuildIdeaSync && !kotlinBuildProperties.useFir) { + // For compiler and stdlib, allWarningsAsErrors is configured in the corresponding "root" projects + // (compiler/build.gradle.kts and libraries/commonConfiguration.gradle). + val projectsWithWarningsAsErrors = listOf("core", "plugins").map { File(it).absoluteFile } + if (projectsWithWarningsAsErrors.any(projectDir::startsWith)) { + tasks.withType { + if (path !in tasksWithWarnings) { + kotlinOptions { + allWarningsAsErrors = true + } + } + } + } + } + tasks.withType(VerificationTask::class.java as Class) { (this as VerificationTask).ignoreFailures = ignoreTestFailures } diff --git a/compiler/build.gradle.kts b/compiler/build.gradle.kts index 4afd3561e5e..19e9a8649c0 100644 --- a/compiler/build.gradle.kts +++ b/compiler/build.gradle.kts @@ -10,6 +10,8 @@ plugins { val compilerModules: Array by rootProject.extra val otherCompilerModules = compilerModules.filter { it != path } +val tasksWithWarnings: List by rootProject.extra + val effectSystemEnabled: Boolean by rootProject.extra val newInferenceEnabled: Boolean by rootProject.extra @@ -85,6 +87,16 @@ if (kotlinBuildProperties.isInJpsBuildIdeaSync) { idea { this.module.generatedSourceDirs.add(generationRoot) } +} else { + allprojects { + tasks.withType> { + if (path !in tasksWithWarnings) { + kotlinOptions { + allWarningsAsErrors = true + } + } + } + } } projectTest(parallel = true) { diff --git a/compiler/cli/build.gradle.kts b/compiler/cli/build.gradle.kts index 5605a840822..a450e082560 100644 --- a/compiler/cli/build.gradle.kts +++ b/compiler/cli/build.gradle.kts @@ -57,7 +57,7 @@ tasks.withType> { kotlinOptions { languageVersion = "1.3" apiVersion = "1.3" - freeCompilerArgs += "-Xskip-prerelease-check" + freeCompilerArgs = freeCompilerArgs - "-progressive" + "-Xskip-prerelease-check" } } diff --git a/libraries/commonConfiguration.gradle b/libraries/commonConfiguration.gradle index d5f4d85e34f..fa1dcc5495b 100644 --- a/libraries/commonConfiguration.gradle +++ b/libraries/commonConfiguration.gradle @@ -9,6 +9,8 @@ ext.configureJavaOnlyJvm6Project = { Project project -> } } +List tasksWithWarnings = (List) rootProject.ext.get("tasksWithWarnings") + ext.configureJvm6Project = { Project project -> project.configure(project) { configurations { @@ -34,6 +36,14 @@ ext.configureJvm6Project = { Project project -> executable = "$JDK_16/bin/java" } } + + project.tasks.withType(org.jetbrains.kotlin.gradle.dsl.KotlinCompile.class) { task -> + if (!tasksWithWarnings.contains(task.path)) { + task.kotlinOptions { + allWarningsAsErrors = true + } + } + } } ext.compileJava9Sources = { Project project, String moduleName, Collection moduleOutputs = [project.sourceSets.main.output] -> diff --git a/plugins/scripting/scripting-compiler/build.gradle.kts b/plugins/scripting/scripting-compiler/build.gradle.kts index e04a46c3399..128a2797476 100644 --- a/plugins/scripting/scripting-compiler/build.gradle.kts +++ b/plugins/scripting/scripting-compiler/build.gradle.kts @@ -47,7 +47,7 @@ tasks.withType> { kotlinOptions { languageVersion = "1.3" apiVersion = "1.3" - freeCompilerArgs += "-Xskip-metadata-version-check" + freeCompilerArgs = freeCompilerArgs - "-progressive" + "-Xskip-metadata-version-check" } } From 0a47b1c32b5a6ecf11eac55af7d8e8e09278dc18 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Thu, 28 Jan 2021 17:07:38 +0300 Subject: [PATCH 178/212] Remove incorrectly added dependency on experimental coroutines --- plugins/scripting/scripting-compiler-impl/build.gradle.kts | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/scripting/scripting-compiler-impl/build.gradle.kts b/plugins/scripting/scripting-compiler-impl/build.gradle.kts index b89ce3eb778..701be0ccfdd 100644 --- a/plugins/scripting/scripting-compiler-impl/build.gradle.kts +++ b/plugins/scripting/scripting-compiler-impl/build.gradle.kts @@ -25,7 +25,6 @@ dependencies { compileOnly(intellijDep()) { includeJars("platform-api") } runtimeOnly(project(":kotlin-reflect")) - runtimeOnly( "org.jetbrains.kotlin:kotlin-coroutines-experimental-compat:1.4.20") testCompile(project(":compiler:frontend")) testCompile(project(":compiler:plugin-api")) From e8068b5576a682d954051635e6ff0201c933b4e1 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Thu, 28 Jan 2021 17:26:20 +0300 Subject: [PATCH 179/212] Update testdata of maven plugin tests --- .../src/it/test-plugins/expected.log | 7 ------- 1 file changed, 7 deletions(-) diff --git a/libraries/tools/kotlin-maven-plugin-test/src/it/test-plugins/expected.log b/libraries/tools/kotlin-maven-plugin-test/src/it/test-plugins/expected.log index ccb1f4ffd51..a3f5a309353 100644 --- a/libraries/tools/kotlin-maven-plugin-test/src/it/test-plugins/expected.log +++ b/libraries/tools/kotlin-maven-plugin-test/src/it/test-plugins/expected.log @@ -1,10 +1,3 @@ -[WARNING] Runtime JAR files in the classpath should have the same version. These files were found in the classpath: -/local-repo/org/jetbrains/kotlin/kotlin-stdlib/@snapshot@/kotlin-stdlib-@snapshot@.jar (version 1.5) -/local-repo/org/jetbrains/kotlin/kotlin-stdlib-common/@snapshot@/kotlin-stdlib-common-@snapshot@.jar (version 1.5) -/local-repo/org/jetbrains/kotlin/kotlin-script-runtime/@snapshot@/kotlin-script-runtime-@snapshot@.jar (version 1.5) -/local-repo/org/jetbrains/kotlin/kotlin-reflect/@snapshot@/kotlin-reflect-@snapshot@.jar (version 1.5) -/local-repo/org/jetbrains/kotlin/kotlin-coroutines-experimental-compat/1.4.20/kotlin-coroutines-experimental-compat-1.4.20.jar (version 1.4) -[WARNING] Some runtime JAR files in the classpath have an incompatible version. Consider removing them from the classpath [WARNING] No sources found skipping Kotlin compile [INFO] Applicability test for project use-test-extension [INFO] Applied plugin: 'test-me' From 4a50dc90745473528ebf275dc48524c68d256f33 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Fri, 29 Jan 2021 12:57:28 +0300 Subject: [PATCH 180/212] Add workaround for problem with initialization of :tools:kotlinp --- libraries/tools/kotlinp/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/tools/kotlinp/build.gradle.kts b/libraries/tools/kotlinp/build.gradle.kts index 8d863d34fec..4d3c22c5407 100644 --- a/libraries/tools/kotlinp/build.gradle.kts +++ b/libraries/tools/kotlinp/build.gradle.kts @@ -26,7 +26,7 @@ dependencies { testCompile(projectTests(":compiler:tests-common")) testCompile(projectTests(":generators:test-generator")) - testRuntime(project(":kotlinx-metadata-jvm", configuration = "runtime")) + testRuntimeOnly(project(":kotlinx-metadata-jvm"/*, configuration = "runtime"*/)) testRuntimeOnly(intellijCoreDep()) { includeJars("intellij-core") } From 3e1fabd46c5c70e0af3910f749d299821bf1a449 Mon Sep 17 00:00:00 2001 From: Mikhael Bogdanov Date: Fri, 29 Jan 2021 14:29:19 +0100 Subject: [PATCH 181/212] Set ANDROID_SDK_ROOT for android box tests --- .../kotlin/android/tests/emulator/Emulator.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/compiler/android-tests/tests/org/jetbrains/kotlin/android/tests/emulator/Emulator.java b/compiler/android-tests/tests/org/jetbrains/kotlin/android/tests/emulator/Emulator.java index 5524656a3b9..d14a7cad83f 100644 --- a/compiler/android-tests/tests/org/jetbrains/kotlin/android/tests/emulator/Emulator.java +++ b/compiler/android-tests/tests/org/jetbrains/kotlin/android/tests/emulator/Emulator.java @@ -121,8 +121,11 @@ public class Emulator { public void startEmulator() { startServer(); - System.out.println("Starting emulator..."); - RunUtils.executeOnSeparateThread(new RunUtils.RunSettings(getStartCommand(), null, false, "START: ", true)); + System.out.println("Starting emulator with ANDROID_HOME/ANDROID_SDK_ROOT: " + pathManager.getAndroidSdkRoot()); + GeneralCommandLine startCommand = getStartCommand(); + startCommand.withEnvironment("ANDROID_SDK_ROOT", pathManager.getAndroidSdkRoot()); + startCommand.withEnvironment("ANDROID_HOME", pathManager.getAndroidSdkRoot()); + RunUtils.executeOnSeparateThread(new RunUtils.RunSettings(startCommand, null, false, "START: ", true)); printLog(); } @@ -144,9 +147,6 @@ public class Emulator { bootCheckCommand.addParameter("shell"); bootCheckCommand.addParameter("getprop"); bootCheckCommand.addParameter("sys.boot_completed"); - System.out.println("Setting ANDROID_HOME/ANDROID_SDK_ROOT:" + pathManager.getAndroidSdkRoot()); - bootCheckCommand.withEnvironment("ANDROID_SDK_ROOT", pathManager.getAndroidSdkRoot()); - bootCheckCommand.withEnvironment("ANDROID_HOME", pathManager.getAndroidSdkRoot()); int counter = 0; RunResult execute = RunUtils.execute(bootCheckCommand); From 4b823eca21a0d2ec29f3c86a69742ce5bcab981e Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Thu, 28 Jan 2021 13:58:12 +0300 Subject: [PATCH 182/212] Fix test data (FIR_IDENTICAL) --- .../suspendFunInterfaceConversion.fir.kt | 14 ------------- .../suspendFunInterfaceConversion.kt | 1 + ...uspendConversionForSimpleExpression.fir.kt | 14 ------------- ...FunSuspendConversionForSimpleExpression.kt | 1 + .../suspendConversionWithFunInterfaces.fir.kt | 21 ------------------- .../suspendConversionWithFunInterfaces.kt | 1 + 6 files changed, 3 insertions(+), 49 deletions(-) delete mode 100644 compiler/testData/diagnostics/tests/funInterface/suspendFunInterfaceConversion.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/suspendConversion/chainedFunSuspendConversionForSimpleExpression.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/suspendConversion/suspendConversionWithFunInterfaces.fir.kt diff --git a/compiler/testData/diagnostics/tests/funInterface/suspendFunInterfaceConversion.fir.kt b/compiler/testData/diagnostics/tests/funInterface/suspendFunInterfaceConversion.fir.kt deleted file mode 100644 index 8c60a7b0cfd..00000000000 --- a/compiler/testData/diagnostics/tests/funInterface/suspendFunInterfaceConversion.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -// !LANGUAGE: +NewInference +SamConversionForKotlinFunctions +SamConversionPerArgument +FunctionalInterfaceConversion -// !DIAGNOSTICS: -UNUSED_PARAMETER -NOTHING_TO_INLINE - -fun interface SuspendRunnable { - suspend fun invoke() -} - -fun run(r: SuspendRunnable) {} - -suspend fun bar() {} - -fun test() { - run(::bar) -} diff --git a/compiler/testData/diagnostics/tests/funInterface/suspendFunInterfaceConversion.kt b/compiler/testData/diagnostics/tests/funInterface/suspendFunInterfaceConversion.kt index 8c60a7b0cfd..0e82d898a1f 100644 --- a/compiler/testData/diagnostics/tests/funInterface/suspendFunInterfaceConversion.kt +++ b/compiler/testData/diagnostics/tests/funInterface/suspendFunInterfaceConversion.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference +SamConversionForKotlinFunctions +SamConversionPerArgument +FunctionalInterfaceConversion // !DIAGNOSTICS: -UNUSED_PARAMETER -NOTHING_TO_INLINE diff --git a/compiler/testData/diagnostics/tests/suspendConversion/chainedFunSuspendConversionForSimpleExpression.fir.kt b/compiler/testData/diagnostics/tests/suspendConversion/chainedFunSuspendConversionForSimpleExpression.fir.kt deleted file mode 100644 index aaf124a2478..00000000000 --- a/compiler/testData/diagnostics/tests/suspendConversion/chainedFunSuspendConversionForSimpleExpression.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -// !LANGUAGE: +SuspendConversion -// !DIAGNOSTICS: -UNUSED_PARAMETER - -fun interface SuspendRunnable { - suspend fun invoke() -} - -fun foo(s: SuspendRunnable) {} - -fun test(f: () -> Unit) { - foo { } - foo(f) -} - diff --git a/compiler/testData/diagnostics/tests/suspendConversion/chainedFunSuspendConversionForSimpleExpression.kt b/compiler/testData/diagnostics/tests/suspendConversion/chainedFunSuspendConversionForSimpleExpression.kt index aaf124a2478..6097f0b75d0 100644 --- a/compiler/testData/diagnostics/tests/suspendConversion/chainedFunSuspendConversionForSimpleExpression.kt +++ b/compiler/testData/diagnostics/tests/suspendConversion/chainedFunSuspendConversionForSimpleExpression.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +SuspendConversion // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/tests/suspendConversion/suspendConversionWithFunInterfaces.fir.kt b/compiler/testData/diagnostics/tests/suspendConversion/suspendConversionWithFunInterfaces.fir.kt deleted file mode 100644 index 9737580400a..00000000000 --- a/compiler/testData/diagnostics/tests/suspendConversion/suspendConversionWithFunInterfaces.fir.kt +++ /dev/null @@ -1,21 +0,0 @@ -// !LANGUAGE: +SuspendConversion -// !DIAGNOSTICS: -UNUSED_PARAMETER - -fun interface SuspendRunnable { - suspend fun invoke() -} - -fun foo1(s: SuspendRunnable) {} -fun bar1() {} - -fun bar2(s: String = ""): Int = 0 - -fun bar3() {} -suspend fun bar3(s: String = ""): Int = 0 - -fun test() { - foo1(::bar1) - foo1(::bar2) - - foo1(::bar3) // Should be ambiguity -} diff --git a/compiler/testData/diagnostics/tests/suspendConversion/suspendConversionWithFunInterfaces.kt b/compiler/testData/diagnostics/tests/suspendConversion/suspendConversionWithFunInterfaces.kt index 9737580400a..fbcbf56ace7 100644 --- a/compiler/testData/diagnostics/tests/suspendConversion/suspendConversionWithFunInterfaces.kt +++ b/compiler/testData/diagnostics/tests/suspendConversion/suspendConversionWithFunInterfaces.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +SuspendConversion // !DIAGNOSTICS: -UNUSED_PARAMETER From e72ddbcbfeb5d3e0f618c09794467168a0545394 Mon Sep 17 00:00:00 2001 From: Jinseong Jeon Date: Tue, 26 Jan 2021 16:03:27 -0800 Subject: [PATCH 183/212] FIR checker: differentiate UNSAFE_CALL from INAPPLICABLE_CANDIDATE To do so, inside the root cause of inapplicable candidate errors, we will record expected/actual type of receiver, if any. That will help identifying inapplicable calls on nullable receiver. --- .../testData/resolve/cfg/jumps.kt | 2 +- .../expresssions/syntheticSmartCast.kt | 2 +- .../testData/resolve/smartcasts/bangbang.kt | 6 +- .../smartcasts/booleans/equalsToBoolean.kt | 16 +- .../booleans/jumpFromRhsOfOperator.kt | 12 +- .../boundSmartcastsInBranches.kt | 8 +- .../resolve/smartcasts/equalsAndIdentity.kt | 8 +- .../resolve/smartcasts/nullability.kt | 56 ++-- .../resolve/smartcasts/orInWhenBranch.kt | 2 +- .../safeCalls/safeCallAndEqualityToBool.kt | 8 +- .../resolve/smartcasts/safeCalls/safeCalls.kt | 6 +- .../smartcasts/variables/delayedAssignment.kt | 2 +- .../variables/smartcastAfterReassignment.kt | 2 +- .../contracts/fromLibrary/notIsNullOrEmpty.kt | 2 +- .../fromSource/good/returnsImplies/eqNotEq.kt | 2 +- .../good/returnsImplies/receivers.kt | 2 +- .../FirDestructuringDeclarationChecker.kt | 20 +- .../ErrorNodeDiagnosticCollectorComponent.kt | 33 +- .../diagnostics/FirDefaultErrorMessages.kt | 19 ++ .../diagnostics/FirDiagnosticRenderers.kt | 7 +- .../fir/analysis/diagnostics/FirErrors.kt | 13 +- .../kotlin/fir/resolve/calls/Arguments.kt | 6 +- .../fir/resolve/calls/ResolutionDiagnostic.kt | 6 +- .../fir/resolve/calls/ResolutionStages.kt | 8 +- .../fir/resolve/diagnostics/FirDiagnostics.kt | 5 +- .../diagnostics/tests/BreakContinue.fir.kt | 6 +- .../diagnostics/tests/Nullability.fir.kt | 2 +- .../basicCollectionLiterals.fir.kt | 8 +- ...LoopWithExtensionIteratorOnNullable.fir.kt | 6 +- .../forLoopWithNullableRange.fir.kt | 2 +- .../forWithNullableIterator.fir.kt | 2 +- .../extensionComponentsOnNullable.fir.kt | 4 +- .../uninitializedValNullability.fir.kt | 2 +- .../UnaryExpression.fir.kt | 6 +- .../MultiDeclarationErrors.fir.kt | 2 +- .../namedFunAsLastExpressionInBlock.fir.kt | 2 +- .../extensions/ExtensionFunctions.fir.kt | 2 +- .../tests/extensions/kt1875.fir.kt | 6 +- .../throwOutCandidatesByReceiver.fir.kt | 6 +- .../complexInference.fir.kt | 12 +- .../redeclaration.fir.kt | 2 +- .../destructuringInLambdas/simple.fir.kt | 4 +- .../unusedParameters.fir.kt | 4 +- .../implicitArguments/fromSuperClasses.fir.kt | 4 +- .../fromSuperClassesLocal.fir.kt | 4 +- .../fromSuperClassesLocalInsideInner.fir.kt | 4 +- .../fromSuperClassesTransitive.fir.kt | 2 +- .../lambdaWithVariableAndNothing.fir.kt | 8 +- .../tests/inference/regressions/kt2842.fir.kt | 6 +- .../properties/fieldPropertyOverloads.fir.kt | 8 +- .../fieldPropertyOverloadsDisabled.fir.kt | 8 +- .../fieldPropertyOverloadsNI.fir.kt | 8 +- .../j+k/sam/enhancedSamConstructor.fir.kt | 4 +- .../tests/j+k/selectMoreSpecific.fir.kt | 4 +- .../InfixCallNullability.fir.kt | 26 +- .../QualifiedExpressionNullability.fir.kt | 6 +- .../ReceiverNullability.fir.kt | 12 +- .../nullabilityAndSmartCasts/kt1270.fir.kt | 2 +- .../nullabilityAndSmartCasts/kt2125.fir.kt | 2 +- .../noAnnotationInClassPath.fir.kt | 2 +- .../nullabilityWarnings/arithmetic.fir.kt | 4 +- .../nullabilityWarnings/array.fir.kt | 4 +- .../nullabilityWarnings/conditions.fir.kt | 2 +- .../delegatedProperties.fir.kt | 2 +- .../derefenceExtension.fir.kt | 4 +- .../derefenceMember.fir.kt | 4 +- .../nullabilityWarnings/for.fir.kt | 2 +- .../nullabilityWarnings/invoke.fir.kt | 2 +- .../nullabilityWarnings/kt6829.fir.kt | 2 +- .../multiDeclaration.fir.kt | 32 -- .../nullabilityWarnings/multiDeclaration.kt | 1 + .../nullabilityWarnings/primitiveArray.fir.kt | 4 +- .../overriddenExtensions.fir.kt | 4 +- .../primaryConstructorParameter.fir.kt | 2 +- .../tests/regressions/kt12898.fir.kt | 2 +- .../tests/regressions/kt282.fir.kt | 2 +- .../tests/regressions/kt557.fir.kt | 2 +- .../invoke/errors/unsafeCallWithInvoke.fir.kt | 4 +- .../invoke/implicitInvokeAfterSafeCall.fir.kt | 12 +- .../resolve/invoke/invokeAndSmartCast.fir.kt | 4 +- .../tests/resolve/invoke/kt30695_2.fir.kt | 8 +- .../diagnostics/tests/safeCall.fir.kt | 4 +- .../samConversions/OverloadPriority.fir.kt | 4 +- .../samConversions/OverloadPriorityKT.fir.kt | 4 +- .../tests/smartCasts/alwaysNull.fir.kt | 2 +- .../smartCasts/castchecks/basicOff.fir.kt | 6 +- .../smartCasts/castchecks/basicOn.fir.kt | 6 +- .../smartCasts/castchecks/variables.fir.kt | 18 +- .../smartCasts/comparisonUnderAnd.fir.kt | 24 +- .../tests/smartCasts/complexComparison.fir.kt | 12 +- .../complexConditionsWithExcl.fir.kt | 20 +- .../tests/smartCasts/elvis/basicOff.fir.kt | 8 +- .../tests/smartCasts/elvis/basicOn.fir.kt | 8 +- .../tests/smartCasts/elvisExclExcl.fir.kt | 2 +- .../tests/smartCasts/elvisNothingRHS.fir.kt | 2 +- .../smartCasts/enumEntryMembers_after.fir.kt | 2 +- .../smartCasts/enumEntryMembers_before.fir.kt | 2 +- .../tests/smartCasts/exclUnderAnd.fir.kt | 8 +- .../tests/smartCasts/extensionSafeCall.fir.kt | 2 +- .../tests/smartCasts/fieldExclExcl.fir.kt | 2 +- .../tests/smartCasts/fieldPlus.fir.kt | 2 +- .../tests/smartCasts/inference/kt39010.fir.kt | 2 +- .../unstableSmartCast.fir.kt | 2 +- .../tests/smartCasts/kt32358_2.fir.kt | 2 +- .../tests/smartCasts/kt32358_3.fir.kt | 2 +- .../tests/smartCasts/level_1_0.fir.kt | 2 +- .../WhileTrueWithBreakInIfCondition.fir.kt | 2 +- .../assignElvisIfBreakInsideWhileTrue.fir.kt | 4 +- .../loops/assignWhenInsideWhileTrue.fir.kt | 2 +- .../callBreakBetweenInsideDoWhile.fir.kt | 4 +- .../loops/callBreakFirstInsideDoWhile.fir.kt | 4 +- .../loops/callBreakInsideDoWhile.fir.kt | 2 +- .../loops/callBreakSecondInsideDoWhile.fir.kt | 2 +- .../loops/callBreakThirdInsideDoWhile.fir.kt | 2 +- .../smartCasts/loops/doWhileEarlyBreak.fir.kt | 2 +- .../loops/doWhileInConditionWithBreak.fir.kt | 2 +- .../loops/doWhileNotNullBreak.fir.kt | 2 +- .../loops/doWhileNullWithBreak.fir.kt | 2 +- .../loops/elvisBreakInsideDoWhile.fir.kt | 2 +- .../loops/elvisIfBreakInsideWhileTrue.fir.kt | 4 +- .../elvisLeftBreakInsideWhileTrue.fir.kt | 4 +- .../loops/ifBreakAssignInsideDoWhile.fir.kt | 2 +- .../loops/ifBreakAssignInsideWhileTrue.fir.kt | 2 +- .../loops/ifBreakExprInsideWhileTrue.fir.kt | 2 +- .../leftElvisBreakInsideWhileTrue.fir.kt | 2 +- .../loops/nestedLoopsWithLongBreak.fir.kt | 2 +- .../loops/plusAssignWhenInsideDoWhile.fir.kt | 2 +- .../loops/whenInsideWhileTrue.fir.kt | 2 +- .../loops/whileNullWithBreak.fir.kt | 2 +- .../tests/smartCasts/loops/whileSimple.fir.kt | 2 +- .../smartCasts/loops/whileTrivial.fir.kt | 2 +- .../loops/whileTrueBreakReturn.fir.kt | 2 +- .../loops/whileTrueEarlyBreak.fir.kt | 2 +- ...eWithAssertInConditionAndBreakAfter.fir.kt | 4 +- ...WithAssertInConditionAndBreakBefore.fir.kt | 4 +- .../smartCasts/objectLiterals/kt7110.fir.kt | 2 +- .../tests/smartCasts/openInSealed.fir.kt | 2 +- .../ownerDeclaresBothModifies.fir.kt | 2 +- .../smartCasts/publicVals/customGetter.fir.kt | 2 +- .../tests/smartCasts/publicVals/open.fir.kt | 2 +- .../tests/smartCasts/publicVals/var.fir.kt | 4 +- .../smartCasts/safecalls/argument.fir.kt | 2 +- .../safecalls/chainMixedUnsafe.fir.kt | 2 +- .../smartCasts/safecalls/doubleCall.fir.kt | 2 +- .../smartCasts/safecalls/innerReceiver.fir.kt | 2 +- .../smartCasts/safecalls/insideIfExpr.fir.kt | 8 +- .../safecalls/nullableReceiver.fir.kt | 4 +- .../nullableReceiverInLongChain.fir.kt | 12 +- .../nullableReceiverWithFlexible.fir.kt | 2 +- .../safeAccessReceiverNotNull.fir.kt | 8 +- .../tests/smartCasts/safecalls/simple.fir.kt | 2 +- .../tests/smartCasts/safecalls/twoArgs.fir.kt | 2 +- .../tests/smartCasts/smartCastOnWhen.fir.kt | 2 +- ...castOnSameFieldOfDifferentInstances.fir.kt | 2 +- .../tests/smartCasts/unstableToStable.fir.kt | 8 +- .../variables/lambdaBetweenArguments.fir.kt | 2 +- .../smartCasts/varnotnull/assignment.fir.kt | 4 +- .../varnotnull/boundInitializerWrong.fir.kt | 4 +- .../varnotnull/initInTryReturnInCatch.fir.kt | 6 +- .../varnotnull/initialization.fir.kt | 4 +- .../smartCasts/varnotnull/nestedWhile.fir.kt | 2 +- .../varnotnull/plusplusMinusminus.fir.kt | 2 +- .../postfixNullableIncrement.fir.kt | 2 +- .../prefixNullableClassIncrement.fir.kt | 2 +- .../varnotnull/prefixNullableIncrement.fir.kt | 2 +- .../varnotnull/setNotNullInTry.fir.kt | 2 +- .../smartCasts/varnotnull/setNullInTry.fir.kt | 2 +- .../varnotnull/setNullInTryFinally.fir.kt | 2 +- .../varnotnull/setNullInTryUnsound.fir.kt | 2 +- .../varnotnull/unnecessaryWithMap.fir.kt | 2 +- .../smartCasts/varnotnull/varNull.fir.kt | 2 +- .../javaProperties/TypeAnnotation.fir.kt | 4 +- .../samAdapters/ReturnTypeAnnotation.fir.kt | 2 +- .../forEachRemainingNullability.fir.kt | 2 +- .../notConsideredMethod.fir.kt | 2 +- .../inferenceForSignedAndUnsignedTypes.fir.kt | 2 +- ...ResolutionForSignedAndUnsignedTypes.fir.kt | 2 +- .../capturingInInitializer.fir.kt | 4 +- .../jumpoutInInitializer.fir.kt | 6 +- ...rtCastOnValueBoundToSubjectVariable.fir.kt | 4 +- .../contracts/fromStdlib/isNullOrBlank.fir.kt | 4 +- .../contracts/fromStdlib/isNullOrEmpty.fir.kt | 4 +- .../smartcasts/extensionReceiver.fir.kt | 4 +- .../smartcasts/extensionReceiver_after.fir.kt | 4 +- ...nullabilitySmartcastWhenNullability.fir.kt | 12 +- .../operatorsTests/equalsOperator.fir.kt | 12 +- .../contracts/smartcasts/receiver.fir.kt | 6 +- .../valueOfContractedFunctionIngored.fir.kt | 2 +- .../testsWithStdLib/coroutines/kt36947.fir.kt | 4 +- .../restrictSuspension/outerYield_1_3.fir.kt | 2 +- .../resolve/samAgainstFunctionalType.fir.kt | 4 +- .../resolve/samOverloadsWithGenerics.fir.kt | 4 +- ...loadsWithGenericsWithoutRefinedSams.fir.kt | 4 +- .../resolve/samOverloadsWithKtFunction.fir.kt | 2 +- ...adsWithKtFunctionWithoutRefinedSams.fir.kt | 2 +- .../smartcasts/letChangesToNotNull.fir.kt | 2 +- .../smartcasts/letChangesToNullComplex.fir.kt | 2 +- .../smartcasts/withChangesToNull.fir.kt | 2 +- .../testsWithStdLib/tryCatch/assignTry.fir.kt | 14 +- .../tryCatch/boundedSmartcasts.fir.kt | 20 +- .../tryCatch/correctSmartcasts.fir.kt | 6 +- .../tryCatch/correctSmartcasts_after.fir.kt | 6 +- .../tryCatch/falsePositiveSmartcasts.fir.kt | 26 +- .../falsePositiveSmartcasts_after.fir.kt | 26 +- .../p-1/neg/2.3.fir.kt | 8 +- .../p-1/neg/2.4.fir.kt | 12 +- .../p-4/neg/1.1.fir.kt | 2 +- .../p-4/neg/1.1.fir.kt | 2 +- .../p-1/pos/2.1.fir.kt | 2 +- .../p-1/pos/2.1.fir.kt | 2 +- .../statements/assignments/p-2/neg/1.2.fir.kt | 6 +- .../contracts/analysis/common/neg/1.fir.kt | 6 +- .../analysis/smartcasts/neg/1.fir.kt | 38 +-- .../analysis/smartcasts/neg/10.fir.kt | 22 +- .../analysis/smartcasts/neg/15.fir.kt | 2 +- .../analysis/smartcasts/neg/4.fir.kt | 16 +- .../analysis/smartcasts/neg/6.fir.kt | 28 +- .../analysis/smartcasts/neg/7.fir.kt | 20 +- .../analysis/smartcasts/neg/8.fir.kt | 8 +- .../analysis/smartcasts/neg/9.fir.kt | 8 +- .../analysis/smartcasts/pos/12.fir.kt | 4 +- .../analysis/smartcasts/pos/14.fir.kt | 6 +- .../analysis/smartcasts/pos/6.fir.kt | 30 +- .../analysis/smartcasts/pos/8.fir.kt | 4 +- .../diagnostics/notLinked/dfa/neg/1.fir.kt | 134 ++++---- .../diagnostics/notLinked/dfa/neg/11.fir.kt | 8 +- .../diagnostics/notLinked/dfa/neg/12.fir.kt | 6 +- .../diagnostics/notLinked/dfa/neg/13.fir.kt | 4 +- .../diagnostics/notLinked/dfa/neg/14.fir.kt | 8 +- .../diagnostics/notLinked/dfa/neg/15.fir.kt | 10 +- .../diagnostics/notLinked/dfa/neg/19.fir.kt | 40 +-- .../diagnostics/notLinked/dfa/neg/20.fir.kt | 40 +-- .../diagnostics/notLinked/dfa/neg/21.fir.kt | 2 +- .../diagnostics/notLinked/dfa/neg/22.fir.kt | 12 +- .../diagnostics/notLinked/dfa/neg/23.fir.kt | 2 +- .../diagnostics/notLinked/dfa/neg/24.fir.kt | 12 +- .../diagnostics/notLinked/dfa/neg/26.fir.kt | 26 +- .../diagnostics/notLinked/dfa/neg/27.fir.kt | 12 +- .../diagnostics/notLinked/dfa/neg/29.fir.kt | 16 +- .../diagnostics/notLinked/dfa/neg/30.fir.kt | 4 +- .../diagnostics/notLinked/dfa/neg/34.fir.kt | 40 +-- .../diagnostics/notLinked/dfa/neg/35.fir.kt | 18 +- .../diagnostics/notLinked/dfa/neg/37.fir.kt | 16 +- .../diagnostics/notLinked/dfa/neg/38.fir.kt | 22 +- .../diagnostics/notLinked/dfa/neg/39.fir.kt | 24 +- .../diagnostics/notLinked/dfa/neg/4.fir.kt | 76 ++--- .../diagnostics/notLinked/dfa/neg/41.fir.kt | 10 +- .../diagnostics/notLinked/dfa/neg/43.fir.kt | 6 +- .../diagnostics/notLinked/dfa/neg/45.fir.kt | 2 +- .../diagnostics/notLinked/dfa/neg/6.fir.kt | 8 +- .../diagnostics/notLinked/dfa/neg/7.fir.kt | 8 +- .../diagnostics/notLinked/dfa/neg/8.fir.kt | 14 +- .../diagnostics/notLinked/dfa/neg/9.fir.kt | 2 +- .../diagnostics/notLinked/dfa/pos/13.fir.kt | 32 +- .../diagnostics/notLinked/dfa/pos/16.fir.kt | 114 +++---- .../diagnostics/notLinked/dfa/pos/17.fir.kt | 60 ++-- .../diagnostics/notLinked/dfa/pos/18.fir.kt | 66 ++-- .../diagnostics/notLinked/dfa/pos/2.fir.kt | 108 +++---- .../diagnostics/notLinked/dfa/pos/25.fir.kt | 4 +- .../diagnostics/notLinked/dfa/pos/26.fir.kt | 4 +- .../diagnostics/notLinked/dfa/pos/27.fir.kt | 4 +- .../diagnostics/notLinked/dfa/pos/30.fir.kt | 50 +-- .../diagnostics/notLinked/dfa/pos/31.fir.kt | 34 +- .../diagnostics/notLinked/dfa/pos/35.fir.kt | 6 +- .../diagnostics/notLinked/dfa/pos/37.fir.kt | 18 +- .../diagnostics/notLinked/dfa/pos/40.fir.kt | 8 +- .../diagnostics/notLinked/dfa/pos/46.fir.kt | 12 +- .../diagnostics/notLinked/dfa/pos/52.fir.kt | 2 +- .../diagnostics/notLinked/dfa/pos/59.fir.kt | 2 +- .../diagnostics/notLinked/dfa/pos/6.fir.kt | 294 +++++++++--------- .../diagnostics/notLinked/dfa/pos/61.fir.kt | 2 +- .../diagnostics/notLinked/dfa/pos/66.fir.kt | 12 +- .../diagnostics/notLinked/dfa/pos/68.fir.kt | 12 +- .../diagnostics/notLinked/dfa/pos/69.fir.kt | 8 +- .../diagnostics/notLinked/dfa/pos/7.fir.kt | 74 ++--- 275 files changed, 1426 insertions(+), 1388 deletions(-) delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/multiDeclaration.fir.kt diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/jumps.kt b/compiler/fir/analysis-tests/testData/resolve/cfg/jumps.kt index a5dc4b78cb6..47f1261ef41 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/jumps.kt +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/jumps.kt @@ -15,7 +15,7 @@ fun test_2(x: Int?) { } else { x } - y.inc() + y.inc() } fun test_3(x: Int?) { diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/syntheticSmartCast.kt b/compiler/fir/analysis-tests/testData/resolve/expresssions/syntheticSmartCast.kt index f91f7422ce1..53d7578055b 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/syntheticSmartCast.kt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/syntheticSmartCast.kt @@ -34,7 +34,7 @@ fun test3(x: AnotherClass?) { fun test4(x: SomeClass?) { val bar = x?.bar if (bar != null) { - x.bar.length + x.bar.length } } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/bangbang.kt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/bangbang.kt index b861d37433d..191e6c3c1fc 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/bangbang.kt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/bangbang.kt @@ -26,7 +26,7 @@ fun test_3(a: A?, b: Boolean) { if (b && a!!.foo()) { a.foo() // OK } - a.foo() // Bad + a.foo() // Bad } fun test_4(a: A?, b: Boolean) { @@ -38,9 +38,9 @@ fun test_4(a: A?, b: Boolean) { fun test_5(a: A?, b: Boolean) { if (b || a!!.foo()) { - a.foo() + a.foo() } - a.foo() + a.foo() } fun test_6(x: X) { diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/equalsToBoolean.kt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/equalsToBoolean.kt index 97732d845cd..0633a92d865 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/equalsToBoolean.kt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/equalsToBoolean.kt @@ -8,13 +8,13 @@ fun test_1(b: Boolean?) { if ((b == true) == true) { b.not() // OK } else { - b.not() // Bad + b.not() // Bad } } fun test_2(b: Boolean?) { if ((b == true) != true) { - b.not() // Bad + b.not() // Bad } else { b.not() // OK } @@ -22,7 +22,7 @@ fun test_2(b: Boolean?) { fun test_3(b: Boolean?) { if ((b == true) == false) { - b.not() // Bad + b.not() // Bad } else { b.not() // OK } @@ -32,13 +32,13 @@ fun test_4(b: Boolean?) { if ((b == true) != false) { b.not() // OK } else { - b.not() // Bad + b.not() // Bad } } fun test_5(b: Boolean?) { if ((b != true) == true) { - b.not() // Bad + b.not() // Bad } else { b.not() // OK } @@ -48,7 +48,7 @@ fun test_6(b: Boolean?) { if ((b != true) != true) { b.not() // OK } else { - b.not() // Bad + b.not() // Bad } } @@ -56,13 +56,13 @@ fun test_7(b: Boolean?) { if ((b != true) == false) { b.not() // OK } else { - b.not() // Bad + b.not() // Bad } } fun test_8(b: Boolean?) { if ((b != true) != false) { - b.not() // Bad + b.not() // Bad } else { b.not() // OK } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/jumpFromRhsOfOperator.kt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/jumpFromRhsOfOperator.kt index be91a791bed..1a3e930d382 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/jumpFromRhsOfOperator.kt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/jumpFromRhsOfOperator.kt @@ -34,24 +34,24 @@ fun test_4(a: A?) { fun test_5(a: A?) { a == null || throw Exception() - a.foo() + a.foo() } fun teat_6(a: A?) { a != null && throw Exception() - a.foo() + a.foo() } fun test_7(a: A?) { if (a == null || throw Exception()) { - a.foo() + a.foo() } - a.foo() + a.foo() } fun test_8(a: A?) { if (a != null && throw Exception()) { - a.foo() + a.foo() } - a.foo() + a.foo() } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.kt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.kt index 88992851c5c..799697c6597 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.kt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.kt @@ -104,18 +104,18 @@ fun test_7() { if (x != null) { x.length // OK - y.length // Bad + y.length // Bad z.length // OK } if (y != null) { - x.length // Bad + x.length // Bad y.length // OK - z.length // Bad + z.length // Bad } if (z != null) { x.length // OK - y.length // Bad + y.length // Bad z.length // OK } } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/equalsAndIdentity.kt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/equalsAndIdentity.kt index e54a97ef7fd..7f20364c055 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/equalsAndIdentity.kt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/equalsAndIdentity.kt @@ -16,12 +16,12 @@ fun test_1(x: A, y: A?) { fun test_2(x: A?, y: A?) { if (x == y) { - x.foo() - y.foo() + x.foo() + y.foo() } if (x === y) { - x.foo() - y.foo() + x.foo() + y.foo() } } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/nullability.kt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/nullability.kt index a0f9eb98439..135353bff85 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/nullability.kt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/nullability.kt @@ -39,18 +39,18 @@ fun test_1(x: A?) { if (x != null) { x.foo() } else { - x.foo() + x.foo() } - x.foo() + x.foo() } fun test_2(x: A?) { if (x == null) { - x.foo() + x.foo() } else { x.foo() } - x.foo() + x.foo() } fun test_3(x: A?) { @@ -67,8 +67,8 @@ fun test_5(q: Q?) { // `q.data` is a property that has an open getter, so we can NOT smartcast it to non-nullable MyData. if (q?.data?.s?.inc() != null) { q.data // good - q.data.s // should be bad - q.data.s.inc() // should be bad + q.data.s // should be bad + q.data.s.inc() // should be bad } } @@ -76,15 +76,15 @@ fun test_6(q: Q?) { // `q.data` is a property that has an open getter, so we can NOT smartcast it to non-nullable MyData. q?.data?.s?.inc() ?: return q.data // good - q.data.s // should be bad - q.data.s.inc() // should be bad + q.data.s // should be bad + q.data.s.inc() // should be bad } fun test_7(q: Q?) { if (q?.fdata()?.fs()?.inc() != null) { q.fdata() // good - q.fdata().fs() // bad - q.fdata().fs().inc() // bad + q.fdata().fs() // bad + q.fdata().fs().inc() // bad } } @@ -98,44 +98,44 @@ fun test_9(a: Int, b: Int?) { if (a == b) { b.inc() } - b.inc() + b.inc() if (a === b) { b.inc() } - b.inc() + b.inc() if (b == a) { b.inc() } - b.inc() + b.inc() if (b === a) { b.inc() } - b.inc() + b.inc() } fun test_10(a: Int?, b: Int?) { if (a == b) { - b.inc() + b.inc() } - b.inc() + b.inc() if (a === b) { - b.inc() + b.inc() } - b.inc() + b.inc() if (b == a) { - b.inc() + b.inc() } - b.inc() + b.inc() if (b === a) { - b.inc() + b.inc() } - b.inc() + b.inc() } fun test_11(q: QImpl?, q2: QImpl) { @@ -148,8 +148,8 @@ fun test_11(q: QImpl?, q2: QImpl) { // Smartcasting of `q.data` should have no effect on `q2.data`. // Issue: Smartcasting of QImpl.data affects all instances q2.data - q2.data.s // should be bad - q2.data.s.inc() // should be bad + q2.data.s // should be bad + q2.data.s.inc() // should be bad if (q2.data != null) { q2.data.s @@ -162,8 +162,8 @@ fun test_12(q: QImplWithCustomGetter?) { // `q.data` is a property that has an open getter, so we can NOT smartcast it to non-nullable MyData. if (q?.data?.s?.inc() != null) { q.data // good - q.data.s // should be bad - q.data.s.inc() // should be bad + q.data.s // should be bad + q.data.s.inc() // should be bad } } @@ -171,7 +171,7 @@ fun test_13(q: QImplMutable?) { // `q.data` is a property that is mutable, so we can NOT smartcast it to non-nullable MyData. if (q?.data?.s?.inc() != null) { q.data // good - q.data.s // should be bad - q.data.s.inc() // should be bad + q.data.s // should be bad + q.data.s.inc() // should be bad } } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/orInWhenBranch.kt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/orInWhenBranch.kt index 9b2ad3bab6f..f8fa330fba3 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/orInWhenBranch.kt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/orInWhenBranch.kt @@ -22,6 +22,6 @@ fun test_3(a: Any?, b: Boolean) { fun test_4(a: Any?, b: Boolean) { if (a is String || b) { - a.foo() // Should be Bad + a.foo() // Should be Bad } } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCallAndEqualityToBool.kt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCallAndEqualityToBool.kt index 293db6f24d0..0669629735d 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCallAndEqualityToBool.kt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCallAndEqualityToBool.kt @@ -5,7 +5,7 @@ fun test_1(s: String?) { if (s?.check() == true) { s.length // Should be OK } else { - s.length // Should be bad + s.length // Should be bad } } @@ -13,13 +13,13 @@ fun test_2(s: String?) { if (s?.check() == false) { s.length // Should be OK } else { - s.length // Should be bad + s.length // Should be bad } } fun test_3(s: String?) { if (s?.check() != true) { - s.length // Should be bad + s.length // Should be bad } else { s.length // Should be OK } @@ -27,7 +27,7 @@ fun test_3(s: String?) { fun test_4(s: String?) { if (s?.check() != false) { - s.length // Should be bad + s.length // Should be bad } else { s.length // Should be OK } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCalls.kt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCalls.kt index 455c59ab709..4378b7ecc59 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCalls.kt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCalls.kt @@ -5,7 +5,7 @@ fun String.let(block: () -> Unit) {} fun test(x: String?) { x?.foo(x.length == 1) - x.length + x.length } interface A { @@ -27,12 +27,12 @@ fun test_3(x: Any) { fun test_4(x: A?) { x?.id()?.bool() - x.id() + x.id() } fun Any?.boo(b: Boolean) {} fun test_5(x: A?) { x?.let { return }?.boo(x.bool()) - x.id() + x.id() } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/delayedAssignment.kt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/delayedAssignment.kt index c911291afd8..7c160fba45c 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/delayedAssignment.kt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/delayedAssignment.kt @@ -11,5 +11,5 @@ fun test(b: Boolean) { } else { a = null } - a.foo() + a.foo() } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/smartcastAfterReassignment.kt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/smartcastAfterReassignment.kt index 056a5620c9c..f684cc63a20 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/smartcastAfterReassignment.kt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/smartcastAfterReassignment.kt @@ -18,5 +18,5 @@ fun test_3() { x = "" x.length x = null - x.length + x.length } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromLibrary/notIsNullOrEmpty.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromLibrary/notIsNullOrEmpty.kt index 4a615ff5aa3..e6abe4d7c53 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromLibrary/notIsNullOrEmpty.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromLibrary/notIsNullOrEmpty.kt @@ -7,7 +7,7 @@ fun test_1(s: String?) { fun test_2(s: String?) { // contracts related if (s.isNullOrEmpty()) { - s.length // Should be bad + s.length // Should be bad } else { s.length // Should be OK } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/eqNotEq.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/eqNotEq.kt index af95ad9668c..2012d4f0aec 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/eqNotEq.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/eqNotEq.kt @@ -21,7 +21,7 @@ fun test_1(x: String?) { if (checkNotNull(x)) { x.length // OK } else { - x.length // Error + x.length // Error } } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/receivers.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/receivers.kt index 0e12db35591..e6cf24145ab 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/receivers.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/receivers.kt @@ -27,7 +27,7 @@ fun test_3(x: A?) { with(x) { myRequireNotNull() } - x.foo() + x.foo() } fun test_4(x: A?) { diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirDestructuringDeclarationChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirDestructuringDeclarationChecker.kt index a16123ea4cd..179cd7a2ff4 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirDestructuringDeclarationChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirDestructuringDeclarationChecker.kt @@ -12,6 +12,7 @@ import org.jetbrains.kotlin.fir.analysis.checkers.extended.report import org.jetbrains.kotlin.fir.analysis.diagnostics.DiagnosticReporter import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors import org.jetbrains.kotlin.fir.declarations.FirProperty +import org.jetbrains.kotlin.fir.declarations.FirSimpleFunction import org.jetbrains.kotlin.fir.declarations.FirValueParameter import org.jetbrains.kotlin.fir.declarations.FirVariable import org.jetbrains.kotlin.fir.diagnostics.ConeSimpleDiagnostic @@ -20,8 +21,12 @@ import org.jetbrains.kotlin.fir.expressions.* import org.jetbrains.kotlin.fir.references.FirErrorNamedReference import org.jetbrains.kotlin.fir.references.FirResolvedNamedReference import org.jetbrains.kotlin.fir.resolve.diagnostics.ConeAmbiguityError +import org.jetbrains.kotlin.fir.resolve.diagnostics.ConeInapplicableCandidateError import org.jetbrains.kotlin.fir.resolve.diagnostics.ConeUnresolvedNameError import org.jetbrains.kotlin.fir.symbols.impl.FirVariableSymbol +import org.jetbrains.kotlin.fir.types.ConeKotlinType +import org.jetbrains.kotlin.fir.types.coneTypeSafe +import org.jetbrains.kotlin.fir.types.isNullable object FirDestructuringDeclarationChecker : FirPropertyChecker() { override fun check(declaration: FirProperty, context: CheckerContext, reporter: DiagnosticReporter) { @@ -65,8 +70,8 @@ object FirDestructuringDeclarationChecker : FirPropertyChecker() { val originalDestructuringDeclarationOrInitializerSource = originalDestructuringDeclarationOrInitializer.source ?: return val originalDestructuringDeclarationType = when (originalDestructuringDeclarationOrInitializer) { - is FirVariable<*> -> originalDestructuringDeclarationOrInitializer.returnTypeRef - is FirExpression -> originalDestructuringDeclarationOrInitializer.typeRef + is FirVariable<*> -> originalDestructuringDeclarationOrInitializer.returnTypeRef.coneTypeSafe() + is FirExpression -> originalDestructuringDeclarationOrInitializer.typeRef.coneTypeSafe() else -> null } ?: return @@ -89,7 +94,16 @@ object FirDestructuringDeclarationChecker : FirPropertyChecker() { ) ) } - // TODO: COMPONENT_FUNCTION_ON_NULLABLE + is ConeInapplicableCandidateError -> { + if (originalDestructuringDeclarationType.isNullable) { + reporter.report( + FirErrors.COMPONENT_FUNCTION_ON_NULLABLE.on( + originalDestructuringDeclarationOrInitializerSource, + (diagnostic.candidateSymbol.fir as FirSimpleFunction).name + ) + ) + } + } // TODO: COMPONENT_FUNCTION_RETURN_TYPE_MISMATCH } } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/collectors/components/ErrorNodeDiagnosticCollectorComponent.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/collectors/components/ErrorNodeDiagnosticCollectorComponent.kt index 33a800bf918..939a841d41f 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/collectors/components/ErrorNodeDiagnosticCollectorComponent.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/collectors/components/ErrorNodeDiagnosticCollectorComponent.kt @@ -10,9 +10,7 @@ import org.jetbrains.kotlin.fir.FirFakeSourceElementKind import org.jetbrains.kotlin.fir.FirSourceElement import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext import org.jetbrains.kotlin.fir.analysis.collectors.AbstractDiagnosticCollector -import org.jetbrains.kotlin.fir.analysis.diagnostics.DiagnosticReporter -import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticFactory0 -import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors +import org.jetbrains.kotlin.fir.analysis.diagnostics.* import org.jetbrains.kotlin.fir.declarations.FirErrorFunction import org.jetbrains.kotlin.fir.diagnostics.* import org.jetbrains.kotlin.fir.diagnostics.DiagnosticKind.* @@ -20,8 +18,9 @@ import org.jetbrains.kotlin.fir.expressions.FirErrorExpression import org.jetbrains.kotlin.fir.expressions.FirErrorLoop import org.jetbrains.kotlin.fir.expressions.FirErrorResolvedQualifier import org.jetbrains.kotlin.fir.references.FirErrorNamedReference +import org.jetbrains.kotlin.fir.resolve.calls.InapplicableWrongReceiver import org.jetbrains.kotlin.fir.resolve.diagnostics.* -import org.jetbrains.kotlin.fir.types.FirErrorTypeRef +import org.jetbrains.kotlin.fir.types.* import org.jetbrains.kotlin.resolve.calls.tower.isSuccess import org.jetbrains.kotlin.utils.addToStdlib.safeAs @@ -62,7 +61,10 @@ class ErrorNodeDiagnosticCollectorComponent(collector: AbstractDiagnosticCollect // Will be handled by [FirDestructuringDeclarationChecker] if (source.elementType == KtNodeTypes.DESTRUCTURING_DECLARATION_ENTRY) { // TODO: if all diagnostics are supported, we don't need the following check, and will bail out based on element type. - if (diagnostic is ConeUnresolvedNameError || diagnostic is ConeAmbiguityError) { + if (diagnostic is ConeUnresolvedNameError || + diagnostic is ConeAmbiguityError || + diagnostic is ConeInapplicableCandidateError + ) { return } } @@ -72,7 +74,7 @@ class ErrorNodeDiagnosticCollectorComponent(collector: AbstractDiagnosticCollect is ConeUnresolvedSymbolError -> FirErrors.UNRESOLVED_REFERENCE.on(source, diagnostic.classId.asString()) is ConeUnresolvedNameError -> FirErrors.UNRESOLVED_REFERENCE.on(source, diagnostic.name.asString()) is ConeHiddenCandidateError -> FirErrors.HIDDEN.on(source, diagnostic.candidateSymbol) - is ConeInapplicableCandidateError -> FirErrors.INAPPLICABLE_CANDIDATE.on(source, diagnostic.candidateSymbol) + is ConeInapplicableCandidateError -> mapInapplicableCandidateError(diagnostic, source) is ConeAmbiguityError -> if (!diagnostic.applicability.isSuccess) { FirErrors.NONE_APPLICABLE.on(source, diagnostic.candidates) } else { @@ -98,6 +100,25 @@ class ErrorNodeDiagnosticCollectorComponent(collector: AbstractDiagnosticCollect reporter.report(coneDiagnostic) } + private fun mapInapplicableCandidateError( + diagnostic: ConeInapplicableCandidateError, + source: FirSourceElement, + ): FirDiagnostic<*> { + // TODO: Need to distinguish SMARTCAST_IMPOSSIBLE + // TODO: handle other UNSAFE_* variants: invoke, infix, operator + val rootCause = diagnostic.diagnostics.find { it.applicability == diagnostic.applicability } + return if (rootCause != null && + rootCause is InapplicableWrongReceiver && + rootCause.actualType?.isNullable == true && + (rootCause.expectedType == null || !rootCause.expectedType!!.isMarkedNullable) + ) { + // TODO: report on call operation node, e.g., x.length instead of x.length + FirErrors.UNSAFE_CALL.on(source, rootCause.actualType!!) + } else { + FirErrors.INAPPLICABLE_CANDIDATE.on(source, diagnostic.candidateSymbol) + } + } + private fun ConeSimpleDiagnostic.getFactory(): FirDiagnosticFactory0 { @Suppress("UNCHECKED_CAST") return when (kind) { diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt index 80afdfd30a4..4da06ddfe13 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt @@ -37,6 +37,7 @@ import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.CAN_BE_VAL import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.CLASS_IN_SUPERTYPE_FOR_ENUM import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.COMPONENT_FUNCTION_AMBIGUITY import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.COMPONENT_FUNCTION_MISSING +import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.COMPONENT_FUNCTION_ON_NULLABLE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.CONFLICTING_OVERLOADS import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.CONFLICTING_PROJECTION import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.CONSTRUCTOR_IN_INTERFACE @@ -137,6 +138,7 @@ import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.TYPE_PARAMETER_AS import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.UNINITIALIZED_VARIABLE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.UNRESOLVED_LABEL import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.UNRESOLVED_REFERENCE +import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.UNSAFE_CALL import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.UNUSED_VARIABLE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.UPPER_BOUND_VIOLATED import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.USELESS_VARARG_ON_PARAMETER @@ -418,6 +420,11 @@ class FirDefaultErrorMessages : DefaultErrorMessages.Extension { TO_STRING, AMBIGUOUS_CALLS ) + map.put( + COMPONENT_FUNCTION_ON_NULLABLE, + "Not nullable value required to call ''{0}()'' function of destructuring declaration initializer", + TO_STRING + ) // Control flow diagnostics map.put(UNINITIALIZED_VARIABLE, "{0} must be initialized before access", PROPERTY_NAME) @@ -431,6 +438,18 @@ class FirDefaultErrorMessages : DefaultErrorMessages.Extension { map.put(LEAKED_IN_PLACE_LAMBDA, "Leaked in-place lambda: {2}", SYMBOL) map.put(FirErrors.WRONG_IMPLIES_CONDITION, "Wrong implies condition") + // Nullability + map.put( + UNSAFE_CALL, + "Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type {0}", + RENDER_TYPE + ) + //map.put( + // UNSAFE_IMPLICIT_INVOKE_CALL, + // "Reference has a nullable type ''{0}'', use explicit \"?.invoke\" to make a function-like call instead.", + // RENDER_TYPE + //) + // Extended checkers group map.put(REDUNDANT_VISIBILITY_MODIFIER, "Redundant visibility modifier") map.put(REDUNDANT_MODALITY_MODIFIER, "Redundant modality modifier") diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnosticRenderers.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnosticRenderers.kt index a06c569f83b..483a5c42c7e 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnosticRenderers.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnosticRenderers.kt @@ -13,7 +13,8 @@ import org.jetbrains.kotlin.fir.symbols.AbstractFirBasedSymbol import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol import org.jetbrains.kotlin.fir.symbols.impl.FirClassLikeSymbol import org.jetbrains.kotlin.fir.symbols.impl.FirPropertySymbol -import org.jetbrains.kotlin.fir.types.FirTypeRef +import org.jetbrains.kotlin.fir.types.ConeKotlinType +import org.jetbrains.kotlin.fir.types.render object FirDiagnosticRenderers { val NULLABLE_STRING = Renderer { it ?: "null" } @@ -58,9 +59,9 @@ object FirDiagnosticRenderers { name.asString() } - val RENDER_TYPE = Renderer { typeRef: FirTypeRef -> + val RENDER_TYPE = Renderer { t: ConeKotlinType -> // TODO: need a way to tune granuality, e.g., without parameter names in functional types. - typeRef.render() + t.render() } val AMBIGUOUS_CALLS = Renderer { candidates: Collection> -> diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt index 47bfb8a2fe3..011026d1fb7 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt @@ -197,9 +197,9 @@ object FirErrors { // Destructuring declaration val INITIALIZER_REQUIRED_FOR_DESTRUCTURING_DECLARATION by error0() - val COMPONENT_FUNCTION_MISSING by error2() - val COMPONENT_FUNCTION_AMBIGUITY by error2>>() - // TODO: val COMPONENT_FUNCTION_ON_NULLABLE by ... + val COMPONENT_FUNCTION_MISSING by error2() + val COMPONENT_FUNCTION_AMBIGUITY by error2>>() + val COMPONENT_FUNCTION_ON_NULLABLE by error1() // TODO: val COMPONENT_FUNCTION_RETURN_TYPE_MISMATCH by ... // Control flow diagnostics @@ -208,6 +208,13 @@ object FirErrors { val LEAKED_IN_PLACE_LAMBDA by error1>() val WRONG_IMPLIES_CONDITION by warning0() + // Nullability + val UNSAFE_CALL by error1() + // TODO: val UNSAFE_IMPLICIT_INVOKE_CALL by error1() + // TODO: val UNSAFE_INFIX_CALL by ... + // TODO: val UNSAFE_OPERATOR_CALL by ... + // TODO: val UNEXPECTED_SAFE_CALL by ... + // Extended checkers group val REDUNDANT_VISIBILITY_MODIFIER by warning0(SourceElementPositioningStrategies.VISIBILITY_MODIFIER) val REDUNDANT_MODALITY_MODIFIER by warning0(SourceElementPositioningStrategies.MODALITY_MODIFIER) diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/Arguments.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/Arguments.kt index 511470096ca..172cbb4cae8 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/Arguments.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/Arguments.kt @@ -310,7 +310,7 @@ private fun checkApplicabilityForArgumentType( if (expectedType == null) return if (isReceiver && isDispatch) { if (!expectedType.isNullable && argumentType.isMarkedNullable) { - sink.reportDiagnostic(InapplicableWrongReceiver) + sink.reportDiagnostic(InapplicableWrongReceiver(expectedType, argumentType)) } return } @@ -323,10 +323,10 @@ private fun checkApplicabilityForArgumentType( val nullableExpectedType = expectedType.withNullability(ConeNullability.NULLABLE, context.session.typeContext) if (csBuilder.addSubtypeConstraintIfCompatible(argumentType, nullableExpectedType, position)) { - sink.reportDiagnostic(InapplicableWrongReceiver) // TODO + sink.reportDiagnostic(InapplicableWrongReceiver(expectedType, argumentType)) // TODO } else { csBuilder.addSubtypeConstraint(argumentType, expectedType, position) - sink.reportDiagnostic(InapplicableWrongReceiver) + sink.reportDiagnostic(InapplicableWrongReceiver(expectedType, argumentType)) } } } diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/ResolutionDiagnostic.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/ResolutionDiagnostic.kt index b3ee019a4c8..fa1ac80d2fd 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/ResolutionDiagnostic.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/ResolutionDiagnostic.kt @@ -8,6 +8,7 @@ package org.jetbrains.kotlin.fir.resolve.calls import org.jetbrains.kotlin.fir.declarations.FirFunction import org.jetbrains.kotlin.fir.declarations.FirValueParameter import org.jetbrains.kotlin.fir.expressions.FirExpression +import org.jetbrains.kotlin.fir.types.ConeKotlinType import org.jetbrains.kotlin.resolve.calls.tower.CandidateApplicability abstract class ResolutionDiagnostic(val applicability: CandidateApplicability) @@ -57,7 +58,10 @@ object HiddenCandidate : ResolutionDiagnostic(CandidateApplicability.HIDDEN) object ResolvedWithLowPriority : ResolutionDiagnostic(CandidateApplicability.RESOLVED_LOW_PRIORITY) -object InapplicableWrongReceiver : ResolutionDiagnostic(CandidateApplicability.INAPPLICABLE_WRONG_RECEIVER) +class InapplicableWrongReceiver( + val expectedType: ConeKotlinType? = null, + val actualType: ConeKotlinType? = null, +) : ResolutionDiagnostic(CandidateApplicability.INAPPLICABLE_WRONG_RECEIVER) object LowerPriorityToPreserveCompatibilityDiagnostic : ResolutionDiagnostic(CandidateApplicability.RESOLVED_NEED_PRESERVE_COMPATIBILITY) diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/ResolutionStages.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/ResolutionStages.kt index 50bfa79c876..bb3b6eb744b 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/ResolutionStages.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/ResolutionStages.kt @@ -39,17 +39,17 @@ internal object CheckExplicitReceiverConsistency : ResolutionStage() { when (receiverKind) { NO_EXPLICIT_RECEIVER -> { if (explicitReceiver != null && explicitReceiver !is FirResolvedQualifier && !explicitReceiver.isSuperReferenceExpression()) { - return sink.yieldDiagnostic(InapplicableWrongReceiver) + return sink.yieldDiagnostic(InapplicableWrongReceiver(actualType = explicitReceiver.typeRef.coneTypeSafe())) } } EXTENSION_RECEIVER, DISPATCH_RECEIVER -> { if (explicitReceiver == null) { - return sink.yieldDiagnostic(InapplicableWrongReceiver) + return sink.yieldDiagnostic(InapplicableWrongReceiver()) } } BOTH_RECEIVERS -> { if (explicitReceiver == null) { - return sink.yieldDiagnostic(InapplicableWrongReceiver) + return sink.yieldDiagnostic(InapplicableWrongReceiver()) } // Here we should also check additional invoke receiver } @@ -105,7 +105,7 @@ object CheckDispatchReceiver : ResolutionStage() { val dispatchReceiverValueType = candidate.dispatchReceiverValue?.type ?: return if (!AbstractNullabilityChecker.isSubtypeOfAny(context.session.typeContext, dispatchReceiverValueType)) { - sink.yieldDiagnostic(InapplicableWrongReceiver) + sink.yieldDiagnostic(InapplicableWrongReceiver(actualType = dispatchReceiverValueType)) } } } diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/diagnostics/FirDiagnostics.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/diagnostics/FirDiagnostics.kt index e50a0be8f76..8555107a894 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/diagnostics/FirDiagnostics.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/diagnostics/FirDiagnostics.kt @@ -9,6 +9,7 @@ import org.jetbrains.kotlin.fir.declarations.FirCallableDeclaration import org.jetbrains.kotlin.fir.diagnostics.ConeDiagnostic import org.jetbrains.kotlin.fir.render import org.jetbrains.kotlin.fir.resolve.calls.Candidate +import org.jetbrains.kotlin.fir.resolve.calls.ResolutionDiagnostic import org.jetbrains.kotlin.fir.symbols.AbstractFirBasedSymbol import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol import org.jetbrains.kotlin.fir.symbols.impl.FirClassLikeSymbol @@ -37,14 +38,16 @@ class ConeHiddenCandidateError( override val reason: String get() = "HIDDEN: ${describeSymbol(candidateSymbol)} is invisible" } -class ConeInapplicableCandidateError( +class ConeInapplicableCandidateError private constructor( val applicability: CandidateApplicability, val candidateSymbol: AbstractFirBasedSymbol<*>, + val diagnostics: List, val errors: List ) : ConeDiagnostic() { constructor(applicability: CandidateApplicability, candidate: Candidate) : this( applicability, candidate.symbol, + candidate.diagnostics, candidate.system.errors ) diff --git a/compiler/testData/diagnostics/tests/BreakContinue.fir.kt b/compiler/testData/diagnostics/tests/BreakContinue.fir.kt index 456a6b1b623..3dd08bac65a 100644 --- a/compiler/testData/diagnostics/tests/BreakContinue.fir.kt +++ b/compiler/testData/diagnostics/tests/BreakContinue.fir.kt @@ -29,7 +29,7 @@ class C { while (a == null) { break; } - a.compareTo("2") + a.compareTo("2") } fun notContainsBreak(a: String?, b: String?) { @@ -70,7 +70,7 @@ class C { break@l } } - a.compareTo("2") + a.compareTo("2") } fun unresolvedBreak(a: String?, array: Array) { @@ -80,7 +80,7 @@ class C { } if (true) break else break@l } - a.compareTo("2") + a.compareTo("2") } fun twoLabelsOnLoop() { diff --git a/compiler/testData/diagnostics/tests/Nullability.fir.kt b/compiler/testData/diagnostics/tests/Nullability.fir.kt index 546e69d05d6..e8503b1ae07 100644 --- a/compiler/testData/diagnostics/tests/Nullability.fir.kt +++ b/compiler/testData/diagnostics/tests/Nullability.fir.kt @@ -158,7 +158,7 @@ fun test() { fun f(out : String?) { out?.get(0) - out.get(0) + out.get(0) if (out != null) else return; out.get(0) } diff --git a/compiler/testData/diagnostics/tests/collectionLiterals/basicCollectionLiterals.fir.kt b/compiler/testData/diagnostics/tests/collectionLiterals/basicCollectionLiterals.fir.kt index b6236178bb0..5f99076728e 100644 --- a/compiler/testData/diagnostics/tests/collectionLiterals/basicCollectionLiterals.fir.kt +++ b/compiler/testData/diagnostics/tests/collectionLiterals/basicCollectionLiterals.fir.kt @@ -14,11 +14,11 @@ fun test() { } fun check() { - [1, 2] checkType { _>() } - [""] checkType { _>() } + [1, 2] checkType { _>() } + [""] checkType { _>() } val f: IntArray = [1] - [f] checkType { _>() } + [f] checkType { _>() } - [1, ""] checkType { _>() } + [1, ""] checkType { _>() } } diff --git a/compiler/testData/diagnostics/tests/controlStructures/ForLoopWithExtensionIteratorOnNullable.fir.kt b/compiler/testData/diagnostics/tests/controlStructures/ForLoopWithExtensionIteratorOnNullable.fir.kt index 8c7dc98fa97..a61a47ce9eb 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/ForLoopWithExtensionIteratorOnNullable.fir.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/ForLoopWithExtensionIteratorOnNullable.fir.kt @@ -7,9 +7,9 @@ operator fun Container.iterator(): Iterator = null!! fun test() { val container: Container? = null // Error - container.iterator() + container.iterator() // for extension iterator, this code compiles, but should not - for (s in container) {} + for (s in container) {} } class OtherContainer(val k: K) { operator fun iterator(): Iterator = null!! @@ -18,5 +18,5 @@ class OtherContainer(val k: K) { fun test2() { val other: OtherContainer? = null // Error - for (s in other) {} + for (s in other) {} } diff --git a/compiler/testData/diagnostics/tests/controlStructures/forLoopWithNullableRange.fir.kt b/compiler/testData/diagnostics/tests/controlStructures/forLoopWithNullableRange.fir.kt index 5f4acc078ec..8940c91415f 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/forLoopWithNullableRange.fir.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/forLoopWithNullableRange.fir.kt @@ -8,7 +8,7 @@ class It { } fun test(c: Coll?) { - for (x in c) {} + for (x in c) {} if (c != null) { for(x in c) {} diff --git a/compiler/testData/diagnostics/tests/controlStructures/forWithNullableIterator.fir.kt b/compiler/testData/diagnostics/tests/controlStructures/forWithNullableIterator.fir.kt index 3fa6d25c9b2..2daa6c2e4fd 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/forWithNullableIterator.fir.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/forWithNullableIterator.fir.kt @@ -8,5 +8,5 @@ class It { } fun test() { - for (x in Coll()) {} + for (x in Coll()) {} } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/dataClasses/extensionComponentsOnNullable.fir.kt b/compiler/testData/diagnostics/tests/dataClasses/extensionComponentsOnNullable.fir.kt index 35a91f872ec..ea2b32291a8 100644 --- a/compiler/testData/diagnostics/tests/dataClasses/extensionComponentsOnNullable.fir.kt +++ b/compiler/testData/diagnostics/tests/dataClasses/extensionComponentsOnNullable.fir.kt @@ -8,7 +8,7 @@ operator fun Data.component2() = y fun foo(): Int { val d: Data? = null // An error must be here - val (x, y) = d + val (x, y) = d return x + y } @@ -17,6 +17,6 @@ data class NormalData(val x: T, val y: T) fun bar(): Int { val d: NormalData? = null // An error must be here - val (x, y) = d + val (x, y) = d return x + y } diff --git a/compiler/testData/diagnostics/tests/dataFlow/assignment/uninitializedValNullability.fir.kt b/compiler/testData/diagnostics/tests/dataFlow/assignment/uninitializedValNullability.fir.kt index 4123fd8c1e4..cee27e5b00a 100644 --- a/compiler/testData/diagnostics/tests/dataFlow/assignment/uninitializedValNullability.fir.kt +++ b/compiler/testData/diagnostics/tests/dataFlow/assignment/uninitializedValNullability.fir.kt @@ -10,6 +10,6 @@ fun test(a: Any?, flag: Boolean, x: Any?) { } else { b = x - b.hashCode() + b.hashCode() } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/UnaryExpression.fir.kt b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/UnaryExpression.fir.kt index 168fea3ca59..8803f8d30bf 100644 --- a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/UnaryExpression.fir.kt +++ b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/UnaryExpression.fir.kt @@ -4,11 +4,11 @@ fun baz(b: Boolean): Boolean = !b fun foo() { val x: Int? = null - bar(-x) + bar(-x) if (x != null) bar(-x) - bar(-x) + bar(-x) val b: Boolean? = null - baz(!b) + baz(!b) if (b != null) baz(!b) } diff --git a/compiler/testData/diagnostics/tests/declarationChecks/MultiDeclarationErrors.fir.kt b/compiler/testData/diagnostics/tests/declarationChecks/MultiDeclarationErrors.fir.kt index 93b54cc4397..79f6bfec9b2 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/MultiDeclarationErrors.fir.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/MultiDeclarationErrors.fir.kt @@ -11,7 +11,7 @@ class MyClass2 {} fun MyClass2.component1() = 1.3 fun test(mc1: MyClass, mc2: MyClass2) { - val (a, b) = mc1 + val (a, b) = mc1 val (c) = mc2 //a,b,c are error types diff --git a/compiler/testData/diagnostics/tests/declarationChecks/namedFunAsLastExpressionInBlock.fir.kt b/compiler/testData/diagnostics/tests/declarationChecks/namedFunAsLastExpressionInBlock.fir.kt index 991fc0fe076..8287a52b1ea 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/namedFunAsLastExpressionInBlock.fir.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/namedFunAsLastExpressionInBlock.fir.kt @@ -5,7 +5,7 @@ fun foo(block: () -> (() -> Int)) {} fun test() { val x = fun named1(x: Int): Int { return 1 } - x checkType { _>() } + x checkType { _>() } foo { fun named2(): Int {return 1} } foo({ fun named3() = 1 }) diff --git a/compiler/testData/diagnostics/tests/extensions/ExtensionFunctions.fir.kt b/compiler/testData/diagnostics/tests/extensions/ExtensionFunctions.fir.kt index 44614eb1728..d97a9489f92 100644 --- a/compiler/testData/diagnostics/tests/extensions/ExtensionFunctions.fir.kt +++ b/compiler/testData/diagnostics/tests/extensions/ExtensionFunctions.fir.kt @@ -64,7 +64,7 @@ import outer.* command.foo - command.equals(null) + command.equals(null) command?.equals(null) command.equals1(null) command?.equals1(null) diff --git a/compiler/testData/diagnostics/tests/extensions/kt1875.fir.kt b/compiler/testData/diagnostics/tests/extensions/kt1875.fir.kt index 3736d3d3ee2..97b7009ccad 100644 --- a/compiler/testData/diagnostics/tests/extensions/kt1875.fir.kt +++ b/compiler/testData/diagnostics/tests/extensions/kt1875.fir.kt @@ -9,13 +9,13 @@ interface T { } fun test(t: T) { - t.f(1) //unsafe call error + t.f(1) //unsafe call error t.f?.invoke(1) } fun test1(t: T?) { t.f(1) // todo resolve f as value and report UNSAFE_CALL - t?.f(1) - t.f?.invoke(1) + t?.f(1) + t.f?.invoke(1) t?.f?.invoke(1) } diff --git a/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver.fir.kt b/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver.fir.kt index fa574807616..22fe4826bd5 100644 --- a/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver.fir.kt +++ b/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver.fir.kt @@ -8,7 +8,7 @@ fun List.a() {} fun test1(i: Int?) { 1.a() - i.a() + i.a() } fun test2(c: Collection) { @@ -19,7 +19,7 @@ fun Int.foo() {} fun test3(s: String?) { "".foo() - s.foo() + s.foo() "".foo(1) s.foo("a") } @@ -52,5 +52,5 @@ fun test7(l: List) { } fun test8(l: List?) { - l.b() + l.b() } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/complexInference.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/complexInference.fir.kt index e9d09e341af..31c70005549 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/complexInference.fir.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/complexInference.fir.kt @@ -24,24 +24,24 @@ fun bar(aInstance: A, bInstance: B) { foo(bInstance) { (a, b): A, (c, d) -> - a checkType { _() } - b checkType { _() } + a checkType { _() } + b checkType { _() } c checkType { _() } d checkType { _() } } foo(bInstance) { (a, b), (c, d) -> - a checkType { _() } - b checkType { _() } + a checkType { _() } + b checkType { _() } c checkType { _() } d checkType { _() } } foo(bInstance) { (a, b), (c, d) -> - a checkType { _() } - b checkType { _() } + a checkType { _() } + b checkType { _() } c checkType { _() } d checkType { _() } } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/redeclaration.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/redeclaration.fir.kt index 9b4ea9d4756..0fb7b9f92bc 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/redeclaration.fir.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/redeclaration.fir.kt @@ -23,7 +23,7 @@ fun bar() { } foo { (a, b), (c, b) -> - a checkType { _() } + a checkType { _() } b checkType { _() } c checkType { _() } } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/simple.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/simple.fir.kt index 1115485d97c..b2af00d8479 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/simple.fir.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/simple.fir.kt @@ -36,8 +36,8 @@ fun bar() { } foobar { (a, b), (c, d) -> - a checkType { _() } - b checkType { _() } + a checkType { _() } + b checkType { _() } c checkType { _() } d checkType { _() } } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/unusedParameters.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/unusedParameters.fir.kt index db23c7d5f31..04fadf414b7 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/unusedParameters.fir.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/unusedParameters.fir.kt @@ -32,12 +32,12 @@ fun bar() { } foobar { (a, b), (c, d) -> - a checkType { _() } + a checkType { _() } d checkType { _() } } foobar { (a, b), (c, d) -> - b checkType { _() } + b checkType { _() } c checkType { _() } } } diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClasses.fir.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClasses.fir.kt index 15dfefa3581..7074f6d1802 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClasses.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClasses.fir.kt @@ -20,7 +20,7 @@ class A : Outer() { fun foo() { Derived().foo() checkType { _.Inner>() } - Derived().baz() checkType { _>() } + Derived().baz() checkType { _>() } A.B().bar() checkType { _.Inner>() } - A.B().x() checkType { _>() } + A.B().x() checkType { _>() } } diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocal.fir.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocal.fir.kt index 603d640167d..06867cf008e 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocal.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocal.fir.kt @@ -43,7 +43,7 @@ fun test() { x = foobar() x().foo().a() checkType { _>() } - x().bar() checkType { _>() } + x().bar() checkType { _>() } x = foobar() @@ -51,5 +51,5 @@ fun test() { y = noParameters() y().foo().a() checkType { _>() } - y().bar() checkType { _>() } + y().bar() checkType { _>() } } diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocalInsideInner.fir.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocalInsideInner.fir.kt index 9f0071189a5..2cef2166c0a 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocalInsideInner.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocalInsideInner.fir.kt @@ -44,7 +44,7 @@ class Outer { x = foobar() x().foo().a() checkType { _>() } - x().bar() checkType { _>() } + x().bar() checkType { _>() } x = foobar() x = z.foobar() @@ -53,7 +53,7 @@ class Outer { y = noParameters() y().foo().a() checkType { _>() } - y().bar() checkType { _>() } + y().bar() checkType { _>() } } } } diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesTransitive.fir.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesTransitive.fir.kt index ccefd06ca5b..bfbf34ff775 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesTransitive.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesTransitive.fir.kt @@ -15,5 +15,5 @@ class Derived : BaseDerived2() { fun foo() { Derived().foo() checkType { _.Inner>() } - Derived().baz() checkType { _>() } + Derived().baz() checkType { _>() } } diff --git a/compiler/testData/diagnostics/tests/inference/completion/lambdaWithVariableAndNothing.fir.kt b/compiler/testData/diagnostics/tests/inference/completion/lambdaWithVariableAndNothing.fir.kt index e8c34135f42..bea156ac175 100644 --- a/compiler/testData/diagnostics/tests/inference/completion/lambdaWithVariableAndNothing.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/completion/lambdaWithVariableAndNothing.fir.kt @@ -23,7 +23,7 @@ fun testNoSmartCast1(s: String?) { if (s != null) "" else noSmartCast1(null) { "" } ) - s.length + s.length } fun testNoSmartCast2(s: String?) { @@ -31,7 +31,7 @@ fun testNoSmartCast2(s: String?) { if (s != null) ( {""} ) else noSmartCast2(null) { "" } ) - s.length + s.length } fun testNoSmartCast3(s: String?) { @@ -39,7 +39,7 @@ fun testNoSmartCast3(s: String?) { if (s != null) "" else noSmartCast3(null) { "" } ) - s.length + s.length } // KT-36069 @@ -48,5 +48,5 @@ fun testNoSmartCast4(s: String?) { if (s != null) ( {""} ) else noSmartCast4(null) { "" } ) - s.length + s.length } diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2842.fir.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2842.fir.kt index 958e980bed9..f058a9a90a1 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt2842.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt2842.fir.kt @@ -3,14 +3,14 @@ package c interface A fun test(a: A?) { - a.foo() //no error + a.foo() //no error } fun A.foo() {} //------------ fun test(nullabilityInfoMap: Map?) { - nullabilityInfoMap.iterator() //no error + nullabilityInfoMap.iterator() //no error } //resolves to @@ -20,7 +20,7 @@ public fun Map.iterator(): Iterator> {} //------------- fun foo() : Boolean { val nullableList = getNullableList() - return nullableList.contains("") + return nullableList.contains("") } diff --git a/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloads.fir.kt b/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloads.fir.kt index 80760d8daf3..ac9da0f0ba2 100644 --- a/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloads.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloads.fir.kt @@ -19,9 +19,9 @@ public abstract class CollectionWithSize implements java.util.Collection // FILE: main.kt fun main(c: CollectionWithSize) { - CompressionType.ZIP.name checkType { _() } - c.size checkType { _() } + CompressionType.ZIP.name checkType { _() } + c.size checkType { _() } - CompressionType.ZIP::name checkType { _>() } - c::size checkType { _>() } + CompressionType.ZIP::name checkType { _>() } + c::size checkType { _>() } } diff --git a/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloadsDisabled.fir.kt b/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloadsDisabled.fir.kt index aa113f16ee1..8121e3c48d0 100644 --- a/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloadsDisabled.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloadsDisabled.fir.kt @@ -20,9 +20,9 @@ public abstract class CollectionWithSize implements java.util.Collection // FILE: main.kt fun main(c: CollectionWithSize) { - CompressionType.ZIP.name checkType { _() } - c.size checkType { _() } + CompressionType.ZIP.name checkType { _() } + c.size checkType { _() } - CompressionType.ZIP::name checkType { _>() } - c::size checkType { _>() } + CompressionType.ZIP::name checkType { _>() } + c::size checkType { _>() } } diff --git a/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloadsNI.fir.kt b/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloadsNI.fir.kt index df77b661fc5..4ed8ecfdbde 100644 --- a/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloadsNI.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloadsNI.fir.kt @@ -19,9 +19,9 @@ public abstract class CollectionWithSize implements java.util.Collection // FILE: main.kt fun main(c: CollectionWithSize) { - CompressionType.ZIP.name checkType { _() } - c.size checkType { _() } + CompressionType.ZIP.name checkType { _() } + c.size checkType { _() } - CompressionType.ZIP::name checkType { _>() } - c::size checkType { _>() } + CompressionType.ZIP::name checkType { _>() } + c::size checkType { _>() } } diff --git a/compiler/testData/diagnostics/tests/j+k/sam/enhancedSamConstructor.fir.kt b/compiler/testData/diagnostics/tests/j+k/sam/enhancedSamConstructor.fir.kt index 8b236b356e7..5a6c239f2a3 100644 --- a/compiler/testData/diagnostics/tests/j+k/sam/enhancedSamConstructor.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/sam/enhancedSamConstructor.fir.kt @@ -17,12 +17,12 @@ public interface J2 extends J { // FILE: main.kt fun main() { J { s: String -> s} // should be prohibited, because SAM value parameter has nullable type - J { "" + it.length } + J { "" + it.length } J { null } J { it?.length?.toString() } J2 { s: String -> s} - J2 { "" + it.length } + J2 { "" + it.length } J2 { null } J2 { it?.length?.toString() } } diff --git a/compiler/testData/diagnostics/tests/j+k/selectMoreSpecific.fir.kt b/compiler/testData/diagnostics/tests/j+k/selectMoreSpecific.fir.kt index c64eab51fd2..4db841309f3 100644 --- a/compiler/testData/diagnostics/tests/j+k/selectMoreSpecific.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/selectMoreSpecific.fir.kt @@ -11,6 +11,6 @@ public class A { // FILE: main.kt fun foo(a: A) { - a.foo() checkType { _() } - A.bar() checkType { _() } + a.foo() checkType { _() } + A.bar() checkType { _() } } diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/InfixCallNullability.fir.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/InfixCallNullability.fir.kt index 839925da1b5..72cd24bbdde 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/InfixCallNullability.fir.kt +++ b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/InfixCallNullability.fir.kt @@ -12,21 +12,21 @@ fun test(x : Int?, a : A?) { x.plus(1) x?.plus(1) x + 1 - -x - x.unaryMinus() + -x + x.unaryMinus() x?.unaryMinus() - a.plus(1) + a.plus(1) a?.plus(1) - a plus 1 - a + 1 - -a - a.unaryMinus() + a plus 1 + a + 1 + -a + a.unaryMinus() a?.unaryMinus() - a.div(1) - a / 1 - a div 1 + a.div(1) + a / 1 + a div 1 a?.div(1) a.times(1) @@ -34,8 +34,8 @@ fun test(x : Int?, a : A?) { a times 1 a?.times(1) - 1 in a - a contains 1 - a.contains(1) + 1 in a + a contains 1 + a.contains(1) a?.contains(1) } diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/QualifiedExpressionNullability.fir.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/QualifiedExpressionNullability.fir.kt index dd37e99af1e..2f5c6a7e097 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/QualifiedExpressionNullability.fir.kt +++ b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/QualifiedExpressionNullability.fir.kt @@ -7,7 +7,7 @@ fun main() { val x: Foo? = null val y: Foo? = null - x.foo(y) + x.foo(y) x!!.foo(y) x.foo(y!!) x!!.foo(y!!) @@ -16,8 +16,8 @@ fun main() { val b: Foo? = null val c: Foo? = null - a.foo(b.foo(c)) - a!!.foo(b.foo(c)) + a.foo(b.foo(c)) + a!!.foo(b.foo(c)) a.foo(b!!.foo(c)) a!!.foo(b!!.foo(c)) a.foo(b.foo(c!!)) diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/ReceiverNullability.fir.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/ReceiverNullability.fir.kt index f4c80d04a33..9e276aeb021 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/ReceiverNullability.fir.kt +++ b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/ReceiverNullability.fir.kt @@ -6,8 +6,8 @@ fun A.bar() {} fun A?.buzz() {} fun test(a : A?) { - a.foo() // error - a.bar() // error + a.foo() // error + a.bar() // error a.buzz() a?.foo() @@ -30,12 +30,12 @@ fun A.test2() { } fun A?.test3() { - foo() // error - bar() // error + foo() // error + bar() // error buzz() - this.foo() // error - this.bar() // error + this.foo() // error + this.bar() // error this.buzz() this?.foo() diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt1270.fir.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt1270.fir.kt index fc22dedc602..a874fdd3e2d 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt1270.fir.kt +++ b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt1270.fir.kt @@ -5,7 +5,7 @@ package kt1270 fun foo() { val sc = java.util.HashMap()[""] - val value = sc.value + val value = sc.value } private class SomeClass() { diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2125.fir.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2125.fir.kt index b50cddfcd3e..de9fdea7140 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2125.fir.kt +++ b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2125.fir.kt @@ -5,7 +5,7 @@ package e fun main() { val compareTo = 1 val s: String? = null - s.compareTo("") + s.compareTo("") val bar = 2 s.bar() diff --git a/compiler/testData/diagnostics/tests/platformTypes/noAnnotationInClassPath.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/noAnnotationInClassPath.fir.kt index de64ac8a435..8bf5b4f0e03 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/noAnnotationInClassPath.fir.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/noAnnotationInClassPath.fir.kt @@ -13,5 +13,5 @@ public class B { // FILE: main.kt fun test() { - B.bar() { it.hashCode() > 0 } + B.bar() { it.hashCode() > 0 } } diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/arithmetic.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/arithmetic.fir.kt index b6401dfa2a7..a2cf8835ddb 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/arithmetic.fir.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/arithmetic.fir.kt @@ -22,11 +22,11 @@ fun test() { var platformJ = J.staticJ +platformNN - +platformN + +platformN +platformJ ++platformNN - ++platformN + ++platformN ++platformJ platformNN++ diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/array.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/array.fir.kt index 59c87e88853..c05704fda35 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/array.fir.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/array.fir.kt @@ -21,11 +21,11 @@ fun test() { val platformJ = J.staticJ platformNN[0] - platformN[0] + platformN[0] platformJ[0] platformNN[0] = 1 - platformN[0] = 1 + platformN[0] = 1 platformJ[0] = 1 } diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/conditions.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/conditions.fir.kt index b81312ebbed..352b3c96041 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/conditions.fir.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/conditions.fir.kt @@ -43,6 +43,6 @@ fun test() { platformJ || false !platformNN - !platformN + !platformN !platformJ } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/delegatedProperties.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/delegatedProperties.fir.kt index 57a25830916..6b6b626d5a5 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/delegatedProperties.fir.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/delegatedProperties.fir.kt @@ -19,5 +19,5 @@ public class J { // FILE: k.kt var A by J.staticNN -var B by J.staticN +var B by J.staticN var C by J.staticJ \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/derefenceExtension.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/derefenceExtension.fir.kt index 413bcb99789..b283f99169b 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/derefenceExtension.fir.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/derefenceExtension.fir.kt @@ -23,14 +23,14 @@ fun test() { val platformJ = J.staticJ platformNN.foo() - platformN.foo() + platformN.foo() platformJ.foo() with(platformNN) { foo() } with(platformN) { - foo() + foo() } with(platformJ) { foo() diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/derefenceMember.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/derefenceMember.fir.kt index e63bffd9e8d..4422bd3d76e 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/derefenceMember.fir.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/derefenceMember.fir.kt @@ -25,14 +25,14 @@ fun test() { val platformJ = J.staticJ platformNN.foo() - platformN.foo() + platformN.foo() platformJ.foo() with(platformNN) { foo() } with(platformN) { - foo() + foo() } with(platformJ) { foo() diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/for.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/for.fir.kt index 39bda6289ca..cddddf5f0d9 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/for.fir.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/for.fir.kt @@ -22,7 +22,7 @@ fun test() { val platformJ = J.staticJ for (x in platformNN) {} - for (x in platformN) {} + for (x in platformN) {} for (x in platformJ) {} } diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/invoke.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/invoke.fir.kt index 5556634de6d..f858bc8d56f 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/invoke.fir.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/invoke.fir.kt @@ -18,6 +18,6 @@ public class J { fun test() { J.staticNN() - J.staticN() + J.staticN() J.staticJ() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/kt6829.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/kt6829.fir.kt index 356e46c7d01..6bc3106d2f2 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/kt6829.fir.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/kt6829.fir.kt @@ -16,7 +16,7 @@ public class J { fun foo(collection: Collection) { val mapped = collection.map { it.method() } - mapped[0].length + mapped[0].length } public fun Iterable.map(transform: (T) -> R): List { diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/multiDeclaration.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/multiDeclaration.fir.kt deleted file mode 100644 index c997080cc1a..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/multiDeclaration.fir.kt +++ /dev/null @@ -1,32 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -// FILE: J.java - -import org.jetbrains.annotations.*; - -public class J { - public interface Multi { - String component1(); - String component2(); - } - - @NotNull - public static Multi staticNN; - @Nullable - public static Multi staticN; - public static Multi staticJ; -} - -// FILE: k.kt - -fun test() { - // @NotNull platform type - val platformNN = J.staticNN - // @Nullable platform type - val platformN = J.staticN - // platform type with no annotation - val platformJ = J.staticJ - - val (a1, b1) = platformNN - val (a2, b2) = platformN - val (a3, b3) = platformJ -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/multiDeclaration.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/multiDeclaration.kt index 7d4acfccd85..aa29474b014 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/multiDeclaration.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/multiDeclaration.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE // FILE: J.java diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/primitiveArray.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/primitiveArray.fir.kt index 2b30ddadf5d..ae8754ed694 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/primitiveArray.fir.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/primitiveArray.fir.kt @@ -21,11 +21,11 @@ fun test() { val platformJ = J.staticJ platformNN[0] - platformN[0] + platformN[0] platformJ[0] platformNN[0] = 1 - platformN[0] = 1 + platformN[0] = 1 platformJ[0] = 1 } diff --git a/compiler/testData/diagnostics/tests/platformTypes/typeEnhancement/overriddenExtensions.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/typeEnhancement/overriddenExtensions.fir.kt index b341e6fcf69..1efd7128a34 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/typeEnhancement/overriddenExtensions.fir.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/typeEnhancement/overriddenExtensions.fir.kt @@ -8,8 +8,8 @@ class E : B1() { fun baz() { val x: String? = "" - x.foo(x) - x.foo("") + x.foo(x) + x.foo("") x.bar(x) x.bar("") } diff --git a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/primaryConstructorParameter.fir.kt b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/primaryConstructorParameter.fir.kt index 45c62b274d7..834814d7fdb 100644 --- a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/primaryConstructorParameter.fir.kt +++ b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/primaryConstructorParameter.fir.kt @@ -19,5 +19,5 @@ class C(p: Any, val v: Any) { var test5 get() { return p } - set(nv) { p.let {} } + set(nv) { p.let {} } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/regressions/kt12898.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt12898.fir.kt index 5272cd34b89..24aa3ce70c9 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt12898.fir.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt12898.fir.kt @@ -10,7 +10,7 @@ class C(override val t: Any?) : B fun f(b: B<*, Any>) { val y = b.t if (y is String?) { - y.length + y.length } } diff --git a/compiler/testData/diagnostics/tests/regressions/kt282.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt282.fir.kt index f119809683d..69fae482fa7 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt282.fir.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt282.fir.kt @@ -14,6 +14,6 @@ fun f(): Unit { val i : Int? = null i + 1 set + 1 - 1 in set + 1 in set 1 in 2 } diff --git a/compiler/testData/diagnostics/tests/regressions/kt557.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt557.fir.kt index c24e96f737d..c48032772db 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt557.fir.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt557.fir.kt @@ -8,5 +8,5 @@ fun Array.length() : Int { } fun test(array : Array?) { - array?.sure>().length() + array?.sure>().length() } diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/errors/unsafeCallWithInvoke.fir.kt b/compiler/testData/diagnostics/tests/resolve/invoke/errors/unsafeCallWithInvoke.fir.kt index 9ec457efedc..dddbda1ff30 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/errors/unsafeCallWithInvoke.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/errors/unsafeCallWithInvoke.fir.kt @@ -4,7 +4,7 @@ operator fun String.invoke(i: Int) {} fun foo(s: String?) { - s(1) + s(1) - (s ?: null)(1) + (s ?: null)(1) } diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/implicitInvokeAfterSafeCall.fir.kt b/compiler/testData/diagnostics/tests/resolve/invoke/implicitInvokeAfterSafeCall.fir.kt index 91c6e8b763d..21bb974a2bc 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/implicitInvokeAfterSafeCall.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/implicitInvokeAfterSafeCall.fir.kt @@ -12,7 +12,7 @@ class Another1 { fun Another1.main(x: Bar1?) { x?.value {} - x?.value.invoke({}) + x?.value.invoke({}) } // Test case 2: additional receiver, non-generic invoke @@ -26,7 +26,7 @@ class Another2 { fun Another2.main(x: Bar2?) { x?.value(1) - x?.value.invoke(1) + x?.value.invoke(1) } // Test case 3: additional generic receiver, generic invoke @@ -40,7 +40,7 @@ class Another3 { fun Another3.main(x: Bar3?) { x?.value(1) - x?.value.invoke(1) + x?.value.invoke(1) } // Test case 4: additional receiver, generic invoke with nullable receiver @@ -68,7 +68,7 @@ class Another5 { fun Another5.main(x: Bar5?) { x?.value {} - x?.value.invoke({}) + x?.value.invoke({}) } // Test case 6: top-level generic invoke @@ -96,7 +96,7 @@ operator fun Foo7.invoke(x: Int) {} fun Another7.main(x: Bar7?) { x?.value(1) - x?.value.invoke(1) + x?.value.invoke(1) } // Test case 8: top-level non-generic invoke @@ -136,5 +136,5 @@ class Another10 { fun Another10.main(x: Bar10?) { x?.value {} - x?.value.invoke({}) + x?.value.invoke({}) } diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAndSmartCast.fir.kt b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAndSmartCast.fir.kt index 8b51b8f9b4b..adcc02931d2 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAndSmartCast.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAndSmartCast.fir.kt @@ -7,8 +7,8 @@ fun test(a: A) { (a.x)("") } "".(a.x)() - a.x("") - (a.x)("") + a.x("") + (a.x)("") with("") { a.x() diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/kt30695_2.fir.kt b/compiler/testData/diagnostics/tests/resolve/invoke/kt30695_2.fir.kt index cb712bf11bf..1f172f753b1 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/kt30695_2.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/kt30695_2.fir.kt @@ -14,7 +14,7 @@ class MemberInvokeOwner { class Cls { fun testImplicitReceiver() { - nullableExtensionProperty() + nullableExtensionProperty() } } @@ -30,7 +30,7 @@ fun testNullableReceiver(nullable: Cls?) { } fun testNotNullableReceiver(notNullable: Cls) { - notNullable.nullableExtensionProperty() + notNullable.nullableExtensionProperty() notNullable?.extensionProperty() } @@ -38,6 +38,6 @@ fun testFlexibleReceiver() { val flexible = JavaClass.createFlexible() flexible.extensionProperty() flexible?.extensionProperty() - flexible.nullableExtensionProperty() - flexible?.nullableExtensionProperty() + flexible.nullableExtensionProperty() + flexible?.nullableExtensionProperty() } diff --git a/compiler/testData/diagnostics/tests/safeCall.fir.kt b/compiler/testData/diagnostics/tests/safeCall.fir.kt index e63b91d60df..0fab2d0aaf5 100644 --- a/compiler/testData/diagnostics/tests/safeCall.fir.kt +++ b/compiler/testData/diagnostics/tests/safeCall.fir.kt @@ -1,7 +1,7 @@ // !WITH_NEW_INFERENCE fun f(s: String, action: (String.() -> Unit)?) { - s.foo().bar().action() + s.foo().bar().action() } fun String.foo() = "" @@ -12,4 +12,4 @@ fun String.bar() = "" val functions: Map Any> = TODO() -fun run(name: String) = functions[name]() \ No newline at end of file +fun run(name: String) = functions[name]() \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/samConversions/OverloadPriority.fir.kt b/compiler/testData/diagnostics/tests/samConversions/OverloadPriority.fir.kt index 8e4fd966f51..f818a216e91 100644 --- a/compiler/testData/diagnostics/tests/samConversions/OverloadPriority.fir.kt +++ b/compiler/testData/diagnostics/tests/samConversions/OverloadPriority.fir.kt @@ -22,9 +22,9 @@ public interface J { // FILE: 1.kt fun test(j: J) { - j.foo({ it checkType { _() }; "" }, "") checkType { _() } + j.foo({ it checkType { _() }; "" }, "") checkType { _() } - j.bas({ it checkType { _() }; "" }, "") checkType { _() } + j.bas({ it checkType { _() }; "" }, "") checkType { _() } // NI: TODO j.bar { it checkType { _() }; "" } checkType { _() } diff --git a/compiler/testData/diagnostics/tests/samConversions/OverloadPriorityKT.fir.kt b/compiler/testData/diagnostics/tests/samConversions/OverloadPriorityKT.fir.kt index b2d9a1b570a..98167dcdf5f 100644 --- a/compiler/testData/diagnostics/tests/samConversions/OverloadPriorityKT.fir.kt +++ b/compiler/testData/diagnostics/tests/samConversions/OverloadPriorityKT.fir.kt @@ -21,9 +21,9 @@ interface K { } fun test(k: K) { - k.foo { it checkType { _() }; "" } checkType { _() } + k.foo { it checkType { _() }; "" } checkType { _() } - k.bas { it checkType { _() }; "" } checkType { _() } + k.bas { it checkType { _() }; "" } checkType { _() } // NI: TODO k.bar { it checkType { _() }; "" } checkType { _() } diff --git a/compiler/testData/diagnostics/tests/smartCasts/alwaysNull.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/alwaysNull.fir.kt index 29fc541bfce..eacb222a921 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/alwaysNull.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/alwaysNull.fir.kt @@ -3,7 +3,7 @@ fun foo(): String { var s: String? s = null s?.length - s.length + s.length if (s == null) return s!! var t: String? = "y" if (t == null) t = "x" diff --git a/compiler/testData/diagnostics/tests/smartCasts/castchecks/basicOff.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/castchecks/basicOff.fir.kt index 59df9520ef5..6cc76dce8d8 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/castchecks/basicOff.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/castchecks/basicOff.fir.kt @@ -13,7 +13,7 @@ fun g(a: SomeClass?) { // 'a' can be cast to SomeSubClass a.hashCode() a.foo - (a as? SomeSubClass).foo + (a as? SomeSubClass).foo (a as SomeSubClass).foo } val b = (a as? SomeSubClass)?.foo @@ -21,7 +21,7 @@ fun g(a: SomeClass?) { // 'a' can be cast to SomeSubClass a.hashCode() a.foo - (a as? SomeSubClass).foo + (a as? SomeSubClass).foo (a as SomeSubClass).foo } val c = a as? SomeSubClass @@ -29,7 +29,7 @@ fun g(a: SomeClass?) { // 'a' and 'c' can be cast to SomeSubClass a.hashCode() a.foo - (a as? SomeSubClass).foo + (a as? SomeSubClass).foo c.hashCode() c.foo } diff --git a/compiler/testData/diagnostics/tests/smartCasts/castchecks/basicOn.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/castchecks/basicOn.fir.kt index dba21c5cad0..0a93220068b 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/castchecks/basicOn.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/castchecks/basicOn.fir.kt @@ -13,7 +13,7 @@ fun g(a: SomeClass?) { // 'a' can be cast to SomeSubClass a.hashCode() a.foo - (a as? SomeSubClass).foo + (a as? SomeSubClass).foo (a as SomeSubClass).foo } val b = (a as? SomeSubClass)?.foo @@ -21,7 +21,7 @@ fun g(a: SomeClass?) { // 'a' can be cast to SomeSubClass a.hashCode() a.foo - (a as? SomeSubClass).foo + (a as? SomeSubClass).foo (a as SomeSubClass).foo } val c = a as? SomeSubClass @@ -29,7 +29,7 @@ fun g(a: SomeClass?) { // 'a' and 'c' can be cast to SomeSubClass a.hashCode() a.foo - (a as? SomeSubClass).foo + (a as? SomeSubClass).foo c.hashCode() c.foo } diff --git a/compiler/testData/diagnostics/tests/smartCasts/castchecks/variables.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/castchecks/variables.fir.kt index 63997330a6c..e4f801c3529 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/castchecks/variables.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/castchecks/variables.fir.kt @@ -18,18 +18,18 @@ fun g(a: SomeClass?) { b = "Hello" if (b != null) { // 'a' cannot be cast to SomeSubClass! - a.hashCode() + a.hashCode() a.foo - (a as? SomeSubClass).foo + (a as? SomeSubClass).foo (a as SomeSubClass).foo } var c = a as? SomeSubClass c = Impl if (c != null) { // 'a' cannot be cast to SomeSubClass - a.hashCode() + a.hashCode() a.foo - (a as? SomeSubClass).foo + (a as? SomeSubClass).foo c.hashCode() c.foo } @@ -41,18 +41,18 @@ fun f(a: SomeClass?) { if (aa as? SomeSubClass != null) { aa = null // 'aa' cannot be cast to SomeSubClass - aa.hashCode() + aa.hashCode() aa.foo - (aa as? SomeSubClass).foo + (aa as? SomeSubClass).foo (aa as SomeSubClass).foo } val b = (aa as? SomeSubClass)?.foo aa = null if (b != null) { // 'aa' cannot be cast to SomeSubClass - aa.hashCode() + aa.hashCode() aa.foo - (aa as? SomeSubClass).foo + (aa as? SomeSubClass).foo (aa as SomeSubClass).foo } aa = a @@ -61,7 +61,7 @@ fun f(a: SomeClass?) { // 'c' can be cast to SomeSubClass aa.hashCode() aa.foo - (aa as? SomeSubClass).foo + (aa as? SomeSubClass).foo c.hashCode() c.foo } diff --git a/compiler/testData/diagnostics/tests/smartCasts/comparisonUnderAnd.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/comparisonUnderAnd.fir.kt index 62ba2cb3653..0942e634d82 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/comparisonUnderAnd.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/comparisonUnderAnd.fir.kt @@ -6,30 +6,30 @@ fun foo(x : String?, y : String?) { y.length } else { - x.length - y.length + x.length + y.length } if (y != null || x == y) { - x.length - y.length + x.length + y.length } else { // y == null but x != y - x.length - y.length + x.length + y.length } if (y == null && x != y) { // y == null but x != y - x.length - y.length + x.length + y.length } else { - x.length - y.length + x.length + y.length } if (y == null || x != y) { - x.length - y.length + x.length + y.length } else { // Both not null diff --git a/compiler/testData/diagnostics/tests/smartCasts/complexComparison.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/complexComparison.fir.kt index 5ba47dc28b8..a0b569474bb 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/complexComparison.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/complexComparison.fir.kt @@ -3,21 +3,21 @@ fun foo(x: String?, y: String?, z: String?, w: String?) { if (x != null && y != null && (x == z || y == z)) z.length else - z.length + z.length if (x != null || y != null || (x != z && y != z)) - z.length + z.length else - z.length + z.length if (x == null || y == null || (x != z && y != z)) - z.length + z.length else z.length if (x != null && y == x && z == y && w == z) w.length else - w.length + w.length if ((x != null && y == x) || (z != null && y == z)) y.length else - y.length + y.length } diff --git a/compiler/testData/diagnostics/tests/smartCasts/complexConditionsWithExcl.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/complexConditionsWithExcl.fir.kt index 9ae92c920f7..195b7264fcc 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/complexConditionsWithExcl.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/complexConditionsWithExcl.fir.kt @@ -1,26 +1,26 @@ fun foo(x: String?, y: String?, z: String?) { if ((x!!.hashCode() == 0 || y!!.hashCode() == 1) && z!!.hashCode() == 2) { x.length - y.length + y.length // condition is true => z!! after and is called z.length } else { x.length - y.length - z.length + y.length + z.length } // First element is always analyzed x.length var xx = y ?: z if ((xx!!.hashCode() == 0 && y!!.hashCode() == 1) || z!!.hashCode() == 2) { xx.length - y.length - z.length + y.length + z.length } else { xx.length - y.length + y.length // condition is false => z!! after or is called z.length } @@ -35,16 +35,16 @@ fun foo(x: String?, y: String?, z: String?) { } else { xx.length - y.length - z.length + y.length + z.length } // First element is always analyzed x.length xx = y ?: z if (xx!!.hashCode() == 0 || y!!.hashCode() == 1 || z!!.hashCode() == 2) { xx.length - y.length - z.length + y.length + z.length } else { // all three are called diff --git a/compiler/testData/diagnostics/tests/smartCasts/elvis/basicOff.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/elvis/basicOff.fir.kt index e8d3d7a6e55..a97995bf7b1 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/elvis/basicOff.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/elvis/basicOff.fir.kt @@ -11,13 +11,13 @@ interface Order { fun foo(o: Any) { val order = o as? Order if (order?.expired ?: false) { - order.doSomething() + order.doSomething() } else { } if (order?.notExpired() ?: false) { - order.doSomething() + order.doSomething() } } @@ -39,12 +39,12 @@ fun bar(o: Any) { fun baz(o: Boolean?) { if (o ?: false) { - o.hashCode() + o.hashCode() } if (o ?: true) { } else { - o.hashCode() + o.hashCode() } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/elvis/basicOn.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/elvis/basicOn.fir.kt index b1b04eac84d..414fb5033f0 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/elvis/basicOn.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/elvis/basicOn.fir.kt @@ -11,13 +11,13 @@ interface Order { fun foo(o: Any) { val order = o as? Order if (order?.expired ?: false) { - order.doSomething() + order.doSomething() } else { } if (order?.notExpired() ?: false) { - order.doSomething() + order.doSomething() } } @@ -39,12 +39,12 @@ fun bar(o: Any) { fun baz(o: Boolean?) { if (o ?: false) { - o.hashCode() + o.hashCode() } if (o ?: true) { } else { - o.hashCode() + o.hashCode() } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/elvisExclExcl.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/elvisExclExcl.fir.kt index 1b9e8c144a2..9f7cab3fbbe 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/elvisExclExcl.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/elvisExclExcl.fir.kt @@ -1,7 +1,7 @@ // Based on KT-9100 fun test(x: Any?, y: Any?): Any { val z = x ?: y!! - y.hashCode() + y.hashCode() // !! / ?. is necessary here, because y!! above may not be executed y?.hashCode() y!!.hashCode() diff --git a/compiler/testData/diagnostics/tests/smartCasts/elvisNothingRHS.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/elvisNothingRHS.fir.kt index 646d4e00d2a..6f98ac66762 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/elvisNothingRHS.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/elvisNothingRHS.fir.kt @@ -4,7 +4,7 @@ class C { fun test(a: C?, nn: () -> Nothing?) { a ?: nn() - a.foo() + a.foo() a ?: return a.foo() diff --git a/compiler/testData/diagnostics/tests/smartCasts/enumEntryMembers_after.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/enumEntryMembers_after.fir.kt index 87ce27f6c51..89fe005a236 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/enumEntryMembers_after.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/enumEntryMembers_after.fir.kt @@ -12,7 +12,7 @@ fun printMessages() { Message.HELLO.text!! Message.HELLO.text.length - Message.NOTHING.text.length + Message.NOTHING.text.length Message.NOTHING.text!! Message.NOTHING.text.length diff --git a/compiler/testData/diagnostics/tests/smartCasts/enumEntryMembers_before.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/enumEntryMembers_before.fir.kt index 89598ff6aff..3279bad6e1c 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/enumEntryMembers_before.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/enumEntryMembers_before.fir.kt @@ -12,7 +12,7 @@ fun printMessages() { Message.HELLO.text!! Message.HELLO.text.length - Message.NOTHING.text.length + Message.NOTHING.text.length Message.NOTHING.text!! Message.NOTHING.text.length diff --git a/compiler/testData/diagnostics/tests/smartCasts/exclUnderAnd.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/exclUnderAnd.fir.kt index 8b32be493ca..92375c17b25 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/exclUnderAnd.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/exclUnderAnd.fir.kt @@ -2,12 +2,12 @@ class D(val a: String, val b: Boolean) fun foo(p: Boolean, v: D?): String { if (p && v!!.b) v.a - else v.a + else v.a if (p && v!! == D("?", false)) v.a - else v.a - if (p || v!!.b) v.a + else v.a + if (p || v!!.b) v.a else v.a - if (p || v!! == D("?", false)) v.a + if (p || v!! == D("?", false)) v.a else v.a return "" } diff --git a/compiler/testData/diagnostics/tests/smartCasts/extensionSafeCall.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/extensionSafeCall.fir.kt index 36e4758349e..fe696141e76 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/extensionSafeCall.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/extensionSafeCall.fir.kt @@ -9,5 +9,5 @@ fun T?.let(f: (T) -> Unit) { fun test(your: Your?) { (your?.foo() as? Any)?.let {} // strange smart cast to 'Your' at this point - your.hashCode() + your.hashCode() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/fieldExclExcl.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/fieldExclExcl.fir.kt index afb7de85564..ba139fb72fc 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/fieldExclExcl.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/fieldExclExcl.fir.kt @@ -7,6 +7,6 @@ fun foo() { var y: My? = My(42) if (y!!.x != null) { y = My(null) - y!!.x.hashCode() + y!!.x.hashCode() } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/fieldPlus.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/fieldPlus.fir.kt index 1546c9eb824..e0b0a52ecc2 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/fieldPlus.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/fieldPlus.fir.kt @@ -9,6 +9,6 @@ fun foo() { var y: My? = My(42) if (y!!.x != null) { y = My(null) - (y + My(0)).x.hashCode() + (y + My(0)).x.hashCode() } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/inference/kt39010.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/inference/kt39010.fir.kt index 39ab0627006..e59ff0887e9 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/inference/kt39010.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/inference/kt39010.fir.kt @@ -5,7 +5,7 @@ class A { class B(var a: A<*>?) { fun bar() { if (a != null) { - a.foo() + a.foo() } } } diff --git a/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/unstableSmartCast.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/unstableSmartCast.fir.kt index ae481e57005..8bb6ab6a4d0 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/unstableSmartCast.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/unstableSmartCast.fir.kt @@ -33,6 +33,6 @@ fun test() { x.baz(1).checkType { _() } x.baz(1, 2) - x.foobar().checkType { _() } + x.foobar().checkType { _() } } } diff --git a/compiler/testData/diagnostics/tests/smartCasts/kt32358_2.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/kt32358_2.fir.kt index ed37dc9ad77..1ca5c52cac0 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/kt32358_2.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/kt32358_2.fir.kt @@ -14,7 +14,7 @@ inline fun callItContracted(fn: () -> R): R { fun smartIt(p1: String?, p2: String?) { p1 ?: callIt { return } - p1.length + p1.length p2 ?: callItContracted { return } p2.length diff --git a/compiler/testData/diagnostics/tests/smartCasts/kt32358_3.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/kt32358_3.fir.kt index 11e7a95bddf..f3e92e052df 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/kt32358_3.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/kt32358_3.fir.kt @@ -6,5 +6,5 @@ fun callIt(fn: () -> R): R = TODO() fun smartIt(p1: String?, p2: String?) { p1 ?: callIt { TODO() } - p1.length // smartcast + p1.length // smartcast } diff --git a/compiler/testData/diagnostics/tests/smartCasts/level_1_0.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/level_1_0.fir.kt index 346542ace59..7fd08a927d0 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/level_1_0.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/level_1_0.fir.kt @@ -36,7 +36,7 @@ fun kt6840_2(s: String?) { fun kt1635(s: String?) { s?.hashCode()!! - s.hashCode() + s.hashCode() } fun kt2127() { diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/WhileTrueWithBreakInIfCondition.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/WhileTrueWithBreakInIfCondition.fir.kt index 6845ef8007c..168d317f4f4 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/WhileTrueWithBreakInIfCondition.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/WhileTrueWithBreakInIfCondition.fir.kt @@ -9,5 +9,5 @@ fun checkJump(x: Int?, y: Int?) { y.hashCode() } // Smart cast here is erroneous: y is nullable - y.hashCode() + y.hashCode() } diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/assignElvisIfBreakInsideWhileTrue.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/assignElvisIfBreakInsideWhileTrue.fir.kt index 9111346bc48..d33da59cc71 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/assignElvisIfBreakInsideWhileTrue.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/assignElvisIfBreakInsideWhileTrue.fir.kt @@ -4,8 +4,8 @@ public fun foo(x: String?, y: String?): Int { // z is not null in both branches z.length // y is nullable if x != null - y.length + y.length } // y is null because of the break - return y.length + return y.length } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/assignWhenInsideWhileTrue.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/assignWhenInsideWhileTrue.fir.kt index 0b12ef102a4..9ae054e7a89 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/assignWhenInsideWhileTrue.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/assignWhenInsideWhileTrue.fir.kt @@ -13,5 +13,5 @@ public fun foo(x: String?): Int { checkSubtype(y) } // x is null because of the break - return x.length + return x.length } diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/callBreakBetweenInsideDoWhile.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/callBreakBetweenInsideDoWhile.fir.kt index a9e1d123967..5f6a3ef3f84 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/callBreakBetweenInsideDoWhile.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/callBreakBetweenInsideDoWhile.fir.kt @@ -10,7 +10,7 @@ public fun foo(x: String?, z: String?, w: String?): Int { // w is not null because of w!! w.length // z is nullable despite of z!! - z.length + z.length // x is null because of the break - return x.length + return x.length } diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/callBreakFirstInsideDoWhile.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/callBreakFirstInsideDoWhile.fir.kt index d1a1765e5c0..91cd9cd460a 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/callBreakFirstInsideDoWhile.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/callBreakFirstInsideDoWhile.fir.kt @@ -7,7 +7,7 @@ public fun foo(x: String?, z: String?): Int { gav(if (x == null) break else x, z!!) } while (bar()) // z is nullable despite of z!! - z.length + z.length // x is null because of the break - return x.length + return x.length } diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/callBreakInsideDoWhile.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/callBreakInsideDoWhile.fir.kt index a77c2dcad2a..1c48328167c 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/callBreakInsideDoWhile.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/callBreakInsideDoWhile.fir.kt @@ -10,5 +10,5 @@ public fun foo(x: String?): Int { } while (bar()) y.hashCode() // x is null because of the break - return x.length + return x.length } diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/callBreakSecondInsideDoWhile.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/callBreakSecondInsideDoWhile.fir.kt index a7b8ba39bb1..0e7ba8e3c8d 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/callBreakSecondInsideDoWhile.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/callBreakSecondInsideDoWhile.fir.kt @@ -9,5 +9,5 @@ public fun foo(x: String?, z: String?): Int { // z is not null because of z!! z.length // x is null because of the break - return x.length + return x.length } diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/callBreakThirdInsideDoWhile.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/callBreakThirdInsideDoWhile.fir.kt index b45f2842eeb..b9bd9023c2f 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/callBreakThirdInsideDoWhile.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/callBreakThirdInsideDoWhile.fir.kt @@ -12,5 +12,5 @@ public fun foo(x: String?, z: String?, w: String?): Int { // z is not null because of z!! z.length // x is null because of the break - return x.length + return x.length } diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileEarlyBreak.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileEarlyBreak.fir.kt index dea1d2e8b1a..fc422b57203 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileEarlyBreak.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileEarlyBreak.fir.kt @@ -9,5 +9,5 @@ public fun foo(p: String?): Int { p!!.length } while (!x()) // Here we have do while loop but p is still nullable due to break before - return p.length + return p.length } diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileInConditionWithBreak.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileInConditionWithBreak.fir.kt index 5729e3b9e2f..67cac1f788a 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileInConditionWithBreak.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileInConditionWithBreak.fir.kt @@ -5,5 +5,5 @@ fun foo(s: String?): Int { if (bar()) break } while (s!!.length > 0) // This call is unsafe due to break - return s.length + return s.length } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileNotNullBreak.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileNotNullBreak.fir.kt index 8a5997a41d4..1b666f7e37e 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileNotNullBreak.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileNotNullBreak.fir.kt @@ -6,5 +6,5 @@ public fun foo(p: String?): Int { if (p != null) break } while (!x()) // p can be null despite of the break - return p.length + return p.length } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileNullWithBreak.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileNullWithBreak.fir.kt index 5692b83191a..5bda17d85b3 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileNullWithBreak.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileNullWithBreak.fir.kt @@ -5,5 +5,5 @@ fun foo(s: String?): Int { if (bar()) break } while (s==null) // This call is unsafe due to break - return s.length + return s.length } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/elvisBreakInsideDoWhile.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/elvisBreakInsideDoWhile.fir.kt index fdc21aa554b..ee74f603b96 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/elvisBreakInsideDoWhile.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/elvisBreakInsideDoWhile.fir.kt @@ -6,5 +6,5 @@ public fun foo(x: String?): Int { x.length } while (true) // x is null because of the break - return x.length + return x.length } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/elvisIfBreakInsideWhileTrue.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/elvisIfBreakInsideWhileTrue.fir.kt index 0a74bf6f435..0f01873f47a 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/elvisIfBreakInsideWhileTrue.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/elvisIfBreakInsideWhileTrue.fir.kt @@ -2,8 +2,8 @@ public fun foo(x: String?, y: String?): Int { while (true) { x ?: if (y == null) break // y is nullable if x != null - y.length + y.length } // y is null because of the break - return y.length + return y.length } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/elvisLeftBreakInsideWhileTrue.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/elvisLeftBreakInsideWhileTrue.fir.kt index 7aa1f53bdca..0b4a792714c 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/elvisLeftBreakInsideWhileTrue.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/elvisLeftBreakInsideWhileTrue.fir.kt @@ -2,8 +2,8 @@ public fun foo(x: String?, y: String?): Int { while (true) { (if (x != null) break else y) ?: y!! // y is not null in both branches but it's hard to determine - y.length + y.length } // y can be null because of the break - return y.length + return y.length } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/ifBreakAssignInsideDoWhile.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/ifBreakAssignInsideDoWhile.fir.kt index 48e4c8a2b03..98b61acb518 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/ifBreakAssignInsideDoWhile.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/ifBreakAssignInsideDoWhile.fir.kt @@ -10,5 +10,5 @@ public fun foo(x: String?): Int { } while (bar()) y.hashCode() // x is null because of the break - return x.length + return x.length } diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/ifBreakAssignInsideWhileTrue.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/ifBreakAssignInsideWhileTrue.fir.kt index 241ae124690..ec66a50a872 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/ifBreakAssignInsideWhileTrue.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/ifBreakAssignInsideWhileTrue.fir.kt @@ -6,5 +6,5 @@ public fun foo(x: String?): Int { // In future we can infer this initialization y.hashCode() // x is null because of the break - return x.length + return x.length } diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/ifBreakExprInsideWhileTrue.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/ifBreakExprInsideWhileTrue.fir.kt index a3220877033..8234f7efc5a 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/ifBreakExprInsideWhileTrue.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/ifBreakExprInsideWhileTrue.fir.kt @@ -6,5 +6,5 @@ public fun foo(x: String?): Int { y.length } // x is null because of the break - return x.length + return x.length } diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/leftElvisBreakInsideWhileTrue.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/leftElvisBreakInsideWhileTrue.fir.kt index 5015104c49a..9b7d6777452 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/leftElvisBreakInsideWhileTrue.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/leftElvisBreakInsideWhileTrue.fir.kt @@ -7,5 +7,5 @@ public fun foo(x: String?, y: String?): Int { y.length } // y is null because of the break - return y.length + return y.length } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/nestedLoopsWithLongBreak.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/nestedLoopsWithLongBreak.fir.kt index a2a469d11d5..de8e7ba820a 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/nestedLoopsWithLongBreak.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/nestedLoopsWithLongBreak.fir.kt @@ -13,7 +13,7 @@ public fun foo(p: String?, r: String?, q: String?): Int { if (!x(p)) break } // Long break allows r == null - r.length + r.length // Smart cast is possible q.length return p.length diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/plusAssignWhenInsideDoWhile.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/plusAssignWhenInsideDoWhile.fir.kt index c19bcee7f8c..47c7213a4ff 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/plusAssignWhenInsideDoWhile.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/plusAssignWhenInsideDoWhile.fir.kt @@ -18,5 +18,5 @@ public fun foo(x: String?): Int { // y is always Int even here checkSubtype(y) // x is null because of the break - return x.length + return x.length } diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/whenInsideWhileTrue.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/whenInsideWhileTrue.fir.kt index 28f75d8ae24..ce14ee4a22e 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/whenInsideWhileTrue.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/whenInsideWhileTrue.fir.kt @@ -8,5 +8,5 @@ public fun foo(x: String?): Int { } } // x is null because of the break - return x.length + return x.length } diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/whileNullWithBreak.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/whileNullWithBreak.fir.kt index c52d962227f..6eaa9dce0c5 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/whileNullWithBreak.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/whileNullWithBreak.fir.kt @@ -5,5 +5,5 @@ fun foo(s: String?): Int { if (bar()) break } // Call is unsafe due to break - return s.length + return s.length } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/whileSimple.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/whileSimple.fir.kt index 641f5dbccf8..292c3289fc8 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/whileSimple.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/whileSimple.fir.kt @@ -6,5 +6,5 @@ public fun foo(p: String?): Int { if (x()) break } // p is nullable because it's possible loop body is not executed at all - return p.length + return p.length } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/whileTrivial.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/whileTrivial.fir.kt index 70958f55081..a8e4f6eaaa4 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/whileTrivial.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/whileTrivial.fir.kt @@ -7,5 +7,5 @@ public fun foo(p: String?): Int { if (x()) break } // Smart cast should not work in this case, see KT-6284 - return p.length + return p.length } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/whileTrueBreakReturn.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/whileTrueBreakReturn.fir.kt index 26d79bd116d..f17eb58eed8 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/whileTrueBreakReturn.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/whileTrueBreakReturn.fir.kt @@ -8,5 +8,5 @@ public fun foo(p: String?): Int { p.length } // p can be null because break is earlier than return - return p.length + return p.length } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/whileTrueEarlyBreak.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/whileTrueEarlyBreak.fir.kt index 08daf2b657e..13bf41a0571 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/whileTrueEarlyBreak.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/whileTrueEarlyBreak.fir.kt @@ -7,5 +7,5 @@ public fun foo(p: String?): Int { p!!.length } // Here we have while (true) loop but p is nullable due to break before - return p.length + return p.length } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/whileWithAssertInConditionAndBreakAfter.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/whileWithAssertInConditionAndBreakAfter.fir.kt index 6d6c717a1d9..bd00cf67aa3 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/whileWithAssertInConditionAndBreakAfter.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/whileWithAssertInConditionAndBreakAfter.fir.kt @@ -8,7 +8,7 @@ fun foo() { } // TODO: this testdata fixates undesired behavior (it should be an unsafe call) - x.length // 'x' is unsoundly smartcasted here + x.length // 'x' is unsoundly smartcasted here } fun bar() { @@ -19,5 +19,5 @@ fun bar() { } // TODO: this testdata fixates undesired behavior (it should be an unsafe call) - x.size // 'x' is unsoundly smartcasted here + x.size // 'x' is unsoundly smartcasted here } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/whileWithAssertInConditionAndBreakBefore.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/whileWithAssertInConditionAndBreakBefore.fir.kt index 1af837174c9..bc203cb2564 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/whileWithAssertInConditionAndBreakBefore.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/whileWithAssertInConditionAndBreakBefore.fir.kt @@ -7,7 +7,7 @@ fun foo() { break } - x.length // 'x' is unsoundly smartcasted here + x.length // 'x' is unsoundly smartcasted here } fun bar() { @@ -17,5 +17,5 @@ fun bar() { break } - x.size // 'x' is unsoundly smartcasted here + x.size // 'x' is unsoundly smartcasted here } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/objectLiterals/kt7110.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/objectLiterals/kt7110.fir.kt index 9db5e130a9c..a7c686d1143 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/objectLiterals/kt7110.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/objectLiterals/kt7110.fir.kt @@ -7,5 +7,5 @@ abstract class A(val s: String) { fun foo(o: String?): Int { val a = object : A(o!!){} a.bar() - return o.length + return o.length } diff --git a/compiler/testData/diagnostics/tests/smartCasts/openInSealed.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/openInSealed.fir.kt index 5011c17372d..bdd8e40e512 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/openInSealed.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/openInSealed.fir.kt @@ -2,7 +2,7 @@ sealed class My(open val x: Int?) { init { if (x != null) { // Should be error: property is open - x.hashCode() + x.hashCode() } } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/ownerDeclaresBothModifies.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/ownerDeclaresBothModifies.fir.kt index 9059f8bb307..220b5a5acdb 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/ownerDeclaresBothModifies.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/ownerDeclaresBothModifies.fir.kt @@ -9,5 +9,5 @@ fun foo(arg: Int?) { } if (x != null) x = 42 // Unsafe because of lambda - x.hashCode() + x.hashCode() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/publicVals/customGetter.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/publicVals/customGetter.fir.kt index a6c9e093e31..3283419eeea 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/publicVals/customGetter.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/publicVals/customGetter.fir.kt @@ -5,7 +5,7 @@ public class X { public fun fn(): Int { if (y != null) // With non-default getter smartcast is not possible - return y.length + return y.length else return 0 } diff --git a/compiler/testData/diagnostics/tests/smartCasts/publicVals/open.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/publicVals/open.fir.kt index b0456ab94de..1cd64d4f5e7 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/publicVals/open.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/publicVals/open.fir.kt @@ -7,5 +7,5 @@ infix fun Int.bar(i: Int) = i fun test() { val p = A() // For open value properties, smart casts should not work - if (p.foo is Int) p.foo bar 11 + if (p.foo is Int) p.foo bar 11 } diff --git a/compiler/testData/diagnostics/tests/smartCasts/publicVals/var.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/publicVals/var.fir.kt index e413b118cbf..8b43b66f59c 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/publicVals/var.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/publicVals/var.fir.kt @@ -4,10 +4,10 @@ public class X { public fun fn(): Int { if (x != null) // Smartcast is not possible for variable properties - return x.length + return x.length else if (y != null) // Even if they are private - return y.length + return y.length else return 0 } diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/argument.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/argument.fir.kt index 381263e32e8..a09a86e9b36 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/argument.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/argument.fir.kt @@ -2,5 +2,5 @@ fun calc(x: List?): Int { // After KT-5840 fix !! assertion should become unnecessary here x?.get(x!!.size - 1) // x?. or x!! above should not provide smart cast here - return x.size + return x.size } diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/chainMixedUnsafe.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/chainMixedUnsafe.fir.kt index 188d1a4eb5e..626a304de1b 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/chainMixedUnsafe.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/chainMixedUnsafe.fir.kt @@ -1,5 +1,5 @@ fun calc(x: List?): Int { // x is not-null only inside subList - x?.subList(0, x.size - 1).get(x.size) + x?.subList(0, x.size - 1).get(x.size) return x!!.size } diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/doubleCall.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/doubleCall.fir.kt index 5590814b6c2..6e579a9c4ed 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/doubleCall.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/doubleCall.fir.kt @@ -2,5 +2,5 @@ fun calc(x: List?): Int { // x should be non-null in arguments list, including inner call x?.get(x.get(x.size - 1).length) // but not also here! - return x.size + return x.size } diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/innerReceiver.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/innerReceiver.fir.kt index b1016ada479..b8eb112e3b9 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/innerReceiver.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/innerReceiver.fir.kt @@ -4,5 +4,5 @@ fun calc(x: String?, y: String?): Int { // Smart cast because of y!! in receiver x?.subSequence(y!!.subSequence(0, 1).length, y.length) // No smart cast possible - return y.length + return y.length } diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/insideIfExpr.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/insideIfExpr.fir.kt index 4593c469564..f48d7247887 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/insideIfExpr.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/insideIfExpr.fir.kt @@ -10,14 +10,14 @@ fun foo() { } else { s?.length } - ss.hashCode() // Smart-cast to Int, should be unsafe call + ss.hashCode() // Smart-cast to Int, should be unsafe call val sss = if (true) { s?.copy } else { s?.copy } - sss.length + sss.length } class My { @@ -31,13 +31,13 @@ class My { } else { s?.length } - ss.hashCode() + ss.hashCode() val sss = if (true) { s?.copy2 } else { s?.copy2 } - sss.length + sss.length } } diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiver.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiver.fir.kt index f5f30b02038..89fa1a6820f 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiver.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiver.fir.kt @@ -4,9 +4,9 @@ class Foo(val bar: String) fun test(foo: Foo?) { foo?.bar.let { // Error, foo?.bar is nullable - it.length + it.length // Error, foo is nullable - foo.bar.length + foo.bar.length // Correct foo?.bar?.length } diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverInLongChain.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverInLongChain.fir.kt index ecc2789719d..eac3fe6a690 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverInLongChain.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverInLongChain.fir.kt @@ -11,22 +11,22 @@ fun String.notNullLet(f: (String) -> Unit) = f(this) fun test(foo: Foo?) { foo?.bar?.gav.let { // Error, foo?.bar?.gav is nullable - it.length + it.length // Error, foo is nullable - foo.bar.gav.length + foo.bar.gav.length // Correct foo?.bar?.gav?.length } foo?.bar?.gav.call { it }?.notNullLet { - foo.hashCode() - foo.bar.hashCode() + foo.hashCode() + foo.bar.hashCode() } } fun testNotNull(foo: Foo) { val s: String? = "" foo.baz(s!!)?.gav.let { - it.length + it.length // Ok because of foo. s.length.hashCode() } @@ -35,7 +35,7 @@ fun testNotNull(foo: Foo) { fun testNullable(foo: Foo?) { val s: String? = "" foo?.baz(s!!)?.gav.let { - it.length + it.length // Ok because of foo?. s?.length?.hashCode() } diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverWithFlexible.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverWithFlexible.fir.kt index 0743b51b49d..6c6b3d7b15e 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverWithFlexible.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverWithFlexible.fir.kt @@ -16,7 +16,7 @@ fun test() { val foo = Foo.create(null) foo?.bar.let { // Error, foo?.bar is nullable - it.length + it.length // Foo is nullable but flexible, so call is considered safe here foo.bar.length // Correct diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/safeAccessReceiverNotNull.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/safeAccessReceiverNotNull.fir.kt index 3294fdd5dc8..0aba569f424 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/safeAccessReceiverNotNull.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/safeAccessReceiverNotNull.fir.kt @@ -18,7 +18,7 @@ fun kt6840_2(s: String?) { fun kt1635(s: String?) { s?.hashCode()!! - s.hashCode() + s.hashCode() } fun kt2127() { @@ -80,7 +80,7 @@ fun useA(a: A): Int = a.hashCode() fun kt7491_2() { val a = getA() - (a?.let { useA(a) } ?: a.y ).toString() + (a?.let { useA(a) } ?: a.y ).toString() } fun String.correct() = true @@ -88,7 +88,7 @@ fun String.correct() = true fun kt8492(s: String?) { if (s?.correct() ?: false) { // To be supported - s.length + s.length } } @@ -118,7 +118,7 @@ class Wrapper { fun falsePositive(w: Wrapper) { if (w.unwrap() != null) { // Here we should NOT have smart cast - w.unwrap().length + w.unwrap().length } } diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/simple.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/simple.fir.kt index 31d8b7c2458..f46376751e0 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/simple.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/simple.fir.kt @@ -2,5 +2,5 @@ fun calc(x: List?): Int { // x should be non-null in arguments list x?.get(x.size - 1) // but not also here! - return x.size + return x.size } diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/twoArgs.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/twoArgs.fir.kt index 7017e9b2446..0a7578ac04c 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/twoArgs.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/twoArgs.fir.kt @@ -2,5 +2,5 @@ fun calc(x: List?): Int { // x should be non-null in arguments list x?.subList(x.size - 1, x.size) // but not also here! - return x.size + return x.size } diff --git a/compiler/testData/diagnostics/tests/smartCasts/smartCastOnWhen.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/smartCastOnWhen.fir.kt index 21e5d618786..956fddab24d 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/smartCastOnWhen.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/smartCastOnWhen.fir.kt @@ -15,6 +15,6 @@ fun bar(): Int { return when(ss) { "abc" -> ss else -> "xyz" - }.length + }.length } diff --git a/compiler/testData/diagnostics/tests/smartCasts/smartcastOnSameFieldOfDifferentInstances.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/smartcastOnSameFieldOfDifferentInstances.fir.kt index 464e07a5964..5d103f9d0d6 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/smartcastOnSameFieldOfDifferentInstances.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/smartcastOnSameFieldOfDifferentInstances.fir.kt @@ -5,7 +5,7 @@ class A(val x: String?) { fun foo(other: A) { when { x == null && other.x == null -> "1" - x.length > 0 -> "2" + x.length > 0 -> "2" } } } diff --git a/compiler/testData/diagnostics/tests/smartCasts/unstableToStable.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/unstableToStable.fir.kt index 98563e4ea6c..ac6ba703d48 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/unstableToStable.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/unstableToStable.fir.kt @@ -3,15 +3,15 @@ class Foo(var x: Int?) { if (x != null) { val y = x // Error: x is not stable, Type(y) = Int? - x.hashCode() - y.hashCode() + x.hashCode() + y.hashCode() if (y == x) { // Still error - y.hashCode() + y.hashCode() } if (x == null && y != x) { // Still error - y.hashCode() + y.hashCode() } } } diff --git a/compiler/testData/diagnostics/tests/smartCasts/variables/lambdaBetweenArguments.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/variables/lambdaBetweenArguments.fir.kt index d7c52abd0f1..fe3bf6d9c91 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/variables/lambdaBetweenArguments.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/variables/lambdaBetweenArguments.fir.kt @@ -6,5 +6,5 @@ fun foo(x: Int, f: () -> Unit, y: Int) {} fun bar() { var x: Int? x = 4 - foo(x, { x = null; x.hashCode() }, x) + foo(x, { x = null; x.hashCode() }, x) } diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/assignment.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/assignment.fir.kt index 0dce64de076..8ec130dfe67 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/assignment.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/assignment.fir.kt @@ -1,11 +1,11 @@ // !WITH_NEW_INFERENCE fun foo() { var v: String? = null - v.length + v.length v = "abc" v.length v = null - v.length + v.length v = "abc" v.length } diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/boundInitializerWrong.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/boundInitializerWrong.fir.kt index d424d141dd5..0c7204ecaa3 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/boundInitializerWrong.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/boundInitializerWrong.fir.kt @@ -23,7 +23,7 @@ fun bar(s: String?) { val hashCode = ss?.hashCode() ss = null if (hashCode != null) { - ss.hashCode() + ss.hashCode() } } @@ -41,6 +41,6 @@ fun baz(arg: Some?) { val ss = arg?.s if (ss != null) { arg.hashCode() - arg.s.hashCode() + arg.s.hashCode() } } diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/initInTryReturnInCatch.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/initInTryReturnInCatch.fir.kt index 0735df90d8d..8d988515094 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/initInTryReturnInCatch.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/initInTryReturnInCatch.fir.kt @@ -37,7 +37,7 @@ fun test3() { catch (e: B) { return } - a.hashCode() // a is nullable here + a.hashCode() // a is nullable here } fun test4() { var a: Int? = null @@ -50,7 +50,7 @@ fun test4() { catch (e: B) { return } - a.hashCode() // a is nullable here + a.hashCode() // a is nullable here } fun test5() { var a: Int?// = null @@ -76,5 +76,5 @@ fun test6() { finally { a = null } - a.hashCode() // a is null here + a.hashCode() // a is null here } diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/initialization.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/initialization.fir.kt index 430868a8b0c..e2f610bd2ea 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/initialization.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/initialization.fir.kt @@ -2,7 +2,7 @@ fun foo() { var v: String? = "xyz" // It is possible in principle to provide smart cast here - v.length + v.length v = null - v.length + v.length } diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/nestedWhile.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/nestedWhile.fir.kt index 828d2c611d1..2e72334ca0b 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/nestedWhile.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/nestedWhile.fir.kt @@ -12,7 +12,7 @@ fun foo(): Bar { var y: Bar? = Bar() while (x != null) { // Here call is unsafe because of initialization and also inner loop - y.next() + y.next() while (y != null) { if (x == y) // x is not null because of outer while diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/plusplusMinusminus.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/plusplusMinusminus.fir.kt index 1cfb9d42787..6990adf9fa8 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/plusplusMinusminus.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/plusplusMinusminus.fir.kt @@ -12,7 +12,7 @@ operator fun Long?.inc() = this?.let { it + 1 } fun bar(arg: Long?): Long { var i = arg if (i++ == 5L) { - return i-- + i + return i-- + i } if (i++ == 7L) { return i++ + i diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNullableIncrement.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNullableIncrement.fir.kt index 6dbcb1dd091..596ca003a75 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNullableIncrement.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNullableIncrement.fir.kt @@ -3,6 +3,6 @@ operator fun Int?.inc(): Int? { return this } public fun box(arg: Int?) : Int? { var i : Int? = arg var j = i++ - j.toInt() + j.toInt() return i } diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNullableClassIncrement.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNullableClassIncrement.fir.kt index a01f7ac8164..1a85571d761 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNullableClassIncrement.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNullableClassIncrement.fir.kt @@ -9,5 +9,5 @@ public fun box() { // type of j should be MyClass? var j = ++i // j is null so call should be unsafe - j.hashCode() + j.hashCode() } diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNullableIncrement.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNullableIncrement.fir.kt index 25f99500d48..9288f78fe11 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNullableIncrement.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNullableIncrement.fir.kt @@ -3,6 +3,6 @@ operator fun Int?.inc(): Int? { return this } public fun box(arg: Int?) : Int? { var i = arg var j = ++i - j.toInt() + j.toInt() return ++j } diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNotNullInTry.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNotNullInTry.fir.kt index b80a9706116..55e0426d009 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNotNullInTry.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNotNullInTry.fir.kt @@ -10,5 +10,5 @@ fun foo() { } catch (ex: Exception) {} bar(s) if (s != null) { } - s.hashCode() + s.hashCode() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNullInTry.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNullInTry.fir.kt index 3a1e43458db..07519649c8c 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNullInTry.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNullInTry.fir.kt @@ -6,5 +6,5 @@ fun foo() { try { s = null } catch (ex: Exception) {} - s.hashCode() + s.hashCode() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNullInTryFinally.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNullInTryFinally.fir.kt index ed810c42613..52ed2372cd6 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNullInTryFinally.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNullInTryFinally.fir.kt @@ -12,5 +12,5 @@ fun foo() { finally { bar() } - s.hashCode() + s.hashCode() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNullInTryUnsound.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNullInTryUnsound.fir.kt index 95d50e9267d..faa6fb418dd 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNullInTryUnsound.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNullInTryUnsound.fir.kt @@ -6,5 +6,5 @@ fun foo() { try { s = null } catch (ex: Exception) {} - s.hashCode() + s.hashCode() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/unnecessaryWithMap.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/unnecessaryWithMap.fir.kt index cf186a5270e..e7d39fb3d7d 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/unnecessaryWithMap.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/unnecessaryWithMap.fir.kt @@ -14,7 +14,7 @@ class MyClass { var res = 0 m = create() // See KT-7428 - for ((k, v) in m) + for ((k, v) in m) res += (k.length + v.length) return res } diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/varNull.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/varNull.fir.kt index e70c299a0d1..050f108d5fc 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/varNull.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/varNull.fir.kt @@ -2,5 +2,5 @@ fun foo(): Int { var s: String? = "abc" s = null - return s.length + return s.length } diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/TypeAnnotation.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/TypeAnnotation.fir.kt index 65a01fde9de..d939f5286e1 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/TypeAnnotation.fir.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/TypeAnnotation.fir.kt @@ -1,7 +1,7 @@ // FILE: KotlinFile.kt fun foo(javaClass: JavaClass) { - javaClass.getSomething().length - javaClass.something.length + javaClass.getSomething().length + javaClass.something.length } // FILE: JavaClass.java diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/ReturnTypeAnnotation.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/ReturnTypeAnnotation.fir.kt index bdf5d30e43e..62dbadb3447 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/ReturnTypeAnnotation.fir.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/ReturnTypeAnnotation.fir.kt @@ -1,7 +1,7 @@ // FILE: KotlinFile.kt fun foo(javaInterface: JavaInterface) { val value = javaInterface.compute { "" } - value.length + value.length } // FILE: JavaInterface.java diff --git a/compiler/testData/diagnostics/tests/targetedBuiltIns/forEachRemainingNullability.fir.kt b/compiler/testData/diagnostics/tests/targetedBuiltIns/forEachRemainingNullability.fir.kt index de1fde585d4..225842d3c4c 100644 --- a/compiler/testData/diagnostics/tests/targetedBuiltIns/forEachRemainingNullability.fir.kt +++ b/compiler/testData/diagnostics/tests/targetedBuiltIns/forEachRemainingNullability.fir.kt @@ -36,6 +36,6 @@ fun foo(x: Iterator, y: Iterator) { x.forEachRemaining { it -> it.length } x.forEachRemaining { it -> it?.length } - y.forEachRemaining { it -> it.length } + y.forEachRemaining { it -> it.length } y.forEachRemaining { it -> it?.length } } diff --git a/compiler/testData/diagnostics/tests/testWithModifiedMockJdk/notConsideredMethod.fir.kt b/compiler/testData/diagnostics/tests/testWithModifiedMockJdk/notConsideredMethod.fir.kt index bba63299a6f..2e099e73d93 100644 --- a/compiler/testData/diagnostics/tests/testWithModifiedMockJdk/notConsideredMethod.fir.kt +++ b/compiler/testData/diagnostics/tests/testWithModifiedMockJdk/notConsideredMethod.fir.kt @@ -7,7 +7,7 @@ interface A : MutableCollection { } fun foo(x: MutableCollection, y: Collection, z: A) { - x.nonExistingMethod(1).checkType { _() } + x.nonExistingMethod(1).checkType { _() } y.nonExistingMethod("") z.nonExistingMethod("") } diff --git a/compiler/testData/diagnostics/tests/unsignedTypes/conversions/inferenceForSignedAndUnsignedTypes.fir.kt b/compiler/testData/diagnostics/tests/unsignedTypes/conversions/inferenceForSignedAndUnsignedTypes.fir.kt index 7b1e8c134a6..0a5a18e0526 100644 --- a/compiler/testData/diagnostics/tests/unsignedTypes/conversions/inferenceForSignedAndUnsignedTypes.fir.kt +++ b/compiler/testData/diagnostics/tests/unsignedTypes/conversions/inferenceForSignedAndUnsignedTypes.fir.kt @@ -14,7 +14,7 @@ fun foo() { takeUByte(id(1)) 1 + 1u - (1u + 1) checkType { _() } + (1u + 1) checkType { _() } id(1) } diff --git a/compiler/testData/diagnostics/tests/unsignedTypes/conversions/overloadResolutionForSignedAndUnsignedTypes.fir.kt b/compiler/testData/diagnostics/tests/unsignedTypes/conversions/overloadResolutionForSignedAndUnsignedTypes.fir.kt index 4b5009d5183..135d3bc7ec1 100644 --- a/compiler/testData/diagnostics/tests/unsignedTypes/conversions/overloadResolutionForSignedAndUnsignedTypes.fir.kt +++ b/compiler/testData/diagnostics/tests/unsignedTypes/conversions/overloadResolutionForSignedAndUnsignedTypes.fir.kt @@ -21,7 +21,7 @@ fun test() { foo(1) checkType { _() } foo(1u) checkType { _() } - foo(2147483648) checkType { _() } + foo(2147483648) checkType { _() } foo(2147483647 + 1) checkType { _() } fooByte(1) checkType { _() } diff --git a/compiler/testData/diagnostics/tests/when/withSubjectVariable/capturingInInitializer.fir.kt b/compiler/testData/diagnostics/tests/when/withSubjectVariable/capturingInInitializer.fir.kt index d8ed1e80497..ff3ca7cb0a5 100644 --- a/compiler/testData/diagnostics/tests/when/withSubjectVariable/capturingInInitializer.fir.kt +++ b/compiler/testData/diagnostics/tests/when/withSubjectVariable/capturingInInitializer.fir.kt @@ -27,11 +27,11 @@ fun testUnsafeCaptureVarInInitializer() { val s = when (val y = run { x = null; 32 }) { 0 -> { - x.inc() // NB smart cast should be impossible + x.inc() // NB smart cast should be impossible "0" } else -> "!= 0" } - x.inc() // NB smart cast should be impossible + x.inc() // NB smart cast should be impossible } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/when/withSubjectVariable/jumpoutInInitializer.fir.kt b/compiler/testData/diagnostics/tests/when/withSubjectVariable/jumpoutInInitializer.fir.kt index e6b6b7894f2..22d8bec9894 100644 --- a/compiler/testData/diagnostics/tests/when/withSubjectVariable/jumpoutInInitializer.fir.kt +++ b/compiler/testData/diagnostics/tests/when/withSubjectVariable/jumpoutInInitializer.fir.kt @@ -12,7 +12,7 @@ fun testJumpOutInElvis(x: Int?) { x.inc() } - x.inc() + x.inc() } fun testJumpOutInElvisLikeIf(x: Int?) { @@ -24,7 +24,7 @@ fun testJumpOutInElvisLikeIf(x: Int?) { x.inc() } - x.inc() + x.inc() } @@ -36,7 +36,7 @@ fun testJumpOutInIf(x: Int?) { 0 -> "0" else -> "not 0" } - x.inc() + x.inc() } x.inc() // Actually, safe, but it's OK if it's error diff --git a/compiler/testData/diagnostics/tests/when/withSubjectVariable/smartCastOnValueBoundToSubjectVariable.fir.kt b/compiler/testData/diagnostics/tests/when/withSubjectVariable/smartCastOnValueBoundToSubjectVariable.fir.kt index c93e8c1f329..c68e4f16a15 100644 --- a/compiler/testData/diagnostics/tests/when/withSubjectVariable/smartCastOnValueBoundToSubjectVariable.fir.kt +++ b/compiler/testData/diagnostics/tests/when/withSubjectVariable/smartCastOnValueBoundToSubjectVariable.fir.kt @@ -18,8 +18,8 @@ fun test2(x: String?) { fun test3(x: String?, y: String?) { when (val z = x ?: y!!) { - "foo" -> x.length - "bar" -> y.length + "foo" -> x.length + "bar" -> y.length "baz" -> z.length } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/fromStdlib/isNullOrBlank.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/fromStdlib/isNullOrBlank.fir.kt index 443bdf08694..7d77791f6e6 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/fromStdlib/isNullOrBlank.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/fromStdlib/isNullOrBlank.fir.kt @@ -3,7 +3,7 @@ fun testIsNullOrBlank(x: String?) { if (x.isNullOrBlank()) { - x.length + x.length } else { x.length @@ -15,6 +15,6 @@ fun testIsNotNullOrBlank(x: String?) { x.length } - x.length + x.length } diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/fromStdlib/isNullOrEmpty.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/fromStdlib/isNullOrEmpty.fir.kt index c096243d0a9..5b942185d8c 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/fromStdlib/isNullOrEmpty.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/fromStdlib/isNullOrEmpty.fir.kt @@ -3,7 +3,7 @@ fun testIsNullOrEmpty(x: String?) { if (x.isNullOrEmpty()) { - x.length + x.length } else { x.length @@ -15,6 +15,6 @@ fun testIsNotNullOrEmpty(x: String?) { x.length } - x.length + x.length } diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/extensionReceiver.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/extensionReceiver.fir.kt index c1f71e56f15..1a09ae91bb5 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/extensionReceiver.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/extensionReceiver.fir.kt @@ -17,7 +17,7 @@ fun CharSequence?.isNullOrEmpty(): Boolean { fun smartcastOnReceiver(s: String?) { with(s) { if (isNullOrEmpty()) { - length + length } else { length @@ -32,7 +32,7 @@ fun mixedReceiver(s: String?) { } } else { with(s) { - length + length } } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/extensionReceiver_after.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/extensionReceiver_after.fir.kt index d82ea265323..3037bd6a083 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/extensionReceiver_after.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/extensionReceiver_after.fir.kt @@ -17,7 +17,7 @@ fun CharSequence?.isNullOrEmpty(): Boolean { fun smartcastOnReceiver(s: String?) { with(s) { if (isNullOrEmpty()) { - length + length } else { length @@ -32,7 +32,7 @@ fun mixedReceiver(s: String?) { } } else { with(s) { - length + length } } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/nullabilitySmartcastWhenNullability.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/nullabilitySmartcastWhenNullability.fir.kt index 1942a197c38..4afb690ba1c 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/nullabilitySmartcastWhenNullability.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/nullabilitySmartcastWhenNullability.fir.kt @@ -14,7 +14,7 @@ fun nullWhenNull(x: Int?): Int? { fun testNullWhenNull(x: Int?) { if (nullWhenNull(x) == null) { - x.dec() + x.dec() } else { x.dec() @@ -24,10 +24,10 @@ fun testNullWhenNull(x: Int?) { x.dec() } else { - x.dec() + x.dec() } - x.dec() + x.dec() } // NB. it is the same function as `nullWhenNull`, but annotations specifies other facet of the function behaviour @@ -43,15 +43,15 @@ fun testNotNullWhenNotNull (x: Int?) { x == null } else { - x.dec() + x.dec() } if (notNullWhenNotNull(x) != null) { - x.dec() + x.dec() } else { x == null } - x.dec() + x.dec() } diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/operatorsTests/equalsOperator.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/operatorsTests/equalsOperator.fir.kt index 56fd68cd5e6..cd49f2c178e 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/operatorsTests/equalsOperator.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/operatorsTests/equalsOperator.fir.kt @@ -20,28 +20,28 @@ fun myEqualsNotNull(x: Int?): Boolean { } fun testBasicEquals(x: Int?) { - x.inc() + x.inc() if (myEqualsNull(x)) { - x.inc() + x.inc() } else { x.inc() } - x.inc() + x.inc() } fun testBasicNotEquals(x: Int?) { - x.inc() + x.inc() if (myEqualsNotNull(x)) { x.inc() } else { - x.inc() + x.inc() } - x.inc() + x.inc() } diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/receiver.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/receiver.fir.kt index de76d236c58..31e6a20b5c8 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/receiver.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/receiver.fir.kt @@ -14,7 +14,7 @@ fun Any?.isNull(): Boolean { fun smartcastOnReceiver(x: Int?) { if (x.isNull()) { - x.inc() + x.inc() } else { x.dec() @@ -26,10 +26,10 @@ class UnstableReceiver { fun smartcastOnUnstableReceiver() { if (x.isNull()) { - x.inc() + x.inc() } else { - x.dec() + x.dec() } } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/valueOfContractedFunctionIngored.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/valueOfContractedFunctionIngored.fir.kt index 00937d84442..d4cd0aca299 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/valueOfContractedFunctionIngored.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/valueOfContractedFunctionIngored.fir.kt @@ -6,6 +6,6 @@ import kotlin.contracts.* fun f3(value: String?) { if (!value.isNullOrEmpty() is Boolean) { - value.length + value.length } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt36947.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt36947.fir.kt index 120c8563911..934c889f46f 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt36947.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt36947.fir.kt @@ -1,6 +1,6 @@ val foo = iterator { yield(0) val nullable: String? = null - nullable.length - nullable.get(2) + nullable.length + nullable.get(2) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/outerYield_1_3.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/outerYield_1_3.fir.kt index 31050be60fe..f03df720e81 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/outerYield_1_3.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/outerYield_1_3.fir.kt @@ -87,7 +87,7 @@ fun test() { this@with.yield("") yield2("") - this@with.yield2("") + this@with.yield2("") } } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/resolve/samAgainstFunctionalType.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/resolve/samAgainstFunctionalType.fir.kt index 428d894df0c..b7aee9d5815 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/resolve/samAgainstFunctionalType.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/resolve/samAgainstFunctionalType.fir.kt @@ -24,7 +24,7 @@ public class StaticOverrides { // FILE: test.kt fun test() { - StaticOverrides.A.foo {} checkType { _() } + StaticOverrides.A.foo {} checkType { _() } StaticOverrides.B.foo {} checkType { _() } - StaticOverrides.C.foo {} checkType { _() } + StaticOverrides.C.foo {} checkType { _() } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithGenerics.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithGenerics.fir.kt index 05a5ed0f4c9..c1213130ee4 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithGenerics.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithGenerics.fir.kt @@ -20,6 +20,6 @@ class Foo { // FILE: 1.kt fun test() { - Foo().foo {} checkType { _() } - Foo().bar {} checkType { _() } + Foo().foo {} checkType { _() } + Foo().bar {} checkType { _() } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithGenericsWithoutRefinedSams.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithGenericsWithoutRefinedSams.fir.kt index 2d46f94bee1..212fdae2be1 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithGenericsWithoutRefinedSams.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithGenericsWithoutRefinedSams.fir.kt @@ -21,6 +21,6 @@ class Foo { // FILE: 1.kt fun test() { - Foo().foo {} checkType { _() } - Foo().bar {} checkType { _() } + Foo().foo {} checkType { _() } + Foo().bar {} checkType { _() } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithKtFunction.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithKtFunction.fir.kt index 377b771ff37..ea440852beb 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithKtFunction.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithKtFunction.fir.kt @@ -16,5 +16,5 @@ public class Foo { // FILE: 1.kt fun bar() { - Foo().test {} checkType { _() } + Foo().test {} checkType { _() } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithKtFunctionWithoutRefinedSams.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithKtFunctionWithoutRefinedSams.fir.kt index 9d5f49b6125..aa41c361a98 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithKtFunctionWithoutRefinedSams.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithKtFunctionWithoutRefinedSams.fir.kt @@ -18,5 +18,5 @@ public class Foo { // FILE: 1.kt fun bar() { - Foo().test {} checkType { _() } + Foo().test {} checkType { _() } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/smartcasts/letChangesToNotNull.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/smartcasts/letChangesToNotNull.fir.kt index 529c3172b29..ca9ee064daa 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/smartcasts/letChangesToNotNull.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/smartcasts/letChangesToNotNull.fir.kt @@ -3,5 +3,5 @@ fun foo(y: String?) { var x: String? = null y?.let { x = it } - x.length // Smart cast is not possible + x.length // Smart cast is not possible } diff --git a/compiler/testData/diagnostics/testsWithStdLib/smartcasts/letChangesToNullComplex.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/smartcasts/letChangesToNullComplex.fir.kt index ddee7e5b9df..71076c521c4 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/smartcasts/letChangesToNullComplex.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/smartcasts/letChangesToNullComplex.fir.kt @@ -5,7 +5,7 @@ fun bar(z: String?) = z fun foo(y: String?) { var x: String? = "" if (x != null) { - bar(y?.let { x = null; it }).length + bar(y?.let { x = null; it }).length x.length // Smart cast is not possible } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/smartcasts/withChangesToNull.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/smartcasts/withChangesToNull.fir.kt index 5c2c0ec8e0d..8e41c4cccbe 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/smartcasts/withChangesToNull.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/smartcasts/withChangesToNull.fir.kt @@ -2,7 +2,7 @@ fun foo(y: String?) { var x: String? = "" if (x != null) { with(y?.let { x = null; it }) { - this.length + this.length x.length } x.length diff --git a/compiler/testData/diagnostics/testsWithStdLib/tryCatch/assignTry.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/tryCatch/assignTry.fir.kt index beee087680e..6198ffd2694 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/tryCatch/assignTry.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/tryCatch/assignTry.fir.kt @@ -15,7 +15,7 @@ fun test2() { catch (e: ExcB) { 10 } - s.length + s.length } fun test3() { @@ -28,7 +28,7 @@ fun test3() { catch (e: ExcB) { return } - s.length + s.length } fun test4() { @@ -41,7 +41,7 @@ fun test4() { finally { "" } - s.length + s.length } fun test5() { @@ -54,7 +54,7 @@ fun test5() { finally { return } - s.length + s.length } fun test6() { @@ -67,7 +67,7 @@ fun test6() { catch (e: ExcB) { return } - s.length + s.length } fun test7() { @@ -80,7 +80,7 @@ fun test7() { catch (e: ExcB) { "" } - s.length + s.length } fun test8() { @@ -89,7 +89,7 @@ fun test8() { } catch (e: ExcA) { null } - s.length + s.length } fun test9() { diff --git a/compiler/testData/diagnostics/testsWithStdLib/tryCatch/boundedSmartcasts.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/tryCatch/boundedSmartcasts.fir.kt index d7030617a16..1e3d0b9beea 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/tryCatch/boundedSmartcasts.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/tryCatch/boundedSmartcasts.fir.kt @@ -13,11 +13,11 @@ fun test0(x: Int?) { if (x != null) { x.inc() - y.inc() + y.inc() } if (y != null) { - x.inc() + x.inc() y.inc() } } @@ -32,11 +32,11 @@ fun test1(x: Int?) { if (x != null) { x.inc() - y.inc() + y.inc() } if (y != null) { - x.inc() + x.inc() y.inc() } } @@ -51,11 +51,11 @@ fun test2(x: Int?) { if (x != null) { x.inc() - y.inc() + y.inc() } if (y != null) { - x.inc() + x.inc() y.inc() } } @@ -69,11 +69,11 @@ fun test3(x: Int?) { if (x != null) { x.inc() - y.inc() + y.inc() } if (y != null) { - x.inc() + x.inc() y.inc() } } @@ -91,11 +91,11 @@ fun test5(x: Int?) { if (x != null) { x.inc() - y.inc() + y.inc() } if (y != null) { - x.inc() + x.inc() y.inc() } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/tryCatch/correctSmartcasts.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/tryCatch/correctSmartcasts.fir.kt index b24665e36d8..e4d02ce214a 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/tryCatch/correctSmartcasts.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/tryCatch/correctSmartcasts.fir.kt @@ -15,8 +15,8 @@ fun test1(s: String?) { catch (e: Exception) { requireNotNull(s) } - t2.not() - s.length + t2.not() + s.length } } @@ -74,7 +74,7 @@ fun test5(s: String?) { catch (e: ExcB) { } - s.length + s.length } fun test6(s: String?) { diff --git a/compiler/testData/diagnostics/testsWithStdLib/tryCatch/correctSmartcasts_after.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/tryCatch/correctSmartcasts_after.fir.kt index 48729b80495..252ab90a563 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/tryCatch/correctSmartcasts_after.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/tryCatch/correctSmartcasts_after.fir.kt @@ -16,8 +16,8 @@ fun test1(s: String?) { catch (e: Exception) { requireNotNull(s) } - t2.not() - s.length + t2.not() + s.length } } @@ -75,7 +75,7 @@ fun test5(s: String?) { catch (e: ExcB) { } - s.length + s.length } fun test6(s: String?) { diff --git a/compiler/testData/diagnostics/testsWithStdLib/tryCatch/falsePositiveSmartcasts.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/tryCatch/falsePositiveSmartcasts.fir.kt index 156ddc884e2..5d3b627ae11 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/tryCatch/falsePositiveSmartcasts.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/tryCatch/falsePositiveSmartcasts.fir.kt @@ -13,15 +13,15 @@ fun test1() { try { x = null } catch (e: Exception) { - x.length // smartcast shouldn't be allowed (OOME could happen after `x = null`) + x.length // smartcast shouldn't be allowed (OOME could happen after `x = null`) throw e } finally { // smartcast shouldn't be allowed, `x = null` could've happened - x.length + x.length } // smartcast shouldn't be allowed, `x = null` could've happened - x.length + x.length } // With old DFA of try/catch info about unsound smartcasts after try @@ -33,12 +33,12 @@ fun test2() { try { x = null } catch (e: Exception) { - x.length + x.length } finally { - x.length + x.length } - x.length + x.length } fun test3() { @@ -49,7 +49,7 @@ fun test3() { } catch (e: Exception) { t2 = null } - t2.not() // wrong smartcast, NPE + t2.not() // wrong smartcast, NPE } } @@ -59,7 +59,7 @@ fun test4() { try { t2 = null } finally { } - t2.not() // wrong smartcast, NPE + t2.not() // wrong smartcast, NPE } } @@ -80,10 +80,10 @@ fun test5() { } finally { s1.length - s2.length + s2.length } s1.length - s2.length + s2.length } fun test6(s1: String?, s2: String?) { @@ -97,10 +97,10 @@ fun test6(s1: String?, s2: String?) { return } finally { - s.length + s.length requireNotNull(s2) } - s.length - s1.length + s.length + s1.length s2.length } \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/tryCatch/falsePositiveSmartcasts_after.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/tryCatch/falsePositiveSmartcasts_after.fir.kt index 98aad3f98f6..3458df14c11 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/tryCatch/falsePositiveSmartcasts_after.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/tryCatch/falsePositiveSmartcasts_after.fir.kt @@ -14,15 +14,15 @@ fun test1() { try { x = null } catch (e: Exception) { - x.length // smartcast shouldn't be allowed (OOME could happen after `x = null`) + x.length // smartcast shouldn't be allowed (OOME could happen after `x = null`) throw e } finally { // smartcast shouldn't be allowed, `x = null` could've happened - x.length + x.length } // smartcast shouldn't be allowed, `x = null` could've happened - x.length + x.length } // With old DFA of try/catch info about unsound smartcasts after try @@ -35,12 +35,12 @@ fun test2() { x = null } catch (e: Exception) { // BAD - x.length + x.length } finally { - x.length + x.length } - x.length + x.length } fun test3() { @@ -51,7 +51,7 @@ fun test3() { } catch (e: Exception) { t2 = null } - t2.not() // wrong smartcast, NPE + t2.not() // wrong smartcast, NPE } } @@ -61,7 +61,7 @@ fun test4() { try { t2 = null } finally { } - t2.not() // wrong smartcast, NPE + t2.not() // wrong smartcast, NPE } } @@ -82,10 +82,10 @@ fun test5() { } finally { s1.length - s2.length + s2.length } s1.length - s2.length + s2.length } fun test6(s1: String?, s2: String?) { @@ -99,10 +99,10 @@ fun test6(s1: String?, s2: String?) { return } finally { - s.length + s.length requireNotNull(s2) } - s.length - s1.length + s.length + s1.length s2.length } diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/neg/2.3.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/neg/2.3.fir.kt index 0a202b59a59..a3625e548ac 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/neg/2.3.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/neg/2.3.fir.kt @@ -105,8 +105,8 @@ fun case_6() { checkSubtype(-100000000000000000000000000000000) checkSubtype(-100000000000000000000000000000000) checkSubtype(-100000000000000000000000000000000) - -100000000000000000000000000000000 checkType { check() } - -100000000000000000000000000000000 checkType { check() } - -100000000000000000000000000000000 checkType { check() } - -100000000000000000000000000000000 checkType { check() } + -100000000000000000000000000000000 checkType { check() } + -100000000000000000000000000000000 checkType { check() } + -100000000000000000000000000000000 checkType { check() } + -100000000000000000000000000000000 checkType { check() } } diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/neg/2.4.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/neg/2.4.fir.kt index 393c857b1c3..b3aa065eae3 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/neg/2.4.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/neg/2.4.fir.kt @@ -3,23 +3,23 @@ // TESTCASE NUMBER: 1 fun case_1() { checkSubtype(-9223372036854775808L) - -9223372036854775808L checkType { check() } + -9223372036854775808L checkType { check() } checkSubtype(9223372036854775808L) - 9223372036854775808L checkType { check() } + 9223372036854775808L checkType { check() } } // TESTCASE NUMBER: 2 fun case_2() { checkSubtype(100000000000000000000000000000000L) - 100000000000000000000000000000000L checkType { check() } + 100000000000000000000000000000000L checkType { check() } checkSubtype(100000000000000000000000000000000l) - 100000000000000000000000000000000l checkType { check() } + 100000000000000000000000000000000l checkType { check() } checkSubtype(-100000000000000000000000000000000L) - -100000000000000000000000000000000L checkType { check() } + -100000000000000000000000000000000L checkType { check() } checkSubtype(-100000000000000000000000000000000l) - -100000000000000000000000000000000l checkType { check() } + -100000000000000000000000000000000l checkType { check() } } diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-decrement-expression/p-4/neg/1.1.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-decrement-expression/p-4/neg/1.1.fir.kt index 3babe3d0231..fff37ca63ee 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-decrement-expression/p-4/neg/1.1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-decrement-expression/p-4/neg/1.1.fir.kt @@ -15,7 +15,7 @@ class A() { fun case1() { var b: Case1? = Case1() - --b?.a + --b?.a } diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-increment-expression/p-4/neg/1.1.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-increment-expression/p-4/neg/1.1.fir.kt index 3f904e182b0..1b263ccaed0 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-increment-expression/p-4/neg/1.1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-increment-expression/p-4/neg/1.1.fir.kt @@ -15,7 +15,7 @@ class A() { fun case1() { var b: Case1? = Case1() - ++b?.a + ++b?.a } diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.1.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.1.fir.kt index 73c59e02d34..476e7e2e0c2 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-named-parameters/p-1/pos/2.1.fir.kt @@ -63,7 +63,7 @@ fun case3() { */ fun case4(marker : Marker?) { marker?.foo(y=1) - marker?.foo(x=1)> + marker?.foo(x=1)> } diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.1.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.1.fir.kt index 56f53ebd7cb..5f9b80e065f 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-with-trailing-lambda-expressions/p-1/pos/2.1.fir.kt @@ -63,7 +63,7 @@ fun case3() { */ fun case4(marker: Marker?) { marker?.foo(y = { 1 }) - marker?.foo(x = { 1 })> + marker?.foo(x = { 1 })> } diff --git a/compiler/tests-spec/testData/diagnostics/linked/statements/assignments/p-2/neg/1.2.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/statements/assignments/p-2/neg/1.2.fir.kt index 9767efa112e..7e1ff9cfa3d 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/statements/assignments/p-2/neg/1.2.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/statements/assignments/p-2/neg/1.2.fir.kt @@ -8,7 +8,7 @@ */ fun case1() { val x : Case1? = Case1() - x.x = "0" + x.x = "0" x?.x = "0" x::x = TODO() } @@ -24,7 +24,7 @@ class Case1{ */ fun case2() { val x : Case2? = Case2(null) - x.x = "0" + x.x = "0" x?.x = "0" x::x = TODO() } @@ -37,7 +37,7 @@ class Case2(val x: Any?) {} */ fun case3() { val x : Case3? = Case3() - x.x = "0" + x.x = "0" x?.x = "0" x::x = TODO() } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common/neg/1.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common/neg/1.fir.kt index ce3f5513e8d..c5adafadcdf 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common/neg/1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common/neg/1.fir.kt @@ -46,7 +46,7 @@ fun case_1(value_1: Int?) { if (contracts.case_1(value_1) { value_2 = 10 }) { println(value_2) } else { - value_1.inv() + value_1.inv() println(value_2) } } @@ -58,8 +58,8 @@ fun case_2(value_1: Int?, value_2: Int?, value_3: Any?) { true -> { println(value_3?.xor(true)) println(value_4) - println(value_1.inv()) - println(value_2.inv()) + println(value_1.inv()) + println(value_2.inv()) } false -> { println(value_4) diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/1.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/1.fir.kt index a22b50b0e3f..15ee30d4812 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/1.fir.kt @@ -11,13 +11,13 @@ fun case_1(value_1: Any?) { // TESTCASE NUMBER: 2 fun case_2(value_1: Int?) { funWithReturnsAndInvertCondition(value_1 != null) - println(value_1.inc()) + println(value_1.inc()) } // TESTCASE NUMBER: 3 fun case_3(value_1: Int?) { funWithReturns(value_1 == null) - println(value_1.inc()) + println(value_1.inc()) } // TESTCASE NUMBER: 4 @@ -29,13 +29,13 @@ fun case_4(value_1: Any?) { // TESTCASE NUMBER: 5 fun case_5(value_1: String?) { funWithReturnsAndNullCheck(value_1) - println(value_1.length) + println(value_1.length) } // TESTCASE NUMBER: 6 fun case_6(value_1: String?) { funWithReturnsAndNullCheck(value_1) - println(value_1.length) + println(value_1.length) } // TESTCASE NUMBER: 7 @@ -44,7 +44,7 @@ object case_7_object { } fun case_7() { funWithReturns(case_7_object.prop_1 == null) - case_7_object.prop_1.inc() + case_7_object.prop_1.inc() } // TESTCASE NUMBER: 8 @@ -61,14 +61,14 @@ fun case_8(value_1: Any?) { // TESTCASE NUMBER: 9 fun case_9(value_1: String?) { - if (!funWithReturnsTrue(value_1 != null)) println(value_1.length) - if (!funWithReturnsTrueAndInvertCondition(value_1 == null)) println(value_1.length) - if (funWithReturnsFalse(value_1 != null)) println(value_1.length) - if (funWithReturnsFalseAndInvertCondition(value_1 == null)) println(value_1.length) - if (funWithReturnsNotNull(value_1 != null) == null) println(value_1.length) - if (funWithReturnsNotNullAndInvertCondition(value_1 == null) == null) println(value_1.length) - if (funWithReturnsNull(value_1 != null) != null) println(value_1.length) - if (funWithReturnsNullAndInvertCondition(value_1 == null) != null) println(value_1.length) + if (!funWithReturnsTrue(value_1 != null)) println(value_1.length) + if (!funWithReturnsTrueAndInvertCondition(value_1 == null)) println(value_1.length) + if (funWithReturnsFalse(value_1 != null)) println(value_1.length) + if (funWithReturnsFalseAndInvertCondition(value_1 == null)) println(value_1.length) + if (funWithReturnsNotNull(value_1 != null) == null) println(value_1.length) + if (funWithReturnsNotNullAndInvertCondition(value_1 == null) == null) println(value_1.length) + if (funWithReturnsNull(value_1 != null) != null) println(value_1.length) + if (funWithReturnsNullAndInvertCondition(value_1 == null) != null) println(value_1.length) } // TESTCASE NUMBER: 10 @@ -83,14 +83,14 @@ fun case_10(value_1: Any?) { // TESTCASE NUMBER: 11 fun case_11(value_1: Number?) { - if (!funWithReturnsTrueAndNotNullCheck(value_1)) println(value_1.toByte()) + if (!funWithReturnsTrueAndNotNullCheck(value_1)) println(value_1.toByte()) if (!funWithReturnsTrueAndNullCheck(value_1)) println(value_1) - if (funWithReturnsFalseAndNotNullCheck(value_1)) println(value_1.toByte()) + if (funWithReturnsFalseAndNotNullCheck(value_1)) println(value_1.toByte()) if (funWithReturnsFalseAndNullCheck(value_1)) println(value_1) - if ((funWithReturnsNotNullAndNotNullCheck(value_1) == null)) println(value_1.toByte()) - if (!!!(funWithReturnsNotNullAndNotNullCheck(value_1) != null)) println(value_1.toByte()) + if ((funWithReturnsNotNullAndNotNullCheck(value_1) == null)) println(value_1.toByte()) + if (!!!(funWithReturnsNotNullAndNotNullCheck(value_1) != null)) println(value_1.toByte()) if (!!(funWithReturnsNotNullAndNullCheck(value_1) == null)) println(value_1) - if (!(funWithReturnsNullAndNotNullCheck(value_1) == null)) println(value_1.toByte()) - if (!!(funWithReturnsNullAndNotNullCheck(value_1) != null)) println(value_1.toByte()) + if (!(funWithReturnsNullAndNotNullCheck(value_1) == null)) println(value_1.toByte()) + if (!!(funWithReturnsNullAndNotNullCheck(value_1) != null)) println(value_1.toByte()) if (!!!(funWithReturnsNullAndNullCheck(value_1) == null)) println(value_1) } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/10.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/10.fir.kt index 7a69a61bd98..f621ad1346d 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/10.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/10.fir.kt @@ -213,7 +213,7 @@ fun case_2(value_1: Any?) { // TESTCASE NUMBER: 3 fun case_3(number: Int?) { - if (!funWithReturnsTrueAndNullCheck(number)) number.inc() + if (!funWithReturnsTrueAndNullCheck(number)) number.inc() } // TESTCASE NUMBER: 4 @@ -250,8 +250,8 @@ fun case_8(value_1: Any?) { // TESTCASE NUMBER: 9 fun case_9(value_1: Number?) { - if (!funWithReturnsTrueAndNullCheck(value_1)) println(value_1.toByte()) - if (funWithReturnsFalseAndNullCheck(value_1)) println(value_1.toByte()) + if (!funWithReturnsTrueAndNullCheck(value_1)) println(value_1.toByte()) + if (funWithReturnsFalseAndNullCheck(value_1)) println(value_1.toByte()) if (funWithReturnsFalseAndNotNullCheck(value_1)) println(value_1) if (!(funWithReturnsNotNullAndNullCheck(value_1) != null)) println(value_1) if (!(funWithReturnsNullAndNullCheck(value_1) == null)) println(value_1) @@ -458,9 +458,9 @@ fun case_19(value_1: Number) { // TESTCASE NUMBER: 20 fun case_20(value_1: String?, value_2: String?, value_3: String?, value_4: String?) { if (!value_1.case_20_1()) println(value_1) - if (!value_2.case_20_2()) println(value_2.length) + if (!value_2.case_20_2()) println(value_2.length) when (value_3.case_20_3()) { - true -> println(value_4.length) + true -> println(value_4.length) false -> println(value_3) } } @@ -468,13 +468,13 @@ fun case_20(value_1: String?, value_2: String?, value_3: String?, value_4: Strin // TESTCASE NUMBER: 21 fun case_21(value_1: String?) { when { !value_1.case_21_1() -> println(value_1) } - when { !value_1.case_21_2() -> println(value_1.length) } + when { !value_1.case_21_2() -> println(value_1.length) } when { - value_1.case_21_5() == null -> println(value_1.length) + value_1.case_21_5() == null -> println(value_1.length) value_1.case_21_5() != null -> println(value_1) } when { - value_1.case_21_7() != null -> println(value_1.length) + value_1.case_21_7() != null -> println(value_1.length) value_1.case_21_7() == null -> println(value_1) } } @@ -505,19 +505,19 @@ fun case_25(value_1: Any?, value_2: Int?, value_3: Any?, value_4: Int?) { when { value_1.case_25_1(value_2) -> { println(value_1.length) - println(value_2.inv()) + println(value_2.inv()) } } when { value_3.case_25_2(value_4) == null -> { println(value_3.length) - println(value_4.inv()) + println(value_4.inv()) } } when { value_3.case_25_3(value_4) != null -> { println(value_3.length) - println(value_4.inv()) + println(value_4.inv()) } } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/15.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/15.fir.kt index f9794f96f88..6241d48e330 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/15.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/15.fir.kt @@ -44,6 +44,6 @@ fun case_2(value: Any) { // TESTCASE NUMBER: 3 fun case_3(value: String?) { if (!value.isNullOrEmpty() is Boolean) { - value.length + value.length } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/4.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/4.fir.kt index 736fd934e09..04eeb256a6f 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/4.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/4.fir.kt @@ -152,7 +152,7 @@ fun case_2(value_1: Number) { // TESTCASE NUMBER: 3 fun case_3(value_1: String?, value_2: String?) { value_1.case_3_1() - println(value_1.length) + println(value_1.length) value_2.case_3_2() println(value_2) } @@ -160,7 +160,7 @@ fun case_3(value_1: String?, value_2: String?) { // TESTCASE NUMBER: 4 fun case_4(value_1: String?, value_2: String?) { value_1.case_4_1() - println(value_1.length) + println(value_1.length) value_2.case_4_2() println(value_2) } @@ -183,7 +183,7 @@ fun case_6(value_1: Number) { // TESTCASE NUMBER: 7 fun case_7(value_1: String?, value_2: String?) { - if (value_1.case_7_1()) println(value_1.length) + if (value_1.case_7_1()) println(value_1.length) if (value_2.case_7_2()) println(value_2) if (!(value_2.case_7_3() == null)) println(value_2) if (value_2.case_7_3() == null) println(value_2) @@ -191,7 +191,7 @@ fun case_7(value_1: String?, value_2: String?) { // TESTCASE NUMBER: 8 fun case_8(value_1: String?, value_2: String?) { - when { value_1.case_8_1() -> println(value_1.length) } + when { value_1.case_8_1() -> println(value_1.length) } when { value_2.case_8_2() -> println(value_2) } when { !(value_2.case_8_3() == null) -> println(value_2) } when { value_2.case_8_3() == null -> println(value_2) } @@ -199,13 +199,13 @@ fun case_8(value_1: String?, value_2: String?) { // TESTCASE NUMBER: 9 fun case_9(value_1: Number?) { - if (value_1?.case_9() == null) println(value_1.toByte()) + if (value_1?.case_9() == null) println(value_1.toByte()) } // TESTCASE NUMBER: 10 fun case_10(value_1: Number?) { if (value_1?.case_10() == null) { - println(value_1.toByte()) + println(value_1.toByte()) } else { println(value_1.toByte()) } @@ -217,13 +217,13 @@ fun case_10(value_1: Number?) { */ fun case_11(value_1: Number?, value_2: Number?) { if (value_1?.case_11_1() == null) { - println(value_1.toByte()) + println(value_1.toByte()) } else { println(value_1.toByte()) } if (value_2?.case_11_2() != null) { println(value_2.toByte()) } else { - println(value_2.toByte()) + println(value_2.toByte()) } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/6.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/6.fir.kt index 1812171498d..1e92240aca7 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/6.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/6.fir.kt @@ -111,7 +111,7 @@ import contracts.* fun case_1(value_1: Any?, value_2: Int?) { value_1.case_1(value_2) println(value_1.length) - println(value_2.inv()) + println(value_2.inv()) } // TESTCASE NUMBER: 2 @@ -125,7 +125,7 @@ fun case_2(value_1: Number?, value_2: Any?) { fun case_3(value_1: Any?, value_2: String?) { value_1.case_3(value_2) println(value_1.inv()) - println(value_2.length) + println(value_2.length) } // TESTCASE NUMBER: 4 @@ -133,7 +133,7 @@ fun case_4(value_1: Any?, value_2: Number, value_3: Any?, value_4: String?) { value_1.case_4(value_2, value_3, value_4) println(value_2.inv()) println(value_3.toByte()) - println(value_4.length) + println(value_4.length) } // TESTCASE NUMBER: 5 @@ -141,19 +141,19 @@ fun case_5(value_1: Any?, value_2: Int?, value_3: Any?, value_4: Int?, value_5: when { value_1.case_5_1(value_2) -> { println(value_1.length) - println(value_2.inv()) + println(value_2.inv()) } } when { !value_3.case_5_2(value_4) -> { println(value_3.length) - println(value_4.inv()) + println(value_4.inv()) } } when { value_5.case_5_3(value_6) != null -> { println(value_5.length) - println(value_6.inv()) + println(value_6.inv()) } } } @@ -182,19 +182,19 @@ fun case_6(value_1: Number?, value_2: Any?, value_3: Number?, value_4: Any?, val fun case_7(value_1: Any?, value_2: String?, value_3: Any?, value_4: String?, value_5: Any?, value_6: String?) { if (value_1.case_7_1(value_2)) { println(value_1.inv()) - println(value_2.length) + println(value_2.length) } if (value_3.case_7_2(value_4)) { println(value_3.inv()) - println(value_4.length) + println(value_4.length) } if (value_5.case_7_3(value_6) != null) { println(value_5.inv()) - println(value_6.length) + println(value_6.length) } if (value_5.case_7_4(value_6) == null) { println(value_5.inv()) - println(value_6.length) + println(value_6.length) } } @@ -202,14 +202,14 @@ fun case_7(value_1: Any?, value_2: String?, value_3: Any?, value_4: String?, val fun case_8(value_1: Any?, value_2: Number, value_3: Any?, value_4: String?) { when { value_1.case_8_1(value_2, value_3, value_4) -> println(value_2.inv()) } when { value_1.case_8_1(value_2, value_3, value_4) -> println(value_3.toByte()) } - when { value_1.case_8_1(value_2, value_3, value_4) -> println(value_4.length) } + when { value_1.case_8_1(value_2, value_3, value_4) -> println(value_4.length) } when { !value_1.case_8_2(value_2, value_3, value_4) -> println(value_2.inv()) } when { !value_1.case_8_2(value_2, value_3, value_4) -> println(value_3.toByte()) } - when { !value_1.case_8_2(value_2, value_3, value_4) -> println(value_4.length) } + when { !value_1.case_8_2(value_2, value_3, value_4) -> println(value_4.length) } when { value_1.case_8_3(value_2, value_3, value_4) == null -> println(value_2.inv()) } when { value_1.case_8_3(value_2, value_3, value_4) == null -> println(value_3.toByte()) } - when { value_1.case_8_3(value_2, value_3, value_4) == null -> println(value_4.length) } + when { value_1.case_8_3(value_2, value_3, value_4) == null -> println(value_4.length) } when { value_1.case_8_4(value_2, value_3, value_4) != null -> println(value_2.inv()) } when { value_1.case_8_4(value_2, value_3, value_4) != null -> println(value_3.toByte()) } - when { value_1.case_8_4(value_2, value_3, value_4) != null -> println(value_4.length) } + when { value_1.case_8_4(value_2, value_3, value_4) != null -> println(value_4.length) } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/7.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/7.fir.kt index 79d069fc03e..b2153d58533 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/7.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/7.fir.kt @@ -210,7 +210,7 @@ import contracts.* // TESTCASE NUMBER: 1 fun case_1(value_1: Int?) { case_1_1(value_1) - value_1.inv() + value_1.inv() case_1_2(value_1) value_1.inv() case_1_1(value_1) @@ -220,7 +220,7 @@ fun case_1(value_1: Int?) { // TESTCASE NUMBER: 2 fun case_2(value_1: Number?) { case_2_1(value_1) - value_1.toByte() + value_1.toByte() case_2_2(value_1) value_1.inv() } @@ -246,7 +246,7 @@ fun case_4(value_1: Any?) { // TESTCASE NUMBER: 5 fun case_5(value_1: Int?) { if (case_5_1(value_1)) { - value_1.inv() + value_1.inv() if (case_5_2(value_1)) { value_1.inv() case_5_1(value_1) @@ -254,7 +254,7 @@ fun case_5(value_1: Int?) { } } if (!case_5_3(value_1)) { - value_1.inv() + value_1.inv() if (!case_5_4(value_1)) { value_1.inv() case_5_1(value_1) @@ -262,7 +262,7 @@ fun case_5(value_1: Int?) { } } if (case_5_5(value_1) != null) { - value_1.inv() + value_1.inv() if (case_5_6(value_1) != null) { value_1.inv() case_5_1(value_1) @@ -270,7 +270,7 @@ fun case_5(value_1: Int?) { } } if (case_5_7(value_1) == null) { - value_1.inv() + value_1.inv() if (case_5_8(value_1) == null) { value_1.inv() case_5_1(value_1) @@ -283,25 +283,25 @@ fun case_5(value_1: Int?) { fun case_6(value_1: Number?) { when { case_6_1(value_1) -> { - value_1.toByte() + value_1.toByte() when { case_6_2(value_1) -> value_1.inv() } } } when { !case_6_3(value_1) -> { - value_1.toByte() + value_1.toByte() when { !case_6_4(value_1) -> value_1.inv() } } } when { case_6_5(value_1) != null -> { - value_1.toByte() + value_1.toByte() when { case_6_6(value_1) != null -> value_1.inv() } } } when { case_6_7(value_1) == null -> { - value_1.toByte() + value_1.toByte() when { case_6_8(value_1) == null -> value_1.inv() } } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/8.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/8.fir.kt index 4d10799794e..86c1ce2fec9 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/8.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/8.fir.kt @@ -103,11 +103,11 @@ fun case_4(value_1: Number, value_2: (() -> Unit)?) { fun case_5(value_1: Number?, value_2: String?) { when (value_2.case_5(value_1)) { true -> { - println(value_2.length) + println(value_2.length) println(value_1.toByte()) } false -> { - println(value_2.length) + println(value_2.length) println(value_1.inv()) } } @@ -118,11 +118,11 @@ fun case_6(value_1: Number, value_2: String?, value_3: Any?) { when (value_3.case_6(value_1, value_2)) { true -> { println(value_3.equals("")) - println(value_2.length) + println(value_2.length) } false -> { println(value_3.length) - println(value_2.length) + println(value_2.length) } null -> { println(value_1.inv()) diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/9.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/9.fir.kt index 046cfcad176..ff2c8a47167 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/9.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/9.fir.kt @@ -4,25 +4,25 @@ // TESTCASE NUMBER: 1 fun case_1(arg: Int?) { funWithAtMostOnceCallsInPlace { arg!! } - arg.inc() + arg.inc() } // TESTCASE NUMBER: 2 fun case_2(arg: Int?) { funWithUnknownCallsInPlace { arg!! } - arg.inc() + arg.inc() } // TESTCASE NUMBER: 3 fun case_3() { val value_1: Boolean? funWithAtMostOnceCallsInPlace { value_1 = false } - value_1.not() + value_1.not() } // TESTCASE NUMBER: 4 fun case_4() { val value_1: Boolean? funWithUnknownCallsInPlace { value_1 = true } - value_1.not() + value_1.not() } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/12.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/12.fir.kt index 2aea8c40632..214075f51f4 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/12.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/12.fir.kt @@ -10,7 +10,7 @@ fun case_1(arg: Int?) { // TESTCASE NUMBER: 2 fun case_2(arg: Int?) { funWithAtLeastOnceCallsInPlace { arg!! } - arg.inc() + arg.inc() } // TESTCASE NUMBER: 3 @@ -24,5 +24,5 @@ fun case_3() { fun case_4() { val value_1: Boolean? funWithAtLeastOnceCallsInPlace { value_1 = true } - value_1.not() + value_1.not() } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/14.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/14.fir.kt index 5a5433d6c87..b6f2561540f 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/14.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/14.fir.kt @@ -49,21 +49,21 @@ import contracts.* // TESTCASE NUMBER: 1 fun case_1(value_1: Int?) { if (contracts.case_1(value_1)!!) { - value_1.inv() + value_1.inv() } } // TESTCASE NUMBER: 2 fun case_2(value_1: Int?) { if (!contracts.case_2(value_1)!!) { - value_1.inv() + value_1.inv() } } // TESTCASE NUMBER: 3 fun case_3(value_1: Int?) { if (contracts.case_3(value_1)!!) { - value_1.inv() + value_1.inv() } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/6.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/6.fir.kt index 13d619d9e85..615f0914cd7 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/6.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/6.fir.kt @@ -110,7 +110,7 @@ import contracts.* fun case_1(value_1: Any?, value_2: Int?) { value_1.case_1(value_2) println(value_1.length) - println(value_2.inv()) + println(value_2.inv()) } // TESTCASE NUMBER: 2 @@ -124,7 +124,7 @@ fun case_2(value_1: Number?, value_2: Any?) { fun case_3(value_1: Any?, value_2: String?) { value_1.case_3(value_2) println(value_1.inv()) - println(value_2.length) + println(value_2.length) } // TESTCASE NUMBER: 4 @@ -132,7 +132,7 @@ fun case_4(value_1: Any?, value_2: Number, value_3: Any?, value_4: String?) { value_1.case_4(value_2, value_3, value_4) println(value_2.inv()) println(value_3.toByte()) - println(value_4.length) + println(value_4.length) } // TESTCASE NUMBER: 5 @@ -140,25 +140,25 @@ fun case_5(value_1: Any?, value_2: Int?, value_3: Any?, value_4: Int?, value_5: when { value_1.case_5_1(value_2) -> { println(value_1.length) - println(value_2.inv()) + println(value_2.inv()) } } when { !value_3.case_5_2(value_4) -> { println(value_3.length) - println(value_4.inv()) + println(value_4.inv()) } } when { value_5.case_5_3(value_6) != null -> { println(value_5.length) - println(value_6.inv()) + println(value_6.inv()) } } when { value_5.case_5_4(value_6) == null -> { println(value_5.length) - println(value_6.inv()) + println(value_6.inv()) } } } @@ -187,19 +187,19 @@ fun case_6(value_1: Number?, value_2: Any?, value_3: Number?, value_4: Any?, val fun case_7(value_1: Any?, value_2: String?, value_3: Any?, value_4: String?, value_5: Any?, value_6: String?) { if (value_1.case_7_1(value_2)) { println(value_1.inv()) - println(value_2.length) + println(value_2.length) } if (value_3.case_7_2(value_4)) { println(value_3.inv()) - println(value_4.length) + println(value_4.length) } if (value_5.case_7_3(value_6) != null) { println(value_5.inv()) - println(value_6.length) + println(value_6.length) } if (value_5.case_7_4(value_6) == null) { println(value_5.inv()) - println(value_6.length) + println(value_6.length) } } @@ -207,14 +207,14 @@ fun case_7(value_1: Any?, value_2: String?, value_3: Any?, value_4: String?, val fun case_8(value_1: Any?, value_2: Number, value_3: Any?, value_4: String?, value_5: Any?, value_6: Number, value_7: Any?, value_8: String?) { when { value_1.case_8_1(value_2, value_3, value_4) -> println(value_2.inv()) } when { value_1.case_8_1(value_2, value_3, value_4) -> println(value_3.toByte()) } - when { value_1.case_8_1(value_2, value_3, value_4) -> println(value_4.length) } + when { value_1.case_8_1(value_2, value_3, value_4) -> println(value_4.length) } when { !value_5.case_8_2(value_6, value_7, value_8) -> println(value_6.inv()) } when { !value_5.case_8_2(value_6, value_7, value_8) -> println(value_7.toByte()) } - when { !value_5.case_8_2(value_6, value_7, value_8) -> println(value_8.length) } + when { !value_5.case_8_2(value_6, value_7, value_8) -> println(value_8.length) } when { value_5.case_8_3(value_6, value_7, value_8) != null -> println(value_6.inv()) } when { value_5.case_8_3(value_6, value_7, value_8) != null -> println(value_7.toByte()) } - when { value_5.case_8_3(value_6, value_7, value_8) != null -> println(value_8.length) } + when { value_5.case_8_3(value_6, value_7, value_8) != null -> println(value_8.length) } when { value_5.case_8_4(value_6, value_7, value_8) == null -> println(value_6.inv()) } when { value_5.case_8_4(value_6, value_7, value_8) == null -> println(value_7.toByte()) } - when { value_5.case_8_4(value_6, value_7, value_8) == null -> println(value_8.length) } + when { value_5.case_8_4(value_6, value_7, value_8) == null -> println(value_8.length) } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/8.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/8.fir.kt index b0c617dee4e..f7efa9bf4b1 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/8.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/8.fir.kt @@ -111,7 +111,7 @@ fun case_5(value_1: Number?, value_2: String?) { println(value_1.toByte()) } false -> { - println(value_2.length) + println(value_2.length) println(value_1.inv()) } } @@ -130,7 +130,7 @@ fun case_6(value_1: Number, value_2: String?, value_3: Any?) { } false -> { println(value_3.length) - println(value_2.length) + println(value_2.length) } null -> { println(value_1.inv()) diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/1.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/1.fir.kt index dd25f83a07c..0a18e90197d 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/1.fir.kt @@ -6,13 +6,13 @@ fun case_1(x: Any?) { if (x != null is Boolean) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -23,13 +23,13 @@ fun case_3() { if (Object.prop_1 == null !== null) else { Object.prop_1 - Object.prop_1.equals(null) + Object.prop_1.equals(null) Object.prop_1.propT - Object.prop_1.propAny + Object.prop_1.propAny Object.prop_1.propNullableT Object.prop_1.propNullableAny Object.prop_1.funT() - Object.prop_1.funAny() + Object.prop_1.funAny() Object.prop_1.funNullableT() Object.prop_1.funNullableAny() } @@ -39,13 +39,13 @@ fun case_3() { fun case_4(x: Char?) { if (x != null || false is Boolean) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -56,13 +56,13 @@ fun case_5() { val x: Unit? = null if (x !== null is Boolean?) x - if (x !== null == null) x.equals(null) + if (x !== null == null) x.equals(null) if (x !== null == null) x.propT - if (x !== null == null) x.propAny + if (x !== null == null) x.propAny if (x !== null == null) x.propNullableT if (x !== null == null) x.propNullableAny if (x !== null == null) x.funT() - if (x !== null == null) x.funAny() + if (x !== null == null) x.funAny() if (x !== null == null) x.funNullableT() if (x !== null == null) x.funNullableAny() } @@ -73,13 +73,13 @@ fun case_6(x: EmptyClass?) { if ((x != null && !y) is Boolean) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -89,13 +89,13 @@ fun case_6(x: EmptyClass?) { fun case_7() { if (nullableNumberProperty != null || nullableNumberProperty != null is Boolean) { nullableNumberProperty - nullableNumberProperty.equals(null) + nullableNumberProperty.equals(null) nullableNumberProperty.propT - nullableNumberProperty.propAny + nullableNumberProperty.propAny nullableNumberProperty.propNullableT nullableNumberProperty.propNullableAny nullableNumberProperty.funT() - nullableNumberProperty.funAny() + nullableNumberProperty.funAny() nullableNumberProperty.funNullableT() nullableNumberProperty.funNullableAny() } @@ -113,7 +113,7 @@ fun case_9(x: TypealiasNullableString?) { } else if (false is Boolean) { x - x.get(0) + x.get(0) } } @@ -124,13 +124,13 @@ fun case_10() { if (a.prop_4 === null || true is Boolean) { if (a.prop_4 != null !== null) { a.prop_4 - a.prop_4.equals(null) + a.prop_4.equals(null) a.prop_4.propT - a.prop_4.propAny + a.prop_4.propAny a.prop_4.propNullableT a.prop_4.propNullableAny a.prop_4.funT() - a.prop_4.funAny() + a.prop_4.funAny() a.prop_4.funNullableT() a.prop_4.funNullableAny() } @@ -150,11 +150,11 @@ fun case_11(x: TypealiasNullableStringIndirect?, y: TypealiasNullableStringIndir x x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -270,13 +270,13 @@ val case_17 = if (nullableIntProperty == null == true == false) 0 else { fun case_18(a: DeepObject.A.B.C.D.E.F.G.J?) { if (a != null !== null) { a - a.equals(null) + a.equals(null) a.propT - a.propAny + a.propAny a.propNullableT a.propNullableAny a.funT() - a.funAny() + a.funAny() a.funNullableT() a.funNullableAny() } @@ -302,17 +302,17 @@ fun case_19(b: Boolean) { } } else null - if (a != null !is Boolean && a.B19 != null is Boolean && a.B19.C19 != null is Boolean && a.B19.C19.D19 != null == null && a.B19.C19.D19.x != null !== null) { - a.B19.C19.D19.x - a.B19.C19.D19.x.equals(null) - a.B19.C19.D19.x.propT - a.B19.C19.D19.x.propAny - a.B19.C19.D19.x.propNullableT - a.B19.C19.D19.x.propNullableAny - a.B19.C19.D19.x.funT() - a.B19.C19.D19.x.funAny() - a.B19.C19.D19.x.funNullableT() - a.B19.C19.D19.x.funNullableAny() + if (a != null !is Boolean && a.B19 != null is Boolean && a.B19.C19 != null is Boolean && a.B19.C19.D19 != null == null && a.B19.C19.D19.x != null !== null) { + a.B19.C19.D19.x + a.B19.C19.D19.x.equals(null) + a.B19.C19.D19.x.propT + a.B19.C19.D19.x.propAny + a.B19.C19.D19.x.propNullableT + a.B19.C19.D19.x.propNullableAny + a.B19.C19.D19.x.funT() + a.B19.C19.D19.x.funAny() + a.B19.C19.D19.x.funNullableT() + a.B19.C19.D19.x.funNullableAny() } } @@ -330,13 +330,13 @@ fun case_20(b: Boolean) { if (a.B19.C19.D19 !== null !is Boolean) { a.B19.C19.D19 - a.B19.C19.D19.equals(null) + a.B19.C19.D19.equals(null) a.B19.C19.D19.propT - a.B19.C19.D19.propAny + a.B19.C19.D19.propAny a.B19.C19.D19.propNullableT a.B19.C19.D19.propNullableAny a.B19.C19.D19.funT() - a.B19.C19.D19.funAny() + a.B19.C19.D19.funAny() a.B19.C19.D19.funNullableT() a.B19.C19.D19.funNullableAny() } @@ -346,13 +346,13 @@ fun case_20(b: Boolean) { fun case_21() { if (EnumClassWithNullableProperty.B.prop_1 !== null is Boolean == true !is Boolean != true) { EnumClassWithNullableProperty.B.prop_1 - EnumClassWithNullableProperty.B.prop_1.equals(null) + EnumClassWithNullableProperty.B.prop_1.equals(null) EnumClassWithNullableProperty.B.prop_1.propT - EnumClassWithNullableProperty.B.prop_1.propAny + EnumClassWithNullableProperty.B.prop_1.propAny EnumClassWithNullableProperty.B.prop_1.propNullableT EnumClassWithNullableProperty.B.prop_1.propNullableAny EnumClassWithNullableProperty.B.prop_1.funT() - EnumClassWithNullableProperty.B.prop_1.funAny() + EnumClassWithNullableProperty.B.prop_1.funAny() EnumClassWithNullableProperty.B.prop_1.funNullableT() EnumClassWithNullableProperty.B.prop_1.funNullableAny() } @@ -361,23 +361,23 @@ fun case_21() { // TESTCASE NUMBER: 22 fun case_22(a: (() -> Unit)?) { if (a != null !is Boolean) { - a() - a().equals(null) - a().propT - a().propAny - a().propNullableT - a().propNullableAny - a().funT() - a().funAny() - a().funNullableT() - a().funNullableAny() + a() + a().equals(null) + a().propT + a().propAny + a().propNullableT + a().propNullableAny + a().funT() + a().funAny() + a().funNullableT() + a().funNullableAny() } } // TESTCASE NUMBER: 23 fun case_23(a: ((Float) -> Int?)?, b: Float?) { if (a != null !is Boolean && b !== null is Boolean) { - val x = a(b) + val x = a(b) if (x != null) { x x.equals(null) @@ -396,15 +396,15 @@ fun case_23(a: ((Float) -> Int?)?, b: Float?) { // TESTCASE NUMBER: 24 fun case_24(a: ((() -> Unit) -> Unit)?, b: (() -> Unit)?) = if (a !== null is Boolean && b !== null !is Boolean) { - a(?")!>b) - a(b) - ?")!>b.equals(null) + a(?")!>b) + a(b) + ?")!>b.equals(null) ?")!>b.propT - ?")!>b.propAny + ?")!>b.propAny ?")!>b.propNullableT ?")!>b.propNullableAny ?")!>b.funT() - ?")!>b.funAny() + ?")!>b.funAny() ?")!>b.funNullableT() ?")!>b.funNullableAny() } else null @@ -440,16 +440,16 @@ fun case_25(b: Boolean) { // TESTCASE NUMBER: 26 fun case_26(a: ((Float) -> Int?)?, b: Float?) { if (a != null == true == false && b != null == true == false) { - val x = a(b) + val x = a(b) if (x != null == true === false) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -461,13 +461,13 @@ fun case_27() { if (Object.prop_1 == null == true == true == true == true == true == true == true == true == true == true == true == true == true == true is Boolean) else { Object.prop_1 - Object.prop_1.equals(null) + Object.prop_1.equals(null) Object.prop_1.propT - Object.prop_1.propAny + Object.prop_1.propAny Object.prop_1.propNullableT Object.prop_1.propNullableAny Object.prop_1.funT() - Object.prop_1.funAny() + Object.prop_1.funAny() Object.prop_1.funNullableT() Object.prop_1.funNullableAny() } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/11.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/11.fir.kt index 089c8e148a1..4ee80f19c8e 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/11.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/11.fir.kt @@ -26,7 +26,7 @@ fun case_3() { if (x is Boolean) { funWithAnyArg(try { x = null; true } catch (e: Exception) { false }) x - x.not() + x.not() } } @@ -36,7 +36,7 @@ fun case_4() { if (x != null) { false || when { else -> {x = null; true} } x - x.not() + x.not() } } @@ -58,7 +58,7 @@ fun case_6() { x as Boolean if (if (true) { x = null; true } else { false }) { x - x.not() + x.not() } } @@ -69,5 +69,5 @@ fun case_7() { if (if (true) { x = null; true } else { false }) {} x - x.not() + x.not() } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/12.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/12.fir.kt index ea31ce80a81..01ed2fc397b 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/12.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/12.fir.kt @@ -18,7 +18,7 @@ fun case_2() { } catch (e: Exception) { x = null } - x.not() + x.not() } } @@ -31,7 +31,7 @@ fun case_3() { } catch (e: Exception) { x = null } - x.not() + x.not() } } @@ -42,5 +42,5 @@ fun case_4() { try { x = null } finally { } - x.not() + x.not() } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/13.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/13.fir.kt index 6028efb50fe..6ef6de25fb7 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/13.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/13.fir.kt @@ -16,7 +16,7 @@ fun case_2() { x!! x(if (true) {x=null;0} else 0, x) x - x.fun_1() + x.fun_1() } // TESTCASE NUMBER: 3 @@ -25,5 +25,5 @@ fun case_3() { x!! val y = x[if (true) {x=null;0} else 0, x[0]] x - x.fun_1() + x.fun_1() } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/14.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/14.fir.kt index 9d0d22d7566..6d4234beba6 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/14.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/14.fir.kt @@ -6,7 +6,7 @@ fun case_1(x: Int?) { if ((x is Int) ?: (x is Int)) { x - x.inv() + x.inv() } } @@ -14,7 +14,7 @@ fun case_1(x: Int?) { fun case_2(x: Int?) { if (x?.equals(1) ?: x is Int) { x - x.inv() + x.inv() } } @@ -22,7 +22,7 @@ fun case_2(x: Int?) { fun case_3(x: Boolean?) { if (x ?: (x != null)) { x - x.not() + x.not() } } @@ -30,7 +30,7 @@ fun case_3(x: Boolean?) { fun case_4(x: Boolean?) { if (if (x != null) x else x != null) { x - x.not() + x.not() } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/15.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/15.fir.kt index c3035bcc689..b6b5c5a1f8e 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/15.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/15.fir.kt @@ -38,7 +38,7 @@ fun case_3() { if (x != null) { false || when { else -> { x = null; true} } x - x.not() + x.not() } } @@ -64,7 +64,7 @@ fun case_4() { fun case_5() { var x: Boolean? = true if (x != null) { - when { else -> { x = null; false} } || x.not() + when { else -> { x = null; false} } || x.not() } } @@ -88,7 +88,7 @@ fun case_6() { fun case_7() { var x: Boolean? = true if (x != null) { - (if (true) {x = null; null} else true) ?: x.not() + (if (true) {x = null; null} else true) ?: x.not() } } @@ -110,7 +110,7 @@ fun case_9() { if (x is Boolean) { funWithAnyArg(try { x = null; true } catch (e: Exception) { false }) x - x.not() + x.not() } } @@ -122,7 +122,7 @@ fun case_9() { fun case_10() { var x: Boolean? = true if (x is Boolean) { - select(if (true) {x = null;Class()} else Class()).prop_9 = x.not() + select(if (true) {x = null;Class()} else Class()).prop_9 = x.not() } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/19.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/19.fir.kt index 140fefe1e84..bfd8574ab45 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/19.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/19.fir.kt @@ -15,7 +15,7 @@ fun case_1(x: Boolean?) { } x - x.not() + x.not() } /* @@ -31,7 +31,7 @@ fun case_2(x: Boolean?) { } x - x.not() + x.not() } /* @@ -47,7 +47,7 @@ fun case_3(x: Boolean?) { } while (true) x - x.not() + x.not() } /* @@ -99,7 +99,7 @@ fun case_7(x: Boolean?) { } x - x.not() + x.not() } /* @@ -115,7 +115,7 @@ fun case_8(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 9 @@ -144,7 +144,7 @@ fun case_10(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 11 @@ -156,7 +156,7 @@ fun case_11(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 12 @@ -166,7 +166,7 @@ fun case_12(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 13 @@ -176,7 +176,7 @@ fun case_13(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 14 @@ -186,7 +186,7 @@ fun case_14(x: Boolean?) { } while (true) x - x.not() + x.not() } // TESTCASE NUMBER: 15 @@ -196,7 +196,7 @@ fun case_15(x: Boolean?) { } while (true) x - x.not() + x.not() } // TESTCASE NUMBER: 16 @@ -225,7 +225,7 @@ fun case_17(x: Boolean?) { } x - x.not() + x.not() } /* @@ -243,7 +243,7 @@ fun case_18(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 19 @@ -257,7 +257,7 @@ fun case_19(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 20 @@ -272,7 +272,7 @@ fun case_20(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 21 @@ -282,7 +282,7 @@ fun case_21(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 22 @@ -292,7 +292,7 @@ fun case_22(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 23 @@ -304,7 +304,7 @@ fun case_23(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 24 @@ -317,7 +317,7 @@ fun case_24(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 25 @@ -329,7 +329,7 @@ fun case_25(x: Boolean?) { } x - x.not() + x.not() } /* diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/20.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/20.fir.kt index 1e748d84806..1fe7ee1eb71 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/20.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/20.fir.kt @@ -15,7 +15,7 @@ fun case_1(x: Boolean?) { } x - x.not() + x.not() } /* @@ -31,7 +31,7 @@ fun case_2(x: Boolean?) { } x - x.not() + x.not() } /* @@ -47,7 +47,7 @@ fun case_3(x: Boolean?) { } while (true) x - x.not() + x.not() } /* @@ -99,7 +99,7 @@ fun case_7(x: Boolean?) { } x - x.not() + x.not() } /* @@ -115,7 +115,7 @@ fun case_8(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 9 @@ -144,7 +144,7 @@ fun case_10(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 11 @@ -156,7 +156,7 @@ fun case_11(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 12 @@ -166,7 +166,7 @@ fun case_12(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 13 @@ -176,7 +176,7 @@ fun case_13(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 14 @@ -186,7 +186,7 @@ fun case_14(x: Boolean?) { } while (true) x - x.not() + x.not() } // TESTCASE NUMBER: 15 @@ -196,7 +196,7 @@ fun case_15(x: Boolean?) { } while (true) x - x.not() + x.not() } // TESTCASE NUMBER: 16 @@ -225,7 +225,7 @@ fun case_17(x: Boolean?) { } x - x.not() + x.not() } /* @@ -243,7 +243,7 @@ fun case_18(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 19 @@ -257,7 +257,7 @@ fun case_19(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 20 @@ -272,7 +272,7 @@ fun case_20(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 21 @@ -282,7 +282,7 @@ fun case_21(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 22 @@ -292,7 +292,7 @@ fun case_22(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 23 @@ -304,7 +304,7 @@ fun case_23(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 24 @@ -317,7 +317,7 @@ fun case_24(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 25 @@ -329,7 +329,7 @@ fun case_25(x: Boolean?) { } x - x.not() + x.not() } /* diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/21.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/21.fir.kt index 359db004c86..15eda2907a9 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/21.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/21.fir.kt @@ -16,7 +16,7 @@ class Case1 { x this.x y.x - y.x.inv() + y.x.inv() } else { x = 10 } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/22.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/22.fir.kt index 5c8e6af4085..5ebd0bf5fd1 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/22.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/22.fir.kt @@ -14,7 +14,7 @@ fun case_1(x: Boolean?, y: Boolean?) { } x - x.not() + x.not() } /* @@ -29,7 +29,7 @@ fun case_2(x: Boolean?, y: Boolean?) { } while (true) x - x.not() + x.not() } /* @@ -44,7 +44,7 @@ fun case_3(x: Boolean?, y: Boolean?) { } x - x.not() + x.not() } /* @@ -59,7 +59,7 @@ fun case_4(x: Boolean?, y: Boolean?) { } while (true) x - x.not() + x.not() } // TESTCASE NUMBER: 5 @@ -92,7 +92,7 @@ fun case_7(x: Boolean?, y: Boolean?) { } x - x.not() + x.not() } /* @@ -107,7 +107,7 @@ fun case_8(x: Boolean?, y: Boolean?) { } x - x.not() + x.not() } /* diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/23.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/23.fir.kt index 1f7569cc23c..28e4a41a952 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/23.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/23.fir.kt @@ -61,7 +61,7 @@ inline fun case_6() { var x: T? = 10 as T if (x is K) { x = null - x.equals(10) + x.equals(10) x println(1) } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/24.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/24.fir.kt index 07df8fe67f9..81536473ecf 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/24.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/24.fir.kt @@ -16,7 +16,7 @@ fun case_1() { x = null } x - x.not() + x.not() } } @@ -32,7 +32,7 @@ fun case_2() { x = null } finally { } x - x.not() + x.not() } } @@ -52,7 +52,7 @@ fun case_3(x: String?) { } } x - x.length + x.length } /* @@ -69,7 +69,7 @@ fun case_4(x: String?) { } } x - x.length + x.length } /* @@ -86,7 +86,7 @@ fun case_5(x: String?) { } } while (true) x - x.length + x.length } /* @@ -105,5 +105,5 @@ fun case_6(x: String?) { } } while (true) x - x.length + x.length } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/26.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/26.fir.kt index bfdb0be3edd..08cad2f0ca1 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/26.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/26.fir.kt @@ -10,18 +10,18 @@ fun case_1() { var x: MutableList? = mutableListOf(1) x!! - & kotlin.collections.MutableList?")!>x[if (true) {x=null;0} else 0] += ? & kotlin.collections.MutableList?")!>x[0] + & kotlin.collections.MutableList?")!>x[if (true) {x=null;0} else 0] += ? & kotlin.collections.MutableList?")!>x[0] ? & kotlin.collections.MutableList?")!>x - ? & kotlin.collections.MutableList?")!>x[0].inv() + ? & kotlin.collections.MutableList?")!>x[0].inv() } // TESTCASE NUMBER: 2 fun case_2() { var x: MutableList? = mutableListOf(1) x!! - & kotlin.collections.MutableList?")!>x[if (true) {x=null;0} else 0] = ? & kotlin.collections.MutableList?")!>x[0] + & kotlin.collections.MutableList?")!>x[if (true) {x=null;0} else 0] = ? & kotlin.collections.MutableList?")!>x[0] ? & kotlin.collections.MutableList?")!>x - ? & kotlin.collections.MutableList?")!>x[0].inv() + ? & kotlin.collections.MutableList?")!>x[0].inv() } // TESTCASE NUMBER: 3 @@ -30,7 +30,7 @@ fun case_3() { x!! & kotlin.collections.MutableList?")!>x[0] = if (true) {x=null;0} else 0 ? & kotlin.collections.MutableList?")!>x - ? & kotlin.collections.MutableList?")!>x[0].inv() + ? & kotlin.collections.MutableList?")!>x[0].inv() } /* @@ -55,16 +55,16 @@ fun case_5() { var x: Class? = Class() x!! x(if (true) {x=null;0} else 0, x) - x.fun_1() + x.fun_1() } // TESTCASE NUMBER: 6 fun case_6() { var x: MutableList>? = mutableListOf(mutableListOf(1)) x!! - > & kotlin.collections.MutableList>?")!>x[if (true) {x=null;0} else 0][>? & kotlin.collections.MutableList>?")!>x[0][0]] += 10 + > & kotlin.collections.MutableList>?")!>x[if (true) {x=null;0} else 0][>? & kotlin.collections.MutableList>?")!>x[0][0]] += 10 >? & kotlin.collections.MutableList>?")!>x - >? & kotlin.collections.MutableList>?")!>x[0][0].inv() + >? & kotlin.collections.MutableList>?")!>x[0][0].inv() } /* @@ -76,21 +76,21 @@ fun case_7() { var x: Class? = Class() x!! x(if (true) {x=null;0} else 0)(x) - x.fun_1() + x.fun_1() } // TESTCASE NUMBER: 8 fun case_8() { var x: MutableList>? = mutableListOf(mutableListOf(1)) x!! - > & kotlin.collections.MutableList>?")!>x[if (true) {x=null;0} else 0].addAll(1, >? & kotlin.collections.MutableList>?")!>x[0]) + > & kotlin.collections.MutableList>?")!>x[if (true) {x=null;0} else 0].addAll(1, >? & kotlin.collections.MutableList>?")!>x[0]) } // TESTCASE NUMBER: 9 fun case_9() { var x: MutableList>? = mutableListOf(mutableListOf(1)) x!! - > & kotlin.collections.MutableList>?")!>x[if (true) {x=null;0} else 0].subList(0, 2)[>? & kotlin.collections.MutableList>?")!>x[0][0]] + > & kotlin.collections.MutableList>?")!>x[if (true) {x=null;0} else 0].subList(0, 2)[>? & kotlin.collections.MutableList>?")!>x[0][0]] } /* @@ -101,7 +101,7 @@ fun case_9() { fun case_10() { var x: MutableList>? = mutableListOf(mutableListOf(1)) x!! - > & kotlin.collections.MutableList>?")!>x.subList(if (true) {x=null;0} else 0, 2)[>? & kotlin.collections.MutableList>?")!>x[0][0]] + > & kotlin.collections.MutableList>?")!>x.subList(if (true) {x=null;0} else 0, 2)[>? & kotlin.collections.MutableList>?")!>x[0][0]] } /* @@ -112,5 +112,5 @@ fun case_10() { fun case_11() { var x: MutableList>? = mutableListOf(mutableListOf(1)) x!! - > & kotlin.collections.MutableList>?")!>x[if (true) {x=null;0} else 0].subList(>? & kotlin.collections.MutableList>?")!>x[0][0], 2) + > & kotlin.collections.MutableList>?")!>x[if (true) {x=null;0} else 0].subList(>? & kotlin.collections.MutableList>?")!>x[0][0], 2) } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/27.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/27.fir.kt index d69c925a5d8..de66e6e0583 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/27.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/27.fir.kt @@ -14,7 +14,7 @@ fun case_1(x: Boolean?, y: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 2 @@ -38,7 +38,7 @@ fun case_3(x: Boolean?, y: Boolean?) { } x - x.not() + x.not() } /* @@ -53,7 +53,7 @@ fun case_4(x: Boolean?, y: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 5 @@ -64,7 +64,7 @@ fun case_5(x: Boolean?, y: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 6 @@ -79,7 +79,7 @@ fun case_6(x: Boolean?, y: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 7 @@ -108,5 +108,5 @@ fun case_8(x: Boolean?, y: Boolean?) { } x - x.not() + x.not() } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/29.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/29.fir.kt index c31bf6671be..7a6af78a908 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/29.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/29.fir.kt @@ -10,7 +10,7 @@ fun case_1(a: Any?) { } a - a.equals(10) + a.equals(10) } // TESTCASE NUMBER: 2 @@ -23,7 +23,7 @@ fun case_2(a: Any?) { })() a - a.equals(10) + a.equals(10) } // TESTCASE NUMBER: 3 @@ -36,7 +36,7 @@ fun case_3(a: Any?) { } a - a.equals(10) + a.equals(10) } // TESTCASE NUMBER: 4 @@ -49,7 +49,7 @@ fun case_4(a: Any?) { } a - a.equals(10) + a.equals(10) } /* @@ -65,7 +65,7 @@ fun case_5(a: Any?) { } a - a.equals(10) + a.equals(10) } /* @@ -81,7 +81,7 @@ fun case_6(a: Any?) { } a - a.equals(10) + a.equals(10) } /* @@ -97,7 +97,7 @@ fun case_7(a: Any?) { } a - a.equals(10) + a.equals(10) } // TESTCASE NUMBER: 8 @@ -112,5 +112,5 @@ fun case_8(a: Any?) { } a - a.equals(10) + a.equals(10) } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/30.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/30.fir.kt index 05ab6ad76a3..83a0c6a30f8 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/30.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/30.fir.kt @@ -30,8 +30,8 @@ class Case5(val y: Any?): ClassWithCostructorParam(y as Interface1), Interface1 // TESTCASE NUMBER: 6 fun case_6(a: Int?) = object : ClassWithCostructorParam(a!!) { - fun run() = a.toShort() + fun run() = a.toShort() init { - println(a.toShort()) + println(a.toShort()) } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/34.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/34.fir.kt index 767a3147e0d..c2ae00182c8 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/34.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/34.fir.kt @@ -14,7 +14,7 @@ fun case_1() { break } x - x.length + x.length } /* @@ -29,7 +29,7 @@ fun case_3() { break } x - x.length + x.length } /* @@ -44,7 +44,7 @@ fun case_4() { break } x - x.not() + x.not() } // TESTCASE NUMBER: 5 @@ -57,7 +57,7 @@ fun case_5() { break } x - x.not() + x.not() } // TESTCASE NUMBER: 6 @@ -65,12 +65,12 @@ fun case_6() { var x: Boolean? = true while (false && x!!) { x - x.not() + x.not() x = null break } x - x.not() + x.not() } // TESTCASE NUMBER: 7 @@ -78,12 +78,12 @@ fun case_7() { var x: Boolean? = true while (true || x!!) { x - x.not() + x.not() x = null break } x - x.not() + x.not() } // TESTCASE NUMBER: 8 @@ -91,12 +91,12 @@ fun case_8() { var x: Boolean? = true while (!(false && x!!)) { x - x.not() + x.not() x = null break } x - x.not() + x.not() } // TESTCASE NUMBER: 9 @@ -137,12 +137,12 @@ fun case_12() { var x: Boolean? = true do { x - x.not() + x.not() x = null break } while (true && x!!) x - x.not() + x.not() } // TESTCASE NUMBER: 13 @@ -150,12 +150,12 @@ fun case_13() { var x: Boolean? = true do { x - x.not() + x.not() x = null break } while (false && x!!) x - x.not() + x.not() } // TESTCASE NUMBER: 14 @@ -163,12 +163,12 @@ fun case_14() { var x: Boolean? = true do { x - x.not() + x.not() x = null break } while (true || x!!) x - x.not() + x.not() } // TESTCASE NUMBER: 15 @@ -176,12 +176,12 @@ fun case_15() { var x: Boolean? = true do { x - x.not() + x.not() x = null break } while (!(false && x!!)) x - x.not() + x.not() } /* @@ -195,7 +195,7 @@ fun case_16() { break } x - x.not() + x.not() } /* @@ -209,5 +209,5 @@ fun case_17() { break } x - x.not() + x.not() } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/35.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/35.fir.kt index e36e5e01c9b..7c82b872312 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/35.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/35.fir.kt @@ -12,7 +12,7 @@ fun case_1() { x = "Test" println("${if (true) x = null else 1}") x - x.length + x.length } /* @@ -25,7 +25,7 @@ fun case_2() { x = "Test" println("${try { x = null } finally { }}") x - x.length + x.length } /* @@ -38,7 +38,7 @@ fun case_3() { x = "Test" println("${try { } finally { x = null }}") x - x.length + x.length } /* @@ -51,7 +51,7 @@ fun case_4() { x = "Test" println("${try { x = null } catch (e: Exception) { } finally { }}") x - x.length + x.length } /* @@ -64,7 +64,7 @@ fun case_5() { x = "Test" println("${try { } catch (e: Exception) { x = null } finally { }}") x - x.length + x.length } /* @@ -77,7 +77,7 @@ fun case_6() { x = "Test" println("${try { } catch (e: Exception) { } finally { x = null }}") x - x.length + x.length } /* @@ -90,7 +90,7 @@ fun case_7() { x = "Test" println("${try { x = null } catch (e: Exception) { }}") x - x.length + x.length } /* @@ -103,7 +103,7 @@ fun case_8() { x = "Test" println("${try { } catch (e: Exception) { x = null }}") x - x.length + x.length } /* @@ -116,5 +116,5 @@ fun case_9() { x = "Test" println("${when (null) { else -> x = null } }") x - x.length + x.length } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/37.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/37.fir.kt index 8d0b1560404..ceaacb181be 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/37.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/37.fir.kt @@ -13,7 +13,7 @@ fun case_1() { x x++ x - x.equals(10) + x.equals(10) } } @@ -28,7 +28,7 @@ fun case_2() { x x-- x - x.equals(10) + x.equals(10) } /* @@ -42,7 +42,7 @@ fun case_3() { x --x x - x.equals(10) + x.equals(10) } /* @@ -56,7 +56,7 @@ fun case_4() { x ++x x - x.equals(10) + x.equals(10) } // TESTCASE NUMBER: 5 @@ -66,7 +66,7 @@ fun case_5() { x x = x + x x - x.equals(10) + x.equals(10) } // TESTCASE NUMBER: 6 @@ -76,7 +76,7 @@ fun case_6() { x x = x - x x - x.equals(10) + x.equals(10) } } @@ -91,7 +91,7 @@ fun case_7() { x x += x x - x.equals(10) + x.equals(10) } /* @@ -105,5 +105,5 @@ fun case_8() { x x -= x x - x.equals(10) + x.equals(10) } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/38.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/38.fir.kt index 36564f9cf74..a9ffdf256fe 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/38.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/38.fir.kt @@ -16,7 +16,7 @@ fun case_1() { } } x - x.length + x.length } /* @@ -33,7 +33,7 @@ fun case_2() { } } x - x.length + x.length } /* @@ -50,7 +50,7 @@ fun case_3(y: Nothing?) { } } x - x.length + x.length } /* @@ -69,7 +69,7 @@ fun case_4(y: Nothing?) { } } x - x.length + x.length } // TESTCASE NUMBER: 5 @@ -82,7 +82,7 @@ fun case_5(y: Nothing?) { } } x - x.length + x.length } // TESTCASE NUMBER: 6 @@ -98,7 +98,7 @@ fun case_6(y: Nothing?) { break } x - x.length + x.length } /* @@ -115,7 +115,7 @@ fun case_7() { } while (x == null) } while (true) x - x.length + x.length } /* @@ -134,7 +134,7 @@ fun case_8(y: Nothing?) { } while (x === y) } while (true) x - x.length + x.length } // TESTCASE NUMBER: 9 @@ -146,7 +146,7 @@ fun case_9() { x = null } while (x != null) x - x.length + x.length } } @@ -159,7 +159,7 @@ fun case_10() { x = null } while (true) x - x.length + x.length } } @@ -173,6 +173,6 @@ fun case_11() { break } while (x == null) x - x.length + x.length } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/39.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/39.fir.kt index 1e10a3bfed2..bba69fbb6fd 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/39.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/39.fir.kt @@ -13,7 +13,7 @@ fun case_1() { println(x ?: break) } x - x.length + x.length } /* @@ -27,7 +27,7 @@ fun case_2(y: MutableList) { y[x ?: break] = 10 } x - x.inv() + x.inv() } /* @@ -41,7 +41,7 @@ fun case_3(y: MutableList) { y[0] = x ?: break } x - x.inv() + x.inv() } // TESTCASE NUMBER: 4 @@ -51,7 +51,7 @@ fun case_4() { x ?: break } x - x.inv() + x.inv() } // TESTCASE NUMBER: 5 @@ -61,7 +61,7 @@ fun case_5(y: Boolean) { y && (x ?: break) } x - x.not() + x.not() } // TESTCASE NUMBER: 6 @@ -71,7 +71,7 @@ fun case_6(y: Boolean) { y || (x ?: break) } x - x.not() + x.not() } // TESTCASE NUMBER: 7 @@ -81,7 +81,7 @@ fun case_7(y: Boolean?) { y ?: x ?: break } x - x.not() + x.not() } /* @@ -96,7 +96,7 @@ fun case_8() { y += x ?: break } x - x.inv() + x.inv() } /* @@ -111,7 +111,7 @@ fun case_9() { y -= x ?: break } x - x.inv() + x.inv() } /* @@ -126,7 +126,7 @@ fun case_10() { val z = y - (x ?: break) } x - x.inv() + x.inv() } /* @@ -141,7 +141,7 @@ fun case_11() { val z = y * (x ?: break) } x - x.inv() + x.inv() } // TESTCASE NUMBER: 12 @@ -152,7 +152,7 @@ fun case_12() { y += if (x == null) break else 10 } x - x.inv() + x.inv() } // TESTCASE NUMBER: 13 diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/4.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/4.fir.kt index 79edaa0df14..c21d640524a 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/4.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/4.fir.kt @@ -8,8 +8,8 @@ fun case_1(x: Any?) { x x.inv() x.not() - x.propAny - x.funAny() + x.propAny + x.funAny() } } @@ -19,8 +19,8 @@ fun case_2(x: Any?) { x x.inv() x.not() - x.propAny - x.funAny() + x.propAny + x.funAny() } } @@ -29,8 +29,8 @@ inline fun case_3(x: Any?) { if (x is Int is T) { x x.inv() - x.propAny - x.funAny() + x.propAny + x.funAny() } } @@ -39,8 +39,8 @@ inline fun case_4(x: Any?) { if (x is Int is T == null) { x x.inv() - x.propAny - x.funAny() + x.propAny + x.funAny() } } @@ -49,8 +49,8 @@ fun case_5(x: Any?) { if (x is Int != null) { x x.inv() - x.propAny - x.funAny() + x.propAny + x.funAny() } } @@ -59,8 +59,8 @@ fun case_6(x: Any?) { if (x is Int == null) { x x.inv() - x.propAny - x.funAny() + x.propAny + x.funAny() } } @@ -69,8 +69,8 @@ fun case_7(x: Any?) { if (!(x !is Int) == false) { x x.inv() - x.propAny - x.funAny() + x.propAny + x.funAny() } } @@ -79,8 +79,8 @@ fun case_8(x: Any?) { if (!(x !is Int) == true) else { x x.inv() - x.propAny - x.funAny() + x.propAny + x.funAny() } } @@ -89,8 +89,8 @@ fun case_9(x: Any?) { if (x !is Int !is Any?) { x x.inv() - x.propAny - x.funAny() + x.propAny + x.funAny() } } @@ -98,8 +98,8 @@ fun case_9(x: Any?) { inline fun case_10(x: Any?) { if (x is T is K is L) { x - x.propAny - x.funAny() + x.propAny + x.funAny() } } @@ -107,8 +107,8 @@ inline fun case_10(x: Any?) { inline fun case_11(x: Any?) { if (x is Int !is K !is T !is L) { x - x.propAny - x.funAny() + x.propAny + x.funAny() } } @@ -116,8 +116,8 @@ inline fun case_11(x: Any?) { inline fun case_12(x: Any?) { if (x !is K !is T !is L) { x - x.propAny - x.funAny() + x.propAny + x.funAny() } } @@ -125,8 +125,8 @@ inline fun case_12(x: Any?) { inline fun case_13(x: Any?) { if (!(x !is K !is T !is L)) { x - x.propAny - x.funAny() + x.propAny + x.funAny() } } @@ -134,8 +134,8 @@ inline fun case_13(x: Any?) { inline fun case_14(x: Any?) { if (!(x !is T is Boolean)) { x - x.propAny - x.funAny() + x.propAny + x.funAny() } } @@ -143,8 +143,8 @@ inline fun case_14(x: Any?) { inline fun case_15(x: Any?) { if (!(x !is T) is Boolean) { x - x.propAny - x.funAny() + x.propAny + x.funAny() } } @@ -152,8 +152,8 @@ inline fun case_15(x: Any?) { inline fun case_16(x: Any?) { if (((x is K) is T) is L) { x - x.propAny - x.funAny() + x.propAny + x.funAny() } } @@ -161,8 +161,8 @@ inline fun case_16(x: Any?) { inline fun case_17(x: Any?) { if (x is T is T) { x - x.propAny - x.funAny() + x.propAny + x.funAny() } } @@ -170,8 +170,8 @@ inline fun case_17(x: Any?) { inline fun case_18(x: Any?) { if (x !is T is T) { x - x.propAny - x.funAny() + x.propAny + x.funAny() } } @@ -179,7 +179,7 @@ inline fun case_18(x: Any?) { inline fun case_19(x: Any?) { if (x is T !is T) { x - x.propAny - x.funAny() + x.propAny + x.funAny() } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/41.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/41.fir.kt index 528fe33429c..a3e18e78507 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/41.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/41.fir.kt @@ -38,11 +38,11 @@ inline fun case_3(x: Any?) { is T? -> return else -> { x - x.equals(10) + x.equals(10) } } x - x.equals(10) + x.equals(10) } // TESTCASE NUMBER: 4 @@ -51,11 +51,11 @@ inline fun case_4(x: Any?) { is T -> return else -> { x - x.equals(10) + x.equals(10) } } x - x.equals(10) + x.equals(10) } // TESTCASE NUMBER: 5 @@ -72,7 +72,7 @@ inline fun case_5(x: Any?) { inline fun case_6(x: Any?) { if (x is T?) return x - x.equals(10) + x.equals(10) } // TESTCASE NUMBER: 7 diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/43.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/43.fir.kt index ccd654a62e8..213579890a6 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/43.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/43.fir.kt @@ -27,7 +27,7 @@ fun case_2(x: Boolean?, y: Any?) { if (x == false) return if (y != x) { y - y.equals(10) + y.equals(10) } } @@ -39,7 +39,7 @@ fun case_3(x : Unit?, y : Any?) { if (x == kotlin.Unit) return if (y != x) { y - y.equals(10) + y.equals(10) } } @@ -51,7 +51,7 @@ fun case_4(x : EnumClassSingle?, y : Any?) { if (x == EnumClassSingle.EVERYTHING) return if (y != x) { y - y.equals(10) + y.equals(10) } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/45.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/45.fir.kt index ac3393b0bc1..90152bf3f53 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/45.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/45.fir.kt @@ -9,7 +9,7 @@ fun case_1(x: Number?): Long? { if (x is Long?) return x x - return x.toLong() + return x.toLong() } /* diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/6.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/6.fir.kt index fc2fd14f197..35387be3f9a 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/6.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/6.fir.kt @@ -105,7 +105,7 @@ inline fun case_12(x: Any?) { if (x !is T) { if (x is T is K) { x - x.equals(10) + x.equals(10) } } } @@ -115,7 +115,7 @@ inline fun case_13(x: Any?) { if (x !is T) { if (x !is K) { x - x.equals(10) + x.equals(10) } } } @@ -125,7 +125,7 @@ inline fun case_14(x: Any?) { if (x is K) else { if (x !is T) { x - x.equals(10) + x.equals(10) } } } @@ -135,7 +135,7 @@ inline fun case_15(x: Any?) { if (x !is T) { if (x is K) else { x - x.equals(10) + x.equals(10) } } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/7.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/7.fir.kt index 9d0d22d7566..6d4234beba6 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/7.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/7.fir.kt @@ -6,7 +6,7 @@ fun case_1(x: Int?) { if ((x is Int) ?: (x is Int)) { x - x.inv() + x.inv() } } @@ -14,7 +14,7 @@ fun case_1(x: Int?) { fun case_2(x: Int?) { if (x?.equals(1) ?: x is Int) { x - x.inv() + x.inv() } } @@ -22,7 +22,7 @@ fun case_2(x: Int?) { fun case_3(x: Boolean?) { if (x ?: (x != null)) { x - x.not() + x.not() } } @@ -30,7 +30,7 @@ fun case_3(x: Boolean?) { fun case_4(x: Boolean?) { if (if (x != null) x else x != null) { x - x.not() + x.not() } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/8.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/8.fir.kt index 05b2ea29d44..16badd42e67 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/8.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/8.fir.kt @@ -7,9 +7,9 @@ fun case_1(x: Class?) { if (x?.fun_4()?.fun_4()?.fun_4()?.fun_4() != null) { x x.fun_4() - x.fun_4().fun_4() - x.fun_4().fun_4().fun_4() - x.fun_4().fun_4().fun_4().fun_4() + x.fun_4().fun_4() + x.fun_4().fun_4().fun_4() + x.fun_4().fun_4().fun_4().fun_4() } } @@ -18,7 +18,7 @@ fun case_2(x: Class?) { if (x?.fun_4()?.prop_8 != null) { x x.fun_4() - x.fun_4().prop_8 + x.fun_4().prop_8 } } @@ -27,7 +27,7 @@ fun case_3(x: Class?) { if (x?.prop_8?.fun_4() != null) { x x.prop_8 - x.prop_8.fun_4().prop_8 + x.prop_8.fun_4().prop_8 } } @@ -35,7 +35,7 @@ fun case_3(x: Class?) { fun case_4(x: Class?) { if (x?.prop_8.also { } != null) { x - x.prop_8 - x.prop_8.fun_4() + x.prop_8 + x.prop_8.fun_4() } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/9.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/9.fir.kt index 33826d89042..61dded58f92 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/9.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/9.fir.kt @@ -10,7 +10,7 @@ fun case_1(x: T?, y: K?) { x.equals(10) z - z.equals(10) + z.equals(10) } // TESTCASE NUMBER: 1 diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/13.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/13.fir.kt index c8701c8a687..6907969c88f 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/13.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/13.fir.kt @@ -10,29 +10,29 @@ fun case_1(x: T) { x x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() x.apply { equals(null) } x.apply { propT } - x.apply { propAny } + x.apply { propAny } x.apply { propNullableT } x.apply { propNullableAny } x.apply { funT() } - x.apply { funAny() } + x.apply { funAny() } x.apply { funNullableT() } x.apply { funNullableAny(); x.equals(null) } x.also { it.equals(null) } x.also { it.propT } - x.also { it.propAny } + x.also { it.propAny } x.also { it.propNullableT } x.also { it.propNullableAny } x.also { it.funT() } - x.also { it.funAny() } + x.also { it.funAny() } x.also { it.funNullableT() } x.also { it.funNullableAny() } } @@ -42,31 +42,31 @@ fun case_1(x: T) { fun case_2(x: T?, y: Nothing?) { if (y != x) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() - x.apply { equals(null) } + x.apply { equals(null) } x.apply { propT } - x.apply { propAny } + x.apply { propAny } x.apply { propNullableT } x.apply { propNullableAny } x.apply { funT() } - x.apply { funAny() } + x.apply { funAny() } x.apply { funNullableT() } - x.apply { funNullableAny(); x.equals(null) } - x.also { it.equals(null) } + x.apply { funNullableAny(); x.equals(null) } + x.also { it.equals(null) } x.also { it.propT } - x.also { it.propAny } + x.also { it.propAny } x.also { it.propNullableT } x.also { it.propNullableAny } x.also { it.funT() } - x.also { it.funAny() } + x.also { it.funAny() } x.also { it.funNullableT() } x.also { it.funNullableAny() } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/16.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/16.fir.kt index 3f1728cb83a..447f74470d2 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/16.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/16.fir.kt @@ -50,13 +50,13 @@ fun case_4(x: Number?) { fun case_5(x: Char?, y: Nothing?) { if (x != y) else return x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -65,13 +65,13 @@ fun case_5(x: Char?, y: Nothing?) { fun case_6(x: Object?) { if (x !== implicitNullableNothingProperty) else { return } x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -80,13 +80,13 @@ fun case_6(x: Object?) { fun case_7(x: Class?) { if (x === implicitNullableNothingProperty || false || false || false) { return } x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -95,7 +95,7 @@ fun case_7(x: Class?) { fun case_8(x: Int?) { if (false || false || false || x == nullableNothingProperty) return x - x.inv() + x.inv() } // TESTCASE NUMBER: 9 @@ -104,11 +104,11 @@ fun case_9(x: String?) { x x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -192,13 +192,13 @@ fun case_14(x: MutableCollection?) { fun case_15(x: MutableCollection?, y: Nothing?) { if (x != y) else return ?")!>x - ?")!>x.equals(null) + ?")!>x.equals(null) ?")!>x.propT - ?")!>x.propAny + ?")!>x.propAny ?")!>x.propNullableT ?")!>x.propNullableAny ?")!>x.funT() - ?")!>x.funAny() + ?")!>x.funAny() ?")!>x.funNullableT() ?")!>x.funNullableAny() } @@ -207,13 +207,13 @@ fun case_15(x: MutableCollection?, y: Nothing?) { fun case_16(x: Collection>>>>>>?) { if (x !== implicitNullableNothingProperty) else { return } >>>>>>?")!>x - >>>>>>?")!>x.equals(null) + >>>>>>?")!>x.equals(null) >>>>>>?")!>x.propT - >>>>>>?")!>x.propAny + >>>>>>?")!>x.propAny >>>>>>?")!>x.propNullableT >>>>>>?")!>x.propNullableAny >>>>>>?")!>x.funT() - >>>>>>?")!>x.funAny() + >>>>>>?")!>x.funAny() >>>>>>?")!>x.funNullableT() >>>>>>?")!>x.funNullableAny() } @@ -222,13 +222,13 @@ fun case_16(x: Collection?) { if (x === implicitNullableNothingProperty || false) { return } ?")!>x - ?")!>x.equals(null) + ?")!>x.equals(null) ?")!>x.propT - ?")!>x.propAny + ?")!>x.propAny ?")!>x.propNullableT ?")!>x.propNullableAny ?")!>x.funT() - ?")!>x.funAny() + ?")!>x.funAny() ?")!>x.funNullableT() ?")!>x.funNullableAny() } @@ -237,13 +237,13 @@ fun case_17(x: MutableMap<*, *>?) { fun case_18(x: MutableMap?) { if (false || false || false || x == nullableNothingProperty) return ?")!>x - ?")!>x.equals(null) + ?")!>x.equals(null) ?")!>x.propT - ?")!>x.propAny + ?")!>x.propAny ?")!>x.propNullableT ?")!>x.propNullableAny ?")!>x.funT() - ?")!>x.funAny() + ?")!>x.funAny() ?")!>x.funNullableT() ?")!>x.funNullableAny() } @@ -319,13 +319,13 @@ fun case_23(x: Inv?) { fun case_24(x: Inv?, y: Nothing?) { if (x !== y && true) else return ?")!>x - ?")!>x.equals(null) + ?")!>x.equals(null) ?")!>x.propT - ?")!>x.propAny + ?")!>x.propAny ?")!>x.propNullableT ?")!>x.propNullableAny ?")!>x.funT() - ?")!>x.funAny() + ?")!>x.funAny() ?")!>x.funNullableT() ?")!>x.funNullableAny() } @@ -384,13 +384,13 @@ fun case_28(x: Number?) { fun case_29(x: Char?, y: Nothing?) = l@ { if (x != y) else return@l x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -400,13 +400,13 @@ fun case_30(x: Object?): Any { return (l@ { if (x !== implicitNullableNothingProperty) else { return@l } x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() })() @@ -417,13 +417,13 @@ fun case_31(x: Class?): Any { return l@ { if (x === implicitNullableNothingProperty || false || false || false) { return@l } x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -434,13 +434,13 @@ fun case_32(x: Any?) { case_32((l@ { if (false || false || false || x == nullableNothingProperty) return@l x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() })()) @@ -451,13 +451,13 @@ fun case_33(x: Any?) { case_33(l@ { if (x != implicitNullableNothingProperty && true && true && true) else { return@l } x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() }) @@ -567,13 +567,13 @@ fun case_39(x: MutableCollection?, y: Nothing?) { (l2@ { if (x != y) else return@l2 ?")!>x - ?")!>x.equals(null) + ?")!>x.equals(null) ?")!>x.propT - ?")!>x.propAny + ?")!>x.propAny ?")!>x.propNullableT ?")!>x.propNullableAny ?")!>x.funT() - ?")!>x.funAny() + ?")!>x.funAny() ?")!>x.funNullableT() ?")!>x.funNullableAny() })() @@ -584,13 +584,13 @@ fun case_40(x: Collection>>>>>>?")!>x - >>>>>>?")!>x.equals(null) + >>>>>>?")!>x.equals(null) >>>>>>?")!>x.propT - >>>>>>?")!>x.propAny + >>>>>>?")!>x.propAny >>>>>>?")!>x.propNullableT >>>>>>?")!>x.propNullableAny >>>>>>?")!>x.funT() - >>>>>>?")!>x.funAny() + >>>>>>?")!>x.funAny() >>>>>>?")!>x.funNullableT() >>>>>>?")!>x.funNullableAny() })() @@ -601,13 +601,13 @@ fun case_41(x: MutableMap<*, *>?) { listOf(l@ { if (x === implicitNullableNothingProperty || false) { return@l } ?")!>x - ?")!>x.equals(null) + ?")!>x.equals(null) ?")!>x.propT - ?")!>x.propAny + ?")!>x.propAny ?")!>x.propNullableT ?")!>x.propNullableAny ?")!>x.funT() - ?")!>x.funAny() + ?")!>x.funAny() ?")!>x.funNullableT() ?")!>x.funNullableAny() }) @@ -618,13 +618,13 @@ fun case_42(x: MutableMap?) { return (l@ { if (false || false || false || x == nullableNothingProperty) return@l ?")!>x - ?")!>x.equals(null) + ?")!>x.equals(null) ?")!>x.propT - ?")!>x.propAny + ?")!>x.propAny ?")!>x.propNullableT ?")!>x.propNullableAny ?")!>x.funT() - ?")!>x.funAny() + ?")!>x.funAny() ?")!>x.funNullableT() ?")!>x.funNullableAny() })() @@ -712,13 +712,13 @@ fun case_48(x: Inv?, y: Nothing?) { val y = ((((l@ { if (x !== y && true) else return@l ?")!>x - ?")!>x.equals(null) + ?")!>x.equals(null) ?")!>x.propT - ?")!>x.propAny + ?")!>x.propAny ?")!>x.propNullableT ?")!>x.propNullableAny ?")!>x.funT() - ?")!>x.funAny() + ?")!>x.funAny() ?")!>x.funNullableT() ?")!>x.funNullableAny() })))) diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/17.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/17.fir.kt index 3fd920f67d1..462d5c8da62 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/17.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/17.fir.kt @@ -49,13 +49,13 @@ fun case_4(x: Number?) { fun case_5(x: Char?, y: Nothing?) { if (x != y) else throw Exception() x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -64,13 +64,13 @@ fun case_5(x: Char?, y: Nothing?) { fun case_6(x: Object?) { if (x !== implicitNullableNothingProperty) else { throw Exception() } x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -79,13 +79,13 @@ fun case_6(x: Object?) { fun case_7(x: Class?) { if (x === implicitNullableNothingProperty || false || false || false) { throw Exception() } x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -94,7 +94,7 @@ fun case_7(x: Class?) { fun case_8(x: Int?) { if (false || false || false || x == nullableNothingProperty) throw Exception() x - x.inv() + x.inv() } // TESTCASE NUMBER: 9 @@ -103,11 +103,11 @@ fun case_9(x: String?) { x x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -191,13 +191,13 @@ fun case_14(x: MutableCollection?) { fun case_15(x: MutableCollection?, y: Nothing?) { if (x != y) else throw Exception() ?")!>x - ?")!>x.equals(null) + ?")!>x.equals(null) ?")!>x.propT - ?")!>x.propAny + ?")!>x.propAny ?")!>x.propNullableT ?")!>x.propNullableAny ?")!>x.funT() - ?")!>x.funAny() + ?")!>x.funAny() ?")!>x.funNullableT() ?")!>x.funNullableAny() } @@ -206,13 +206,13 @@ fun case_15(x: MutableCollection?, y: Nothing?) { fun case_16(x: Collection>>>>>>?) { if (x !== implicitNullableNothingProperty) else { throw Exception() } >>>>>>?")!>x - >>>>>>?")!>x.equals(null) + >>>>>>?")!>x.equals(null) >>>>>>?")!>x.propT - >>>>>>?")!>x.propAny + >>>>>>?")!>x.propAny >>>>>>?")!>x.propNullableT >>>>>>?")!>x.propNullableAny >>>>>>?")!>x.funT() - >>>>>>?")!>x.funAny() + >>>>>>?")!>x.funAny() >>>>>>?")!>x.funNullableT() >>>>>>?")!>x.funNullableAny() } @@ -221,13 +221,13 @@ fun case_16(x: Collection?) { if (x === implicitNullableNothingProperty || false) { throw Exception() } ?")!>x - ?")!>x.equals(null) + ?")!>x.equals(null) ?")!>x.propT - ?")!>x.propAny + ?")!>x.propAny ?")!>x.propNullableT ?")!>x.propNullableAny ?")!>x.funT() - ?")!>x.funAny() + ?")!>x.funAny() ?")!>x.funNullableT() ?")!>x.funNullableAny() } @@ -236,13 +236,13 @@ fun case_17(x: MutableMap<*, *>?) { fun case_18(x: MutableMap?) { if (false || false || false || x == nullableNothingProperty) throw Exception() ?")!>x - ?")!>x.equals(null) + ?")!>x.equals(null) ?")!>x.propT - ?")!>x.propAny + ?")!>x.propAny ?")!>x.propNullableT ?")!>x.propNullableAny ?")!>x.funT() - ?")!>x.funAny() + ?")!>x.funAny() ?")!>x.funNullableT() ?")!>x.funNullableAny() } @@ -318,13 +318,13 @@ fun case_23(x: Inv?) { fun case_24(x: Inv?, y: Nothing?) { if (x !== y && true) else throw Exception() ?")!>x - ?")!>x.equals(null) + ?")!>x.equals(null) ?")!>x.propT - ?")!>x.propAny + ?")!>x.propAny ?")!>x.propNullableT ?")!>x.propNullableAny ?")!>x.funT() - ?")!>x.funAny() + ?")!>x.funAny() ?")!>x.funNullableT() ?")!>x.funNullableAny() } @@ -333,13 +333,13 @@ fun case_24(x: Inv?, y: Nothing?) { fun case_25(x: Inv?, y: Nothing?) { if (x !== y) else try { throw Exception() } finally { throw Exception() } ?")!>x - ?")!>x.equals(null) + ?")!>x.equals(null) ?")!>x.propT - ?")!>x.propAny + ?")!>x.propAny ?")!>x.propNullableT ?")!>x.propNullableAny ?")!>x.funT() - ?")!>x.funAny() + ?")!>x.funAny() ?")!>x.funNullableT() ?")!>x.funNullableAny() } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/18.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/18.fir.kt index 973070c70d5..6e1c672f4d2 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/18.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/18.fir.kt @@ -58,13 +58,13 @@ fun case_5(x: Char?, y: Nothing?, f: Boolean) { do { if (x != y) else continue x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } while (f) @@ -75,13 +75,13 @@ fun case_6(x: Object?, f: Boolean) { while (f) { if (x !== implicitNullableNothingProperty) else { continue } x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -92,13 +92,13 @@ fun case_7(x: Class?, list: List) { for (element in list) { if (x === implicitNullableNothingProperty || false || false || false) { break } x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -109,7 +109,7 @@ fun case_8(x: Int?) { for (i in 0..10) { if (false || false || false || x == nullableNothingProperty) continue x - x.inv() + x.inv() } } @@ -118,7 +118,7 @@ fun case_9(list: List) { for (element in list) { if (element != implicitNullableNothingProperty && true && true && true) else { break } element - element.inv() + element.inv() } } @@ -127,13 +127,13 @@ fun case_10(x: Float?) { while (false) { if (true && true && true && x !== null) else break x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -205,9 +205,9 @@ fun case_15(map: MutableMap, y: Nothing?) { if (k != y) else break if (v != y) else continue k - k.inv() + k.inv() v - v.inv() + v.inv() } } @@ -216,9 +216,9 @@ fun case_16(map: Map) { for ((k, v) in map) { if (k !== implicitNullableNothingProperty && v !== implicitNullableNothingProperty) else { continue } k - k.inv() + k.inv() v - v.inv() + v.inv() } } @@ -227,13 +227,13 @@ fun case_17(x: T?, f: Boolean) { while (f) { if (x === implicitNullableNothingProperty || false) { break } x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -246,11 +246,11 @@ fun case_18(x: T, f: Boolean) { x x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -263,21 +263,21 @@ fun case_19(map: MutableMap, y: Nothing?) { k k.equals(null) k.propT - k.propAny + k.propAny k.propNullableT k.propNullableAny k.funT() - k.funAny() + k.funAny() k.funNullableT() k.funNullableAny() v v.equals(null) v.propT - v.propAny + v.propAny v.propNullableT v.propNullableAny v.funT() - v.funAny() + v.funAny() v.funNullableT() v.funNullableAny() } @@ -377,13 +377,13 @@ fun case_24(x: Inv?, y: Nothing?) { do { if (x !== y && true) else continue ?")!>x - ?")!>x.equals(null) + ?")!>x.equals(null) ?")!>x.propT - ?")!>x.propAny + ?")!>x.propAny ?")!>x.propNullableT ?")!>x.propNullableAny ?")!>x.funT() - ?")!>x.funAny() + ?")!>x.funAny() ?")!>x.funNullableT() ?")!>x.funNullableAny() } while (true) @@ -398,13 +398,13 @@ fun case_25(x: Inv?, y: Nothing?, z: List) { continue } ?")!>x - ?")!>x.equals(null) + ?")!>x.equals(null) ?")!>x.propT - ?")!>x.propAny + ?")!>x.propAny ?")!>x.propNullableT ?")!>x.propNullableAny ?")!>x.funT() - ?")!>x.funAny() + ?")!>x.funAny() ?")!>x.funNullableT() ?")!>x.funNullableAny() } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/2.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/2.fir.kt index 02c785698d2..972c726a167 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/2.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/2.fir.kt @@ -25,13 +25,13 @@ class Case8_16__2 { fun case_1(x: Any?) { if (x != null || false) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -40,14 +40,14 @@ fun case_1(x: Any?) { // TESTCASE NUMBER: 2 fun case_2(a: DeepObject.A.B.C.D.E.F.G.J?) = if (false || a != null == true == false == false == false == true == false == true == false == false == true == true || false) { - a.x - a.equals(null) + a.x + a.equals(null) a.propT - a.propAny + a.propAny a.propNullableT a.propNullableAny a.funT() - a.funAny() + a.funAny() a.funNullableT() a.funNullableAny() } else -1 @@ -67,19 +67,19 @@ fun case_3(b: Boolean) { val y = if (b) x else null if (false || false || false || false || y !== null) { - val z = ?")!>y() - ?>?")!>y.equals(null) + val z = ?")!>y() + ?>?")!>y.equals(null) ?>?")!>y.propT - ?>?")!>y.propAny + ?>?")!>y.propAny ?>?")!>y.propNullableT ?>?")!>y.propNullableAny ?>?")!>y.funT() - ?>?")!>y.funAny() + ?>?")!>y.funAny() ?>?")!>y.funNullableT() ?>?")!>y.funNullableAny() if (z != null || false) { - ?")!>z.a + ?")!>z.a } } } @@ -87,14 +87,14 @@ fun case_3(b: Boolean) { // TESTCASE NUMBER: 4 fun case_4(a: ((Float) -> Int?)?, b: Float?) { if (a != null == true && b != null == true || false || false || false || false || false || false || false || false || false) { - val x = a(b) - ?")!>a.equals(null) + val x = a(b) + ?")!>a.equals(null) ?")!>a.propT - ?")!>a.propAny + ?")!>a.propAny ?")!>a.propNullableT ?")!>a.propNullableAny ?")!>a.funT() - ?")!>a.funAny() + ?")!>a.funAny() ?")!>a.funNullableT() ?")!>a.funNullableAny() @@ -125,16 +125,16 @@ fun case_5(b: Boolean) { } else null if (a != null && a.B5 != null && a.B5.C5 != null && a.B5.C5.D5 != null && a.B5.C5.D5.x != null && b || false) { - a.B5.C5.D5.x - a.B5.C5.D5.x.equals(null) - a.B5.C5.D5.x.propT - a.B5.C5.D5.x.propAny - a.B5.C5.D5.x.propNullableT - a.B5.C5.D5.x.propNullableAny - a.B5.C5.D5.x.funT() - a.B5.C5.D5.x.funAny() - a.B5.C5.D5.x.funNullableT() - a.B5.C5.D5.x.funNullableAny() + a.B5.C5.D5.x + a.B5.C5.D5.x.equals(null) + a.B5.C5.D5.x.propT + a.B5.C5.D5.x.propAny + a.B5.C5.D5.x.propNullableT + a.B5.C5.D5.x.propNullableAny + a.B5.C5.D5.x.funT() + a.B5.C5.D5.x.funAny() + a.B5.C5.D5.x.funNullableT() + a.B5.C5.D5.x.funNullableAny() } } @@ -142,13 +142,13 @@ fun case_5(b: Boolean) { fun case_6(z: Boolean?) { if (false || EnumClassWithNullableProperty.B.prop_1 != null && z != null && z) { EnumClassWithNullableProperty.B.prop_1 - EnumClassWithNullableProperty.B.prop_1.equals(null) + EnumClassWithNullableProperty.B.prop_1.equals(null) EnumClassWithNullableProperty.B.prop_1.propT - EnumClassWithNullableProperty.B.prop_1.propAny + EnumClassWithNullableProperty.B.prop_1.propAny EnumClassWithNullableProperty.B.prop_1.propNullableT EnumClassWithNullableProperty.B.prop_1.propNullableAny EnumClassWithNullableProperty.B.prop_1.funT() - EnumClassWithNullableProperty.B.prop_1.funAny() + EnumClassWithNullableProperty.B.prop_1.funAny() EnumClassWithNullableProperty.B.prop_1.funNullableT() EnumClassWithNullableProperty.B.prop_1.funNullableAny() } @@ -247,14 +247,14 @@ fun case_10(a: DeepObject.A.B.C.D.E.F.G.J?) = if (a == null == true == false == false == false == true == false == true == false == false == true == true && true) { -1 } else { - a.x - a.equals(null) + a.x + a.equals(null) a.propT - a.propAny + a.propAny a.propNullableT a.propNullableAny a.funT() - a.funAny() + a.funAny() a.funNullableT() a.funNullableAny() } @@ -274,14 +274,14 @@ fun case_11(b: Boolean) { val y = if (b) x else null if (y === null && true) else { - val z = ?")!>y() - ?>?")!>y.equals(null) + val z = ?")!>y() + ?>?")!>y.equals(null) ?>?")!>y.propT - ?>?")!>y.propAny + ?>?")!>y.propAny ?>?")!>y.propNullableT ?>?")!>y.propNullableAny ?>?")!>y.funT() - ?>?")!>y.funAny() + ?>?")!>y.funAny() ?>?")!>y.funNullableT() ?>?")!>y.funNullableAny() @@ -298,14 +298,14 @@ fun case_12(a: ((Float) -> Int?)?, b: Float?, c: Boolean?) { if (true && a == null == true || b == null == true) { } else { - val x = a(b) - ?")!>a.equals(null) + val x = a(b) + ?")!>a.equals(null) ?")!>a.propT - ?")!>a.propAny + ?")!>a.propAny ?")!>a.propNullableT ?")!>a.propNullableAny ?")!>a.funT() - ?")!>a.funAny() + ?")!>a.funAny() ?")!>a.funNullableT() ?")!>a.funNullableAny() b.equals(null) @@ -357,16 +357,16 @@ fun case_13(b: Boolean, c: Boolean, d: Boolean) { if ((a == null || a.B19 == null || a.B19.C19 == null || a.B19.C19.D19 == null || a.B19.C19.D19.x == null || b || c || !d) && true) { } else { - a.B19.C19.D19.x - a.B19.C19.D19.x.equals(null) - a.B19.C19.D19.x.propT - a.B19.C19.D19.x.propAny - a.B19.C19.D19.x.propNullableT - a.B19.C19.D19.x.propNullableAny - a.B19.C19.D19.x.funT() - a.B19.C19.D19.x.funAny() - a.B19.C19.D19.x.funNullableT() - a.B19.C19.D19.x.funNullableAny() + a.B19.C19.D19.x + a.B19.C19.D19.x.equals(null) + a.B19.C19.D19.x.propT + a.B19.C19.D19.x.propAny + a.B19.C19.D19.x.propNullableT + a.B19.C19.D19.x.propNullableAny + a.B19.C19.D19.x.funT() + a.B19.C19.D19.x.funAny() + a.B19.C19.D19.x.funNullableT() + a.B19.C19.D19.x.funNullableAny() } } @@ -380,13 +380,13 @@ fun case_14(z: Boolean?) { } else { EnumClassWithNullableProperty.B.prop_1 - EnumClassWithNullableProperty.B.prop_1.equals(null) + EnumClassWithNullableProperty.B.prop_1.equals(null) EnumClassWithNullableProperty.B.prop_1.propT - EnumClassWithNullableProperty.B.prop_1.propAny + EnumClassWithNullableProperty.B.prop_1.propAny EnumClassWithNullableProperty.B.prop_1.propNullableT EnumClassWithNullableProperty.B.prop_1.propNullableAny EnumClassWithNullableProperty.B.prop_1.funT() - EnumClassWithNullableProperty.B.prop_1.funAny() + EnumClassWithNullableProperty.B.prop_1.funAny() EnumClassWithNullableProperty.B.prop_1.funNullableT() EnumClassWithNullableProperty.B.prop_1.funNullableAny() } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/25.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/25.fir.kt index 1c3fc096dca..2fddb835ba8 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/25.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/25.fir.kt @@ -52,8 +52,8 @@ inline fun case_4(x: Any?) { (x as? T)!! if (x is T?) { x - x.length - x.get(0) + x.length + x.get(0) } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/26.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/26.fir.kt index 1c3fc096dca..2fddb835ba8 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/26.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/26.fir.kt @@ -52,8 +52,8 @@ inline fun case_4(x: Any?) { (x as? T)!! if (x is T?) { x - x.length - x.get(0) + x.length + x.get(0) } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/27.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/27.fir.kt index 1c3fc096dca..2fddb835ba8 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/27.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/27.fir.kt @@ -52,8 +52,8 @@ inline fun case_4(x: Any?) { (x as? T)!! if (x is T?) { x - x.length - x.get(0) + x.length + x.get(0) } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/30.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/30.fir.kt index fc70e9530eb..61de817a017 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/30.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/30.fir.kt @@ -11,9 +11,9 @@ fun case_1(x: Class?) { if (x!!.prop_8?.prop_8?.prop_8?.prop_8 != null) { x x.prop_8 - x.prop_8.prop_8 - x.prop_8.prop_8.prop_8 - x.prop_8.prop_8.prop_8.prop_8 + x.prop_8.prop_8 + x.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8.prop_8 } } @@ -27,8 +27,8 @@ fun case_2(x: Class?) { x x.prop_8 x.prop_8.prop_8 - x.prop_8.prop_8.prop_8 - x.prop_8.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8.prop_8 } } @@ -43,7 +43,7 @@ fun case_3(x: Class?) { x.prop_8 x.prop_8.prop_8 x.prop_8.prop_8.prop_8 - x.prop_8.prop_8.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8.prop_8.prop_8 } } @@ -56,9 +56,9 @@ fun case_4(x: Class?) { if (x!!?.prop_8?.prop_8?.prop_8?.prop_8 == null == true) else { x x.prop_8 - x.prop_8.prop_8 - x.prop_8.prop_8.prop_8 - x.prop_8.prop_8.prop_8.prop_8 + x.prop_8.prop_8 + x.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8.prop_8 } } @@ -72,8 +72,8 @@ fun case_5(x: Class?) { x x.prop_8 x.prop_8.prop_8 - x.prop_8.prop_8.prop_8 - x.prop_8.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8.prop_8 } } @@ -88,7 +88,7 @@ fun case_6(x: Class?) { x.prop_8 x.prop_8.prop_8 x.prop_8.prop_8.prop_8 - x.prop_8.prop_8.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8.prop_8.prop_8 } } @@ -101,9 +101,9 @@ fun case_7(x: Class) { if (x!!.prop_8?.prop_8?.prop_8?.prop_8 != null) { x x.prop_8 - x.prop_8.prop_8 - x.prop_8.prop_8.prop_8 - x.prop_8.prop_8.prop_8.prop_8 + x.prop_8.prop_8 + x.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8.prop_8 } } @@ -116,9 +116,9 @@ fun case_8(x: Class) { if (x!!.prop_8?.prop_8?.prop_8?.prop_8 != null) { x x.prop_8 - x.prop_8.prop_8 - x.prop_8.prop_8.prop_8 - x.prop_8.prop_8.prop_8.prop_8 + x.prop_8.prop_8 + x.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8.prop_8 } } // TESTCASE NUMBER: 9 @@ -136,8 +136,8 @@ fun case_9(x: T) { */ fun case_10(x: Inv?) { if (x!!.prop_1?.prop_1?.prop_1?.prop_2 != null) { - x.prop_1.prop_1.prop_1.prop_2 - x.prop_1.prop_1.prop_1.prop_2.equals(10) + x.prop_1.prop_1.prop_1.prop_2 + x.prop_1.prop_1.prop_1.prop_2.equals(10) } } @@ -148,8 +148,8 @@ fun case_10(x: Inv?) { */ inline fun case_11(x: Inv?) { if (x?.prop_1!!.prop_1?.prop_1?.prop_2 == null) else { - x.prop_1.prop_1.prop_1.prop_2 - x.prop_1.prop_1.prop_1.prop_2.equals(10) + x.prop_1.prop_1.prop_1.prop_2 + x.prop_1.prop_1.prop_1.prop_2.equals(10) } } @@ -161,7 +161,7 @@ inline fun case_11(x: Inv?) { fun case_12(x: Inv?) { if (x?.prop_1?.prop_1?.prop_1!!.prop_1 == null) else { x.prop_1.prop_1.prop_1.prop_1 - x.prop_1.prop_1.prop_1.prop_1.equals(10) + x.prop_1.prop_1.prop_1.prop_1.equals(10) } } @@ -172,7 +172,7 @@ fun case_12(x: Inv?) { */ inline fun case_13(x: Out?) { if (x?.prop_1?.prop_1!!.prop_1?.prop_1 != null) { - x.prop_1.prop_1.prop_1.prop_1 - x.prop_1.prop_1.prop_1.prop_1.equals(10) + x.prop_1.prop_1.prop_1.prop_1 + x.prop_1.prop_1.prop_1.prop_1.equals(10) } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/31.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/31.fir.kt index d2c30cd69ea..0e315921960 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/31.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/31.fir.kt @@ -11,9 +11,9 @@ fun case_1(x: Any?) { if ((x as Class).prop_8?.prop_8?.prop_8?.prop_8 != null) { x x.prop_8 - x.prop_8.prop_8 - x.prop_8.prop_8.prop_8 - x.prop_8.prop_8.prop_8.prop_8 + x.prop_8.prop_8 + x.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8.prop_8 } } @@ -26,9 +26,9 @@ fun case_2(x: Class?) { if ((x as Class).prop_8?.prop_8?.prop_8?.prop_8 !== null) { x x.prop_8 - x.prop_8.prop_8 - x.prop_8.prop_8.prop_8 - x.prop_8.prop_8.prop_8.prop_8 + x.prop_8.prop_8 + x.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8.prop_8 } } @@ -40,10 +40,10 @@ fun case_2(x: Class?) { fun case_3(x: Any?) { if ((x as Class?)?.prop_8?.prop_8?.prop_8?.prop_8 == null) else { x - x.prop_8 - x.prop_8.prop_8 - x.prop_8.prop_8.prop_8 - x.prop_8.prop_8.prop_8.prop_8.prop_8 + x.prop_8 + x.prop_8.prop_8 + x.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8.prop_8.prop_8 } } @@ -55,10 +55,10 @@ fun case_3(x: Any?) { fun case_4(x: Any?) { if ((x as Class?)!!.prop_8?.prop_8?.prop_8?.prop_8 == null) else { x - x.prop_8 - x.prop_8.prop_8 - x.prop_8.prop_8.prop_8 - x.prop_8.prop_8.prop_8.prop_8.prop_8 + x.prop_8 + x.prop_8.prop_8 + x.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8.prop_8.prop_8 } } @@ -72,8 +72,8 @@ fun case_5(x: Class?) { x x.prop_8 x.prop_8.prop_8 - x.prop_8.prop_8.prop_8 - x.prop_8.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8.prop_8 } } @@ -88,7 +88,7 @@ fun case_6(x: Class?) { x.prop_8 x.prop_8.prop_8 x.prop_8.prop_8.prop_8 - x.prop_8.prop_8.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8.prop_8.prop_8 } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/35.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/35.fir.kt index 7962e99eac4..31947eda671 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/35.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/35.fir.kt @@ -13,7 +13,7 @@ fun case_1(x: Any?) { } x - x.equals(10) + x.equals(10) } // TESTCASE NUMBER: 2 @@ -24,7 +24,7 @@ fun case_2(x: Any?) { } x - x.equals(10) + x.equals(10) } /* @@ -38,7 +38,7 @@ fun case_3(x: Any?) { } x - x.equals(10) + x.equals(10) } // TESTCASE NUMBER: 4 diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/37.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/37.fir.kt index dc3d3d23c97..68193e742cb 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/37.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/37.fir.kt @@ -13,7 +13,7 @@ fun case_1(x: Any?) { } x - x.equals(10) + x.equals(10) } // TESTCASE NUMBER: 2 @@ -24,7 +24,7 @@ fun case_2(a: Any?) { } a - a.equals(10) + a.equals(10) } /* @@ -38,7 +38,7 @@ fun case_3(x: Int?) { } x - x.equals(10) + x.equals(10) } // TESTCASE NUMBER: 4 @@ -48,7 +48,7 @@ fun case_4(x: Boolean?) { } x - x.equals(10) + x.equals(10) } /* @@ -62,7 +62,7 @@ fun case_5(x: Boolean?) { } x - x.equals(10) + x.equals(10) } // TESTCASE NUMBER: 6 @@ -72,7 +72,7 @@ fun case_6(x: Boolean?) { } x - x.equals(10) + x.equals(10) } // TESTCASE NUMBER: 7 @@ -82,7 +82,7 @@ fun case_7(x: Boolean?) { } x - x.equals(10) + x.equals(10) } // TESTCASE NUMBER: 8 @@ -110,7 +110,7 @@ fun case_10(x: Boolean?) { } x - x.equals(10) + x.equals(10) } // TESTCASE NUMBER: 11 @@ -147,7 +147,7 @@ fun case_13(x: Boolean?) { } x - x.equals(10) + x.equals(10) } /* diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/40.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/40.fir.kt index 9b62fcdd1c6..76fd6697ca9 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/40.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/40.fir.kt @@ -97,8 +97,8 @@ fun case_10(x: Any?) { */ fun case_11(x: Any?) { if ((x as Boolean?)!!) { - x.not() - select(x).not() + x.not() + select(x).not() } } @@ -121,8 +121,8 @@ fun case_12(x: Any?) { */ fun case_13(x: Any?) { if (x as Boolean? ?: x!!) { - x.not() - select(x).not() + x.not() + select(x).not() } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/46.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/46.fir.kt index 8a474faaf97..b36b084f65c 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/46.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/46.fir.kt @@ -13,7 +13,7 @@ import kotlin.reflect.* fun case_1(x: Int?) { if (x != funNothingQuest() == true) { x - x.inv() + x.inv() } } @@ -26,7 +26,7 @@ fun case_2(x: Int?) { operator fun Nothing?.not() = null if (x != !null != false) { x - x.inv() + x.inv() } } @@ -50,7 +50,7 @@ fun case_3(x: Int?) { fun case_4(x: Int?, y: List) { if (x == y[0] == true) { x - x.inv() + x.inv() } } @@ -66,7 +66,7 @@ fun case_5(x: Int?) { if (x == y.z == true) { x - x.inv() + x.inv() } } @@ -80,7 +80,7 @@ fun case_6(x: Int?) { if (x == y == true) { x - x.inv() + x.inv() } } @@ -97,7 +97,7 @@ fun case_7(x: Int?) { if (x == y.z == true) { x - x.inv() + x.inv() } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/52.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/52.fir.kt index 9415700500e..f8f56b1e824 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/52.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/52.fir.kt @@ -89,7 +89,7 @@ fun T.case_9() = this fun case_9() { var x: Int? = 10 x = null - x.case_9() + x.case_9() } /* diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/59.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/59.fir.kt index ce11b7f0721..beab8636a9b 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/59.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/59.fir.kt @@ -142,7 +142,7 @@ fun case_11() { x as? Any ?: null!! do { x - x = x.equals(10) + x = x.equals(10) } while (x != null) } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/6.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/6.fir.kt index 3f6e10f3772..19514767c5f 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/6.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/6.fir.kt @@ -19,13 +19,13 @@ fun case_1(x: Any?) { val y = null if (x != y) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -51,13 +51,13 @@ fun case_3() { if (Object.prop_1 == y) else { Object.prop_1 - Object.prop_1.equals(null) + Object.prop_1.equals(null) Object.prop_1.propT - Object.prop_1.propAny + Object.prop_1.propAny Object.prop_1.propNullableT Object.prop_1.propNullableAny Object.prop_1.funT() - Object.prop_1.funAny() + Object.prop_1.funAny() Object.prop_1.funNullableT() Object.prop_1.funNullableAny() } @@ -67,13 +67,13 @@ fun case_3() { fun case_4(x: Char?, y: Nothing?) { if (x != y && true) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -86,13 +86,13 @@ fun case_5() { if (x !== y) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -104,13 +104,13 @@ fun case_6(x: EmptyClass?, z: Nothing?) { if (x != z && !y) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -122,13 +122,13 @@ fun case_7(x: EmptyObject?) { if (x != y || x != y) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -160,11 +160,11 @@ fun case_9(x: TypealiasNullableString?, y: Nothing?) { x x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -206,11 +206,11 @@ fun case_11(x: TypealiasNullableString?, y: TypealiasNullableString) { x x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -240,13 +240,13 @@ fun case_13(x: EmptyClass12_48?, z: Nothing?) = throw Exception() } else { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -268,11 +268,11 @@ fun case_14() { a.x a.x.equals(null) a.x.propT - a.x.propAny + a.x.propAny a.x.propNullableT a.x.propNullableAny a.x.funT() - a.x.funAny() + a.x.funAny() a.x.funNullableT() a.x.funNullableAny() } @@ -309,13 +309,13 @@ fun case_16() { // TESTCASE NUMBER: 17 val case_17 = if (nullableIntProperty === implicitNullableNothingProperty) 0 else { nullableIntProperty - nullableIntProperty.equals(null) + nullableIntProperty.equals(null) nullableIntProperty.propT - nullableIntProperty.propAny + nullableIntProperty.propAny nullableIntProperty.propNullableT nullableIntProperty.propNullableAny nullableIntProperty.funT() - nullableIntProperty.funAny() + nullableIntProperty.funAny() nullableIntProperty.funNullableT() nullableIntProperty.funNullableAny() } @@ -330,13 +330,13 @@ fun case_18(a: DeepObject.A.B.C.D.E.F.G.J?, b: Boolean) { if (a != (if (b) x else y) || x !== a) { a - a.equals(null) + a.equals(null) a.propT - a.propAny + a.propAny a.propNullableT a.propNullableAny a.funT() - a.funAny() + a.funAny() a.funNullableT() a.funNullableAny() } @@ -363,17 +363,17 @@ fun case_19(b: Boolean) { } } else z - if (a != z && a.B19 !== z && a.B19.C19 != z && a.B19.C19.D19 != z && a.B19.C19.D19.x !== z) { - a.B19.C19.D19.x - a.B19.C19.D19.x.equals(null) - a.B19.C19.D19.x.propT - a.B19.C19.D19.x.propAny - a.B19.C19.D19.x.propNullableT - a.B19.C19.D19.x.propNullableAny - a.B19.C19.D19.x.funT() - a.B19.C19.D19.x.funAny() - a.B19.C19.D19.x.funNullableT() - a.B19.C19.D19.x.funNullableAny() + if (a != z && a.B19 !== z && a.B19.C19 != z && a.B19.C19.D19 != z && a.B19.C19.D19.x !== z) { + a.B19.C19.D19.x + a.B19.C19.D19.x.equals(null) + a.B19.C19.D19.x.propT + a.B19.C19.D19.x.propAny + a.B19.C19.D19.x.propNullableT + a.B19.C19.D19.x.propNullableAny + a.B19.C19.D19.x.funT() + a.B19.C19.D19.x.funAny() + a.B19.C19.D19.x.funNullableT() + a.B19.C19.D19.x.funNullableAny() } } @@ -391,13 +391,13 @@ fun case_20(x: Boolean, y: Nothing?) { if (z.B19.C19.D19 !== y) { z.B19.C19.D19 - z.B19.C19.D19.equals(null) + z.B19.C19.D19.equals(null) z.B19.C19.D19.propT - z.B19.C19.D19.propAny + z.B19.C19.D19.propAny z.B19.C19.D19.propNullableT z.B19.C19.D19.propNullableAny z.B19.C19.D19.funT() - z.B19.C19.D19.funAny() + z.B19.C19.D19.funAny() z.B19.C19.D19.funNullableT() z.B19.C19.D19.funNullableAny() } @@ -407,13 +407,13 @@ fun case_20(x: Boolean, y: Nothing?) { fun case_21() { if (EnumClassWithNullableProperty.A.prop_1 !== implicitNullableNothingProperty) { EnumClassWithNullableProperty.A.prop_1 - EnumClassWithNullableProperty.A.prop_1.equals(null) + EnumClassWithNullableProperty.A.prop_1.equals(null) EnumClassWithNullableProperty.A.prop_1.propT - EnumClassWithNullableProperty.A.prop_1.propAny + EnumClassWithNullableProperty.A.prop_1.propAny EnumClassWithNullableProperty.A.prop_1.propNullableT EnumClassWithNullableProperty.A.prop_1.propNullableAny EnumClassWithNullableProperty.A.prop_1.funT() - EnumClassWithNullableProperty.A.prop_1.funAny() + EnumClassWithNullableProperty.A.prop_1.funAny() EnumClassWithNullableProperty.A.prop_1.funNullableT() EnumClassWithNullableProperty.A.prop_1.funNullableAny() } @@ -422,14 +422,14 @@ fun case_21() { // TESTCASE NUMBER: 22 fun case_22(a: (() -> Unit)?) { if (a != implicitNullableNothingProperty) { - a() - ?")!>a.equals(null) + a() + ?")!>a.equals(null) ?")!>a.propT - ?")!>a.propAny + ?")!>a.propAny ?")!>a.propNullableT ?")!>a.propNullableAny ?")!>a.funT() - ?")!>a.funAny() + ?")!>a.funAny() ?")!>a.funNullableT() ?")!>a.funNullableAny() } @@ -438,16 +438,16 @@ fun case_22(a: (() -> Unit)?) { // TESTCASE NUMBER: 23 fun case_23(a: ((Float) -> Int?)?, b: Float?, z: Nothing?) { if (a != z && b !== z && b !== z) { - val x = a(b) + val x = a(b) if (x != z || x !== implicitNullableNothingProperty) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -457,23 +457,23 @@ fun case_23(a: ((Float) -> Int?)?, b: Float?, z: Nothing?) { // TESTCASE NUMBER: 24 fun case_24(a: ((() -> Unit) -> Unit)?, b: (() -> Unit)?, z: Nothing?) = if (a !== z && b !== z) { - a(?")!>b) - , kotlin.Unit>?")!>a.equals(null) + a(?")!>b) + , kotlin.Unit>?")!>a.equals(null) , kotlin.Unit>?")!>a.propT - , kotlin.Unit>?")!>a.propAny + , kotlin.Unit>?")!>a.propAny , kotlin.Unit>?")!>a.propNullableT , kotlin.Unit>?")!>a.propNullableAny , kotlin.Unit>?")!>a.funT() - , kotlin.Unit>?")!>a.funAny() + , kotlin.Unit>?")!>a.funAny() , kotlin.Unit>?")!>a.funNullableT() , kotlin.Unit>?")!>a.funNullableAny() - ?")!>b.equals(null) + ?")!>b.equals(null) ?")!>b.propT - ?")!>b.propAny + ?")!>b.propAny ?")!>b.propNullableT ?")!>b.propNullableAny ?")!>b.funT() - ?")!>b.funAny() + ?")!>b.funAny() ?")!>b.funNullableT() ?")!>b.funNullableAny() } else z @@ -489,17 +489,17 @@ fun case_25(b: Boolean, z: Nothing?) { val y = if (b) x else z if (y !== z || y != implicitNullableNothingProperty) { - val z1 = ?")!>y() + val z1 = ?")!>y() if (z1 != z && implicitNullableNothingProperty !== z1) { - ?")!>z1.a - ?")!>z1.equals(null) + ?")!>z1.a + ?")!>z1.equals(null) ?")!>z1.propT - ?")!>z1.propAny + ?")!>z1.propAny ?")!>z1.propNullableT ?")!>z1.propNullableAny ?")!>z1.funT() - ?")!>z1.funAny() + ?")!>z1.funAny() ?")!>z1.funNullableT() ?")!>z1.funNullableAny() } @@ -511,16 +511,16 @@ fun case_26(a: ((Float) -> Int?)?, b: Float?) { var z = null if (a != z == true && b != implicitNullableNothingProperty == true) { - val x = a(b) + val x = a(b) if (x != implicitNullableNothingProperty == true || z !== x) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -532,13 +532,13 @@ fun case_27(z: Nothing?) { if (Object.prop_1 == z == true == true == true == true == true == true == true == true == true == true == true == true == true == true) else { Object.prop_1 - Object.prop_1.equals(null) + Object.prop_1.equals(null) Object.prop_1.propT - Object.prop_1.propAny + Object.prop_1.propAny Object.prop_1.propNullableT Object.prop_1.propNullableAny Object.prop_1.funT() - Object.prop_1.funAny() + Object.prop_1.funAny() Object.prop_1.funNullableT() Object.prop_1.funNullableAny() } @@ -547,14 +547,14 @@ fun case_27(z: Nothing?) { // TESTCASE NUMBER: 28 fun case_28(a: DeepObject.A.B.C.D.E.F.G.J?) = if (a != implicitNullableNothingProperty == true == false == false == false == true == false == true == false == false == true == true) { - a.x - a.equals(null) + a.x + a.equals(null) a.propT - a.propAny + a.propAny a.propNullableT a.propNullableAny a.funT() - a.funAny() + a.funAny() a.funNullableT() a.funNullableAny() } else -1 @@ -575,17 +575,17 @@ fun case_29(x: Boolean) { val y = if (x) z else null if (false || false || false || false || y !== v) { - val t = ?")!>y() + val t = ?")!>y() if (z !== t || false) { - ?")!>t.a - ?")!>t.equals(null) + ?")!>t.a + ?")!>t.equals(null) ?")!>t.propT - ?")!>t.propAny + ?")!>t.propAny ?")!>t.propNullableT ?")!>t.propNullableAny ?")!>t.funT() - ?")!>t.funAny() + ?")!>t.funAny() ?")!>t.funNullableT() ?")!>t.funNullableAny() } @@ -595,16 +595,16 @@ fun case_29(x: Boolean) { // TESTCASE NUMBER: 30 fun case_30(a: ((Float) -> Int?)?, b: Float?) { if (implicitNullableNothingProperty != a == true && b != implicitNullableNothingProperty == true || false || false || false || false || false || false || false || false || false) { - val x = a(b) + val x = a(b) if (false || implicitNullableNothingProperty != x == true) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -615,13 +615,13 @@ fun case_30(a: ((Float) -> Int?)?, b: Float?) { fun case_31(z1: Boolean?, z: Nothing?) { if (false || EnumClassWithNullableProperty.A.prop_1 != z && z1 !== z && z1) { EnumClassWithNullableProperty.A.prop_1 - EnumClassWithNullableProperty.A.prop_1.equals(null) + EnumClassWithNullableProperty.A.prop_1.equals(null) EnumClassWithNullableProperty.A.prop_1.propT - EnumClassWithNullableProperty.A.prop_1.propAny + EnumClassWithNullableProperty.A.prop_1.propAny EnumClassWithNullableProperty.A.prop_1.propNullableT EnumClassWithNullableProperty.A.prop_1.propNullableAny EnumClassWithNullableProperty.A.prop_1.funT() - EnumClassWithNullableProperty.A.prop_1.funAny() + EnumClassWithNullableProperty.A.prop_1.funAny() EnumClassWithNullableProperty.A.prop_1.funNullableT() EnumClassWithNullableProperty.A.prop_1.funNullableAny() } @@ -632,14 +632,14 @@ fun case_32(a: DeepObject.A.B.C.D.E.F.G.J?) = if (a == implicitNullableNothingProperty == true == false == false == false == true == false == true == false == false == true == true && true) { -1 } else { - a.x - a.equals(null) + a.x + a.equals(null) a.propT - a.propAny + a.propAny a.propNullableT a.propNullableAny a.funT() - a.funAny() + a.funAny() a.funNullableT() a.funNullableAny() } @@ -651,18 +651,18 @@ fun case_33(a: ((Float) -> Int?)?, b: Float?, c: Boolean?) { if (true && a == z == true || b == null == true) { } else { - val x = a(b) - if (x == z == true && x === z || (c != z && !c)) { + val x = a(b) + if (x == z == true && x === z || (c != z && !c)) { } else { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -681,13 +681,13 @@ fun case_34(z1: Boolean?) { } else { EnumClassWithNullableProperty.A.prop_1 - EnumClassWithNullableProperty.A.prop_1.equals(null) + EnumClassWithNullableProperty.A.prop_1.equals(null) EnumClassWithNullableProperty.A.prop_1.propT - EnumClassWithNullableProperty.A.prop_1.propAny + EnumClassWithNullableProperty.A.prop_1.propAny EnumClassWithNullableProperty.A.prop_1.propNullableT EnumClassWithNullableProperty.A.prop_1.propNullableAny EnumClassWithNullableProperty.A.prop_1.funT() - EnumClassWithNullableProperty.A.prop_1.funAny() + EnumClassWithNullableProperty.A.prop_1.funAny() EnumClassWithNullableProperty.A.prop_1.funNullableT() EnumClassWithNullableProperty.A.prop_1.funNullableAny() } @@ -807,11 +807,11 @@ fun case_44(x: TypealiasNullableString?, z1: Nothing?) { x x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -953,9 +953,9 @@ fun case_54(b: Boolean) { val z = null - if (a != z && a.B54 !== a.z && a.B54.C54 != a.z && a.B54.C54.D54 != a.z && a.B54.C54.D54.x === a.z) { - a.B54.C54.D54.x - a.B54.C54.D54.x.hashCode() + if (a != z && a.B54 !== a.z && a.B54.C54 != a.z && a.B54.C54.D54 != a.z && a.B54.C54.D54.x === a.z) { + a.B54.C54.D54.x + a.B54.C54.D54.x.hashCode() } } @@ -1022,22 +1022,22 @@ fun case_59(a: ((() -> Unit) -> Unit)?, b: (() -> Unit)?, z: Nothing?) { if (false || false || a == z && b === z) { , kotlin.Unit>?")!>a ?")!>b - , kotlin.Unit>?")!>a.equals(null) + , kotlin.Unit>?")!>a.equals(null) , kotlin.Unit>?")!>a.propT - , kotlin.Unit>?")!>a.propAny + , kotlin.Unit>?")!>a.propAny , kotlin.Unit>?")!>a.propNullableT , kotlin.Unit>?")!>a.propNullableAny , kotlin.Unit>?")!>a.funT() - , kotlin.Unit>?")!>a.funAny() + , kotlin.Unit>?")!>a.funAny() , kotlin.Unit>?")!>a.funNullableT() , kotlin.Unit>?")!>a.funNullableAny() - ?")!>b.equals(null) + ?")!>b.equals(null) ?")!>b.propT - ?")!>b.propAny + ?")!>b.propAny ?")!>b.propNullableT ?")!>b.propNullableAny ?")!>b.funT() - ?")!>b.funAny() + ?")!>b.funAny() ?")!>b.funNullableT() ?")!>b.funNullableAny() } @@ -1054,7 +1054,7 @@ fun case_60(b: Boolean) { val y = if (b) x else nullableNothingProperty if (y != nullableNothingProperty) { - val z = ?")!>y() + val z = ?")!>y() if (z == nullableNothingProperty) { ?")!>z @@ -1067,13 +1067,13 @@ fun case_61(x: Any?) { if (x is Number?) { if (x !== implicitNullableNothingProperty) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -1085,13 +1085,13 @@ fun case_62(x: Any?) { var z = null if (x is Number? && x is Int? && x != z) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -1107,13 +1107,13 @@ fun case_63(x: Any?, b: Boolean) { if (x !== when (b) { true -> z1; false -> z2; else -> z3 }) { if (x is Int?) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -1150,13 +1150,13 @@ fun case_65(x: Any?, z: Nothing?) { if (x is ClassLevel5?) { if (x != z) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -1178,13 +1178,13 @@ fun case_66(x: Any?, z1: Nothing?, z2: Nothing?, b: Boolean) { if (x != if (b) { z1 } else { z2 } && x is ClassLevel4?) { if (x is ClassLevel5?) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -1201,13 +1201,13 @@ fun case_67(x: Any?) { if (x is ClassLevel1? && x is ClassLevel2? && x is ClassLevel3?) { if (x is ClassLevel4? && x != (fun (): Nothing? { return z })() && x is ClassLevel5?) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -1219,13 +1219,13 @@ fun case_68(x: Any?, z: Nothing?) { if (x is ClassLevel1? && x is ClassLevel2? && x is ClassLevel3?) { if (x is ClassLevel4? && x != (fun (): Nothing? { return z })() && x is ClassLevel5?) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -1239,13 +1239,13 @@ fun case_68(x: Any?, z: Nothing?) { fun case_69(x: Any?, z: Nothing?) { if (x is ClassLevel1? && x is ClassLevel2? && x is ClassLevel3? && x is ClassLevel4? && x != try { z } catch (e: Exception) { z } && x is ClassLevel5?) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -1258,25 +1258,25 @@ fun case_70(x: Any?) { } else if (x is ClassLevel5? && x != nullableNothingProperty || x != implicitNullableNothingProperty) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } } else if (x is ClassLevel4? && x !== nullableNothingProperty && x is ClassLevel5?) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/61.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/61.fir.kt index 35b2c743446..f973a6f5b29 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/61.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/61.fir.kt @@ -158,7 +158,7 @@ class Case11 { if (y == case_12) throw Exception() y - y.length + y.length } constructor() } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/66.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/66.fir.kt index 22eab5e350a..a47421beaf7 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/66.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/66.fir.kt @@ -22,7 +22,7 @@ fun case_1(x: Any?) { fun case_2(x: Pair<*, *>?) { if (x is Nothing?) return ?")!>x - ?")!>x.equals(10) + ?")!>x.equals(10) } /* @@ -33,7 +33,7 @@ fun case_2(x: Pair<*, *>?) { fun case_3(x: Any?) { if (x is Nothing?) throw Exception() x - x.equals(10) + x.equals(10) } /* @@ -46,11 +46,11 @@ fun case_4(x: Pair<*, *>?) { is Nothing? -> return else -> { ?")!>x - ?")!>x.equals(10) + ?")!>x.equals(10) } } ?")!>x - ?")!>x.equals(10) + ?")!>x.equals(10) } /* @@ -80,9 +80,9 @@ fun case_6(x: Any?) { is Nothing? -> return is Any? -> { x - x.equals(10) + x.equals(10) } } x - x.equals(10) + x.equals(10) } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/68.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/68.fir.kt index 9d2a68bc07b..3aee4686e01 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/68.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/68.fir.kt @@ -14,7 +14,7 @@ fun case_1(x: Any?) { fun case_2(x: Any?) { (x as Nothing?)!! x - x.inv() + x.inv() } // TESTCASE NUMBER: 3 @@ -29,7 +29,7 @@ fun case_3(x: Any?) { fun case_4(x: Any?) { if (x as Class? is Class) { x - x.prop_1 + x.prop_1 } } @@ -37,7 +37,7 @@ fun case_4(x: Any?) { fun case_5(x: Any?) { if (x as Nothing? is Nothing) { x - x.inv() + x.inv() } } @@ -45,14 +45,14 @@ fun case_5(x: Any?) { fun case_6(x: Any?) { (x as String?)!! x - x.length + x.length } // TESTCASE NUMBER: 7 fun case_7(x: Any?) { if (x as String? != null) { x - x.length + x.length } } @@ -60,6 +60,6 @@ fun case_7(x: Any?) { fun case_8(x: Any?) { if (x as String? == null) { x - x.length + x.length } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/69.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/69.fir.kt index 1996f458525..b4ad1ffb4be 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/69.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/69.fir.kt @@ -14,14 +14,14 @@ fun test1(x: ClassLevel1?) { fun case_2(x: Any?) { (x as ClassLevel1?)!! x - x.test1() + x.test1() } // TESTCASE NUMBER: 3 fun case_3(x: Any?) { if (x as ClassLevel1? is ClassLevel1) { x - x.test1() + x.test1() } } @@ -29,7 +29,7 @@ fun case_3(x: Any?) { fun case_4(x: Any?) { if ((x as Class).prop_8 != null) { x - x.prop_8.prop_8 + x.prop_8.prop_8 } } @@ -37,6 +37,6 @@ fun case_4(x: Any?) { fun case_5(x: Class) { if (x!!.prop_8 != null) { x - x.prop_8.prop_8 + x.prop_8.prop_8 } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/7.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/7.fir.kt index f0c2ef2fb9f..516e0537601 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/7.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/7.fir.kt @@ -100,13 +100,13 @@ fun case_6(x: Class?) { if (((false || x != null || false) && !y) || x != null) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -311,13 +311,13 @@ val case_17 = if (nullableIntPropert fun case_18(a: DeepObject.A.B.C.D.E.F.G.J?, b: Nothing?) { if (a != null || b !== a || false) { a - a.equals(null) + a.equals(null) a.propT - a.propAny + a.propAny a.propNullableT a.propNullableAny a.funT() - a.funAny() + a.funAny() a.funNullableT() a.funNullableAny() } @@ -344,17 +344,17 @@ fun case_19(b: Boolean) { } } else null - if (a != null && a.B19 != a.y && a.B19.C19 != a.y && a.B19.C19.D19 != a.y && a.B19.C19.D19.x != a.y) { - a.B19.C19.D19.x - a.B19.C19.D19.x.equals(null) - a.B19.C19.D19.x.propT - a.B19.C19.D19.x.propAny - a.B19.C19.D19.x.propNullableT - a.B19.C19.D19.x.propNullableAny - a.B19.C19.D19.x.funT() - a.B19.C19.D19.x.funAny() - a.B19.C19.D19.x.funNullableT() - a.B19.C19.D19.x.funNullableAny() + if (a != null && a.B19 != a.y && a.B19.C19 != a.y && a.B19.C19.D19 != a.y && a.B19.C19.D19.x != a.y) { + a.B19.C19.D19.x + a.B19.C19.D19.x.equals(null) + a.B19.C19.D19.x.propT + a.B19.C19.D19.x.propAny + a.B19.C19.D19.x.propNullableT + a.B19.C19.D19.x.propNullableAny + a.B19.C19.D19.x.funT() + a.B19.C19.D19.x.funAny() + a.B19.C19.D19.x.funNullableT() + a.B19.C19.D19.x.funNullableAny() } } @@ -373,13 +373,13 @@ fun case_20(b: Boolean) { if (a.B19.C19.D19 !== null || a.y != a.B19.C19.D19) { a.B19.C19.D19 - a.B19.C19.D19.equals(null) + a.B19.C19.D19.equals(null) a.B19.C19.D19.propT - a.B19.C19.D19.propAny + a.B19.C19.D19.propAny a.B19.C19.D19.propNullableT a.B19.C19.D19.propNullableAny a.B19.C19.D19.funT() - a.B19.C19.D19.funAny() + a.B19.C19.D19.funAny() a.B19.C19.D19.funNullableT() a.B19.C19.D19.funNullableAny() } @@ -406,14 +406,14 @@ fun case_21() { fun case_22(a: (() -> Unit)?) { var y = null if (a != null || y != a) { - a() - ?")!>a.equals(null) + a() + ?")!>a.equals(null) ?")!>a.propT - ?")!>a.propAny + ?")!>a.propAny ?")!>a.propNullableT ?")!>a.propNullableAny ?")!>a.funT() - ?")!>a.funAny() + ?")!>a.funAny() ?")!>a.funNullableT() ?")!>a.funNullableAny() } @@ -422,16 +422,16 @@ fun case_22(a: (() -> Unit)?) { // TESTCASE NUMBER: 23 fun case_23(a: ((Float) -> Int?)?, b: Float?, c: Nothing?) { if (a != null && b !== null || a != c && b !== c) { - val x = a(b) + val x = a(b) if (x != null || c !== x) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -441,23 +441,23 @@ fun case_23(a: ((Float) -> Int?)?, b: Float?, c: Nothing?) { // TESTCASE NUMBER: 24 fun case_24(a: ((() -> Unit) -> Unit)?, b: (() -> Unit)?) = if (a !== null && b !== null || implicitNullableNothingProperty != a && nullableNothingProperty !== b) { - a(?")!>b) - , kotlin.Unit>?")!>a.equals(null) + a(?")!>b) + , kotlin.Unit>?")!>a.equals(null) , kotlin.Unit>?")!>a.propT - , kotlin.Unit>?")!>a.propAny + , kotlin.Unit>?")!>a.propAny , kotlin.Unit>?")!>a.propNullableT , kotlin.Unit>?")!>a.propNullableAny , kotlin.Unit>?")!>a.funT() - , kotlin.Unit>?")!>a.funAny() + , kotlin.Unit>?")!>a.funAny() , kotlin.Unit>?")!>a.funNullableT() , kotlin.Unit>?")!>a.funNullableAny() - ?")!>b.equals(null) + ?")!>b.equals(null) ?")!>b.propT - ?")!>b.propAny + ?")!>b.propAny ?")!>b.propNullableT ?")!>b.propNullableAny ?")!>b.funT() - ?")!>b.funAny() + ?")!>b.funAny() ?")!>b.funNullableT() ?")!>b.funNullableAny() } else null @@ -475,7 +475,7 @@ fun case_25(b: Boolean) { if (y !== null || x()!!.b != y) { if (x()!!.b != y) { - val z = ?")!>y() + val z = ?")!>y() if (z != null) { & ?")!>z.a @@ -498,7 +498,7 @@ fun case_26(a: ((Float) -> Int?)?, b: Float?) { var c: Nothing? = null if (a != null == true && b != null == true || c != a == true && b != c == true) { - val x = a(b) + val x = a(b) if (x != null == true) { x x.equals(null) From 0ee4f1f3934a415570dd410897e8491b231cdade Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Thu, 28 Jan 2021 21:29:09 +0300 Subject: [PATCH 184/212] FIR: more exact nullability determination in potential UNSAFE_CALL check --- .../ErrorNodeDiagnosticCollectorComponent.kt | 21 +++++++++++++++---- .../basicCollectionLiterals.fir.kt | 8 +++---- .../namedFunAsLastExpressionInBlock.fir.kt | 2 +- .../complexInference.fir.kt | 12 +++++------ .../redeclaration.fir.kt | 2 +- .../destructuringInLambdas/simple.fir.kt | 4 ++-- .../unusedParameters.fir.kt | 4 ++-- .../implicitArguments/fromSuperClasses.fir.kt | 4 ++-- .../fromSuperClassesLocal.fir.kt | 4 ++-- .../fromSuperClassesLocalInsideInner.fir.kt | 4 ++-- .../fromSuperClassesTransitive.fir.kt | 2 +- .../properties/fieldPropertyOverloads.fir.kt | 8 +++---- .../fieldPropertyOverloadsDisabled.fir.kt | 8 +++---- .../fieldPropertyOverloadsNI.fir.kt | 8 +++---- .../tests/j+k/selectMoreSpecific.fir.kt | 4 ++-- .../primaryConstructorParameter.fir.kt | 2 +- .../samConversions/OverloadPriority.fir.kt | 4 ++-- .../samConversions/OverloadPriorityKT.fir.kt | 4 ++-- .../unstableSmartCast.fir.kt | 2 +- .../notConsideredMethod.fir.kt | 2 +- .../inferenceForSignedAndUnsignedTypes.fir.kt | 2 +- ...ResolutionForSignedAndUnsignedTypes.fir.kt | 2 +- .../resolve/samAgainstFunctionalType.fir.kt | 4 ++-- .../resolve/samOverloadsWithGenerics.fir.kt | 4 ++-- ...loadsWithGenericsWithoutRefinedSams.fir.kt | 4 ++-- .../resolve/samOverloadsWithKtFunction.fir.kt | 2 +- ...adsWithKtFunctionWithoutRefinedSams.fir.kt | 2 +- .../p-1/neg/2.3.fir.kt | 8 +++---- .../p-1/neg/2.4.fir.kt | 12 +++++------ .../diagnostics/notLinked/dfa/pos/52.fir.kt | 2 +- 30 files changed, 82 insertions(+), 69 deletions(-) diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/collectors/components/ErrorNodeDiagnosticCollectorComponent.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/collectors/components/ErrorNodeDiagnosticCollectorComponent.kt index 939a841d41f..80771809fda 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/collectors/components/ErrorNodeDiagnosticCollectorComponent.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/collectors/components/ErrorNodeDiagnosticCollectorComponent.kt @@ -100,6 +100,16 @@ class ErrorNodeDiagnosticCollectorComponent(collector: AbstractDiagnosticCollect reporter.report(coneDiagnostic) } + private fun ConeKotlinType.isEffectivelyNotNull(): Boolean { + return when (this) { + is ConeClassLikeType -> !isMarkedNullable + is ConeTypeParameterType -> !isMarkedNullable && lookupTag.typeParameterSymbol.fir.bounds.any { + it.coneTypeSafe()?.isEffectivelyNotNull() == true + } + else -> false + } + } + private fun mapInapplicableCandidateError( diagnostic: ConeInapplicableCandidateError, source: FirSourceElement, @@ -107,16 +117,19 @@ class ErrorNodeDiagnosticCollectorComponent(collector: AbstractDiagnosticCollect // TODO: Need to distinguish SMARTCAST_IMPOSSIBLE // TODO: handle other UNSAFE_* variants: invoke, infix, operator val rootCause = diagnostic.diagnostics.find { it.applicability == diagnostic.applicability } - return if (rootCause != null && + if (rootCause != null && rootCause is InapplicableWrongReceiver && rootCause.actualType?.isNullable == true && (rootCause.expectedType == null || !rootCause.expectedType!!.isMarkedNullable) ) { // TODO: report on call operation node, e.g., x.length instead of x.length - FirErrors.UNSAFE_CALL.on(source, rootCause.actualType!!) - } else { - FirErrors.INAPPLICABLE_CANDIDATE.on(source, diagnostic.candidateSymbol) + val expectedType = rootCause.expectedType + + if (expectedType == null || expectedType.isEffectivelyNotNull()) { + return FirErrors.UNSAFE_CALL.on(source, rootCause.actualType!!) + } } + return FirErrors.INAPPLICABLE_CANDIDATE.on(source, diagnostic.candidateSymbol) } private fun ConeSimpleDiagnostic.getFactory(): FirDiagnosticFactory0 { diff --git a/compiler/testData/diagnostics/tests/collectionLiterals/basicCollectionLiterals.fir.kt b/compiler/testData/diagnostics/tests/collectionLiterals/basicCollectionLiterals.fir.kt index 5f99076728e..b6236178bb0 100644 --- a/compiler/testData/diagnostics/tests/collectionLiterals/basicCollectionLiterals.fir.kt +++ b/compiler/testData/diagnostics/tests/collectionLiterals/basicCollectionLiterals.fir.kt @@ -14,11 +14,11 @@ fun test() { } fun check() { - [1, 2] checkType { _>() } - [""] checkType { _>() } + [1, 2] checkType { _>() } + [""] checkType { _>() } val f: IntArray = [1] - [f] checkType { _>() } + [f] checkType { _>() } - [1, ""] checkType { _>() } + [1, ""] checkType { _>() } } diff --git a/compiler/testData/diagnostics/tests/declarationChecks/namedFunAsLastExpressionInBlock.fir.kt b/compiler/testData/diagnostics/tests/declarationChecks/namedFunAsLastExpressionInBlock.fir.kt index 8287a52b1ea..991fc0fe076 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/namedFunAsLastExpressionInBlock.fir.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/namedFunAsLastExpressionInBlock.fir.kt @@ -5,7 +5,7 @@ fun foo(block: () -> (() -> Int)) {} fun test() { val x = fun named1(x: Int): Int { return 1 } - x checkType { _>() } + x checkType { _>() } foo { fun named2(): Int {return 1} } foo({ fun named3() = 1 }) diff --git a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/complexInference.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/complexInference.fir.kt index 31c70005549..e9d09e341af 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/complexInference.fir.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/complexInference.fir.kt @@ -24,24 +24,24 @@ fun bar(aInstance: A, bInstance: B) { foo(bInstance) { (a, b): A, (c, d) -> - a checkType { _() } - b checkType { _() } + a checkType { _() } + b checkType { _() } c checkType { _() } d checkType { _() } } foo(bInstance) { (a, b), (c, d) -> - a checkType { _() } - b checkType { _() } + a checkType { _() } + b checkType { _() } c checkType { _() } d checkType { _() } } foo(bInstance) { (a, b), (c, d) -> - a checkType { _() } - b checkType { _() } + a checkType { _() } + b checkType { _() } c checkType { _() } d checkType { _() } } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/redeclaration.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/redeclaration.fir.kt index 0fb7b9f92bc..9b4ea9d4756 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/redeclaration.fir.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/redeclaration.fir.kt @@ -23,7 +23,7 @@ fun bar() { } foo { (a, b), (c, b) -> - a checkType { _() } + a checkType { _() } b checkType { _() } c checkType { _() } } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/simple.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/simple.fir.kt index b2af00d8479..1115485d97c 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/simple.fir.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/simple.fir.kt @@ -36,8 +36,8 @@ fun bar() { } foobar { (a, b), (c, d) -> - a checkType { _() } - b checkType { _() } + a checkType { _() } + b checkType { _() } c checkType { _() } d checkType { _() } } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/unusedParameters.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/unusedParameters.fir.kt index 04fadf414b7..db23c7d5f31 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/unusedParameters.fir.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/unusedParameters.fir.kt @@ -32,12 +32,12 @@ fun bar() { } foobar { (a, b), (c, d) -> - a checkType { _() } + a checkType { _() } d checkType { _() } } foobar { (a, b), (c, d) -> - b checkType { _() } + b checkType { _() } c checkType { _() } } } diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClasses.fir.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClasses.fir.kt index 7074f6d1802..15dfefa3581 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClasses.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClasses.fir.kt @@ -20,7 +20,7 @@ class A : Outer() { fun foo() { Derived().foo() checkType { _.Inner>() } - Derived().baz() checkType { _>() } + Derived().baz() checkType { _>() } A.B().bar() checkType { _.Inner>() } - A.B().x() checkType { _>() } + A.B().x() checkType { _>() } } diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocal.fir.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocal.fir.kt index 06867cf008e..603d640167d 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocal.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocal.fir.kt @@ -43,7 +43,7 @@ fun test() { x = foobar() x().foo().a() checkType { _>() } - x().bar() checkType { _>() } + x().bar() checkType { _>() } x = foobar() @@ -51,5 +51,5 @@ fun test() { y = noParameters() y().foo().a() checkType { _>() } - y().bar() checkType { _>() } + y().bar() checkType { _>() } } diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocalInsideInner.fir.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocalInsideInner.fir.kt index 2cef2166c0a..9f0071189a5 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocalInsideInner.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocalInsideInner.fir.kt @@ -44,7 +44,7 @@ class Outer { x = foobar() x().foo().a() checkType { _>() } - x().bar() checkType { _>() } + x().bar() checkType { _>() } x = foobar() x = z.foobar() @@ -53,7 +53,7 @@ class Outer { y = noParameters() y().foo().a() checkType { _>() } - y().bar() checkType { _>() } + y().bar() checkType { _>() } } } } diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesTransitive.fir.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesTransitive.fir.kt index bfbf34ff775..ccefd06ca5b 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesTransitive.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesTransitive.fir.kt @@ -15,5 +15,5 @@ class Derived : BaseDerived2() { fun foo() { Derived().foo() checkType { _.Inner>() } - Derived().baz() checkType { _>() } + Derived().baz() checkType { _>() } } diff --git a/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloads.fir.kt b/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloads.fir.kt index ac9da0f0ba2..80760d8daf3 100644 --- a/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloads.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloads.fir.kt @@ -19,9 +19,9 @@ public abstract class CollectionWithSize implements java.util.Collection // FILE: main.kt fun main(c: CollectionWithSize) { - CompressionType.ZIP.name checkType { _() } - c.size checkType { _() } + CompressionType.ZIP.name checkType { _() } + c.size checkType { _() } - CompressionType.ZIP::name checkType { _>() } - c::size checkType { _>() } + CompressionType.ZIP::name checkType { _>() } + c::size checkType { _>() } } diff --git a/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloadsDisabled.fir.kt b/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloadsDisabled.fir.kt index 8121e3c48d0..aa113f16ee1 100644 --- a/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloadsDisabled.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloadsDisabled.fir.kt @@ -20,9 +20,9 @@ public abstract class CollectionWithSize implements java.util.Collection // FILE: main.kt fun main(c: CollectionWithSize) { - CompressionType.ZIP.name checkType { _() } - c.size checkType { _() } + CompressionType.ZIP.name checkType { _() } + c.size checkType { _() } - CompressionType.ZIP::name checkType { _>() } - c::size checkType { _>() } + CompressionType.ZIP::name checkType { _>() } + c::size checkType { _>() } } diff --git a/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloadsNI.fir.kt b/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloadsNI.fir.kt index 4ed8ecfdbde..df77b661fc5 100644 --- a/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloadsNI.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloadsNI.fir.kt @@ -19,9 +19,9 @@ public abstract class CollectionWithSize implements java.util.Collection // FILE: main.kt fun main(c: CollectionWithSize) { - CompressionType.ZIP.name checkType { _() } - c.size checkType { _() } + CompressionType.ZIP.name checkType { _() } + c.size checkType { _() } - CompressionType.ZIP::name checkType { _>() } - c::size checkType { _>() } + CompressionType.ZIP::name checkType { _>() } + c::size checkType { _>() } } diff --git a/compiler/testData/diagnostics/tests/j+k/selectMoreSpecific.fir.kt b/compiler/testData/diagnostics/tests/j+k/selectMoreSpecific.fir.kt index 4db841309f3..c64eab51fd2 100644 --- a/compiler/testData/diagnostics/tests/j+k/selectMoreSpecific.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/selectMoreSpecific.fir.kt @@ -11,6 +11,6 @@ public class A { // FILE: main.kt fun foo(a: A) { - a.foo() checkType { _() } - A.bar() checkType { _() } + a.foo() checkType { _() } + A.bar() checkType { _() } } diff --git a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/primaryConstructorParameter.fir.kt b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/primaryConstructorParameter.fir.kt index 834814d7fdb..45c62b274d7 100644 --- a/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/primaryConstructorParameter.fir.kt +++ b/compiler/testData/diagnostics/tests/properties/inferenceFromGetters/primaryConstructorParameter.fir.kt @@ -19,5 +19,5 @@ class C(p: Any, val v: Any) { var test5 get() { return p } - set(nv) { p.let {} } + set(nv) { p.let {} } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/samConversions/OverloadPriority.fir.kt b/compiler/testData/diagnostics/tests/samConversions/OverloadPriority.fir.kt index f818a216e91..8e4fd966f51 100644 --- a/compiler/testData/diagnostics/tests/samConversions/OverloadPriority.fir.kt +++ b/compiler/testData/diagnostics/tests/samConversions/OverloadPriority.fir.kt @@ -22,9 +22,9 @@ public interface J { // FILE: 1.kt fun test(j: J) { - j.foo({ it checkType { _() }; "" }, "") checkType { _() } + j.foo({ it checkType { _() }; "" }, "") checkType { _() } - j.bas({ it checkType { _() }; "" }, "") checkType { _() } + j.bas({ it checkType { _() }; "" }, "") checkType { _() } // NI: TODO j.bar { it checkType { _() }; "" } checkType { _() } diff --git a/compiler/testData/diagnostics/tests/samConversions/OverloadPriorityKT.fir.kt b/compiler/testData/diagnostics/tests/samConversions/OverloadPriorityKT.fir.kt index 98167dcdf5f..b2d9a1b570a 100644 --- a/compiler/testData/diagnostics/tests/samConversions/OverloadPriorityKT.fir.kt +++ b/compiler/testData/diagnostics/tests/samConversions/OverloadPriorityKT.fir.kt @@ -21,9 +21,9 @@ interface K { } fun test(k: K) { - k.foo { it checkType { _() }; "" } checkType { _() } + k.foo { it checkType { _() }; "" } checkType { _() } - k.bas { it checkType { _() }; "" } checkType { _() } + k.bas { it checkType { _() }; "" } checkType { _() } // NI: TODO k.bar { it checkType { _() }; "" } checkType { _() } diff --git a/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/unstableSmartCast.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/unstableSmartCast.fir.kt index 8bb6ab6a4d0..ae481e57005 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/unstableSmartCast.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/unstableSmartCast.fir.kt @@ -33,6 +33,6 @@ fun test() { x.baz(1).checkType { _() } x.baz(1, 2) - x.foobar().checkType { _() } + x.foobar().checkType { _() } } } diff --git a/compiler/testData/diagnostics/tests/testWithModifiedMockJdk/notConsideredMethod.fir.kt b/compiler/testData/diagnostics/tests/testWithModifiedMockJdk/notConsideredMethod.fir.kt index 2e099e73d93..bba63299a6f 100644 --- a/compiler/testData/diagnostics/tests/testWithModifiedMockJdk/notConsideredMethod.fir.kt +++ b/compiler/testData/diagnostics/tests/testWithModifiedMockJdk/notConsideredMethod.fir.kt @@ -7,7 +7,7 @@ interface A : MutableCollection { } fun foo(x: MutableCollection, y: Collection, z: A) { - x.nonExistingMethod(1).checkType { _() } + x.nonExistingMethod(1).checkType { _() } y.nonExistingMethod("") z.nonExistingMethod("") } diff --git a/compiler/testData/diagnostics/tests/unsignedTypes/conversions/inferenceForSignedAndUnsignedTypes.fir.kt b/compiler/testData/diagnostics/tests/unsignedTypes/conversions/inferenceForSignedAndUnsignedTypes.fir.kt index 0a5a18e0526..7b1e8c134a6 100644 --- a/compiler/testData/diagnostics/tests/unsignedTypes/conversions/inferenceForSignedAndUnsignedTypes.fir.kt +++ b/compiler/testData/diagnostics/tests/unsignedTypes/conversions/inferenceForSignedAndUnsignedTypes.fir.kt @@ -14,7 +14,7 @@ fun foo() { takeUByte(id(1)) 1 + 1u - (1u + 1) checkType { _() } + (1u + 1) checkType { _() } id(1) } diff --git a/compiler/testData/diagnostics/tests/unsignedTypes/conversions/overloadResolutionForSignedAndUnsignedTypes.fir.kt b/compiler/testData/diagnostics/tests/unsignedTypes/conversions/overloadResolutionForSignedAndUnsignedTypes.fir.kt index 135d3bc7ec1..4b5009d5183 100644 --- a/compiler/testData/diagnostics/tests/unsignedTypes/conversions/overloadResolutionForSignedAndUnsignedTypes.fir.kt +++ b/compiler/testData/diagnostics/tests/unsignedTypes/conversions/overloadResolutionForSignedAndUnsignedTypes.fir.kt @@ -21,7 +21,7 @@ fun test() { foo(1) checkType { _() } foo(1u) checkType { _() } - foo(2147483648) checkType { _() } + foo(2147483648) checkType { _() } foo(2147483647 + 1) checkType { _() } fooByte(1) checkType { _() } diff --git a/compiler/testData/diagnostics/testsWithStdLib/resolve/samAgainstFunctionalType.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/resolve/samAgainstFunctionalType.fir.kt index b7aee9d5815..428d894df0c 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/resolve/samAgainstFunctionalType.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/resolve/samAgainstFunctionalType.fir.kt @@ -24,7 +24,7 @@ public class StaticOverrides { // FILE: test.kt fun test() { - StaticOverrides.A.foo {} checkType { _() } + StaticOverrides.A.foo {} checkType { _() } StaticOverrides.B.foo {} checkType { _() } - StaticOverrides.C.foo {} checkType { _() } + StaticOverrides.C.foo {} checkType { _() } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithGenerics.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithGenerics.fir.kt index c1213130ee4..05a5ed0f4c9 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithGenerics.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithGenerics.fir.kt @@ -20,6 +20,6 @@ class Foo { // FILE: 1.kt fun test() { - Foo().foo {} checkType { _() } - Foo().bar {} checkType { _() } + Foo().foo {} checkType { _() } + Foo().bar {} checkType { _() } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithGenericsWithoutRefinedSams.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithGenericsWithoutRefinedSams.fir.kt index 212fdae2be1..2d46f94bee1 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithGenericsWithoutRefinedSams.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithGenericsWithoutRefinedSams.fir.kt @@ -21,6 +21,6 @@ class Foo { // FILE: 1.kt fun test() { - Foo().foo {} checkType { _() } - Foo().bar {} checkType { _() } + Foo().foo {} checkType { _() } + Foo().bar {} checkType { _() } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithKtFunction.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithKtFunction.fir.kt index ea440852beb..377b771ff37 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithKtFunction.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithKtFunction.fir.kt @@ -16,5 +16,5 @@ public class Foo { // FILE: 1.kt fun bar() { - Foo().test {} checkType { _() } + Foo().test {} checkType { _() } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithKtFunctionWithoutRefinedSams.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithKtFunctionWithoutRefinedSams.fir.kt index aa41c361a98..9d5f49b6125 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithKtFunctionWithoutRefinedSams.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithKtFunctionWithoutRefinedSams.fir.kt @@ -18,5 +18,5 @@ public class Foo { // FILE: 1.kt fun bar() { - Foo().test {} checkType { _() } + Foo().test {} checkType { _() } } diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/neg/2.3.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/neg/2.3.fir.kt index a3625e548ac..0a202b59a59 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/neg/2.3.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/neg/2.3.fir.kt @@ -105,8 +105,8 @@ fun case_6() { checkSubtype(-100000000000000000000000000000000) checkSubtype(-100000000000000000000000000000000) checkSubtype(-100000000000000000000000000000000) - -100000000000000000000000000000000 checkType { check() } - -100000000000000000000000000000000 checkType { check() } - -100000000000000000000000000000000 checkType { check() } - -100000000000000000000000000000000 checkType { check() } + -100000000000000000000000000000000 checkType { check() } + -100000000000000000000000000000000 checkType { check() } + -100000000000000000000000000000000 checkType { check() } + -100000000000000000000000000000000 checkType { check() } } diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/neg/2.4.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/neg/2.4.fir.kt index b3aa065eae3..393c857b1c3 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/neg/2.4.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/neg/2.4.fir.kt @@ -3,23 +3,23 @@ // TESTCASE NUMBER: 1 fun case_1() { checkSubtype(-9223372036854775808L) - -9223372036854775808L checkType { check() } + -9223372036854775808L checkType { check() } checkSubtype(9223372036854775808L) - 9223372036854775808L checkType { check() } + 9223372036854775808L checkType { check() } } // TESTCASE NUMBER: 2 fun case_2() { checkSubtype(100000000000000000000000000000000L) - 100000000000000000000000000000000L checkType { check() } + 100000000000000000000000000000000L checkType { check() } checkSubtype(100000000000000000000000000000000l) - 100000000000000000000000000000000l checkType { check() } + 100000000000000000000000000000000l checkType { check() } checkSubtype(-100000000000000000000000000000000L) - -100000000000000000000000000000000L checkType { check() } + -100000000000000000000000000000000L checkType { check() } checkSubtype(-100000000000000000000000000000000l) - -100000000000000000000000000000000l checkType { check() } + -100000000000000000000000000000000l checkType { check() } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/52.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/52.fir.kt index f8f56b1e824..9415700500e 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/52.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/52.fir.kt @@ -89,7 +89,7 @@ fun T.case_9() = this fun case_9() { var x: Int? = 10 x = null - x.case_9() + x.case_9() } /* From 7d4eaefd368545c9770e293b975f2a6aab88caf1 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Fri, 29 Jan 2021 10:25:59 +0300 Subject: [PATCH 185/212] FIR: report UNSAFE_CALL on dot when possible --- .../testData/resolve/cfg/jumps.kt | 2 +- .../expresssions/syntheticSmartCast.kt | 2 +- .../testData/resolve/smartcasts/bangbang.kt | 6 +- .../smartcasts/booleans/equalsToBoolean.kt | 16 +- .../booleans/jumpFromRhsOfOperator.kt | 12 +- .../boundSmartcastsInBranches.kt | 8 +- .../resolve/smartcasts/equalsAndIdentity.kt | 8 +- .../resolve/smartcasts/nullability.kt | 56 ++-- .../resolve/smartcasts/orInWhenBranch.kt | 2 +- .../safeCalls/safeCallAndEqualityToBool.kt | 8 +- .../resolve/smartcasts/safeCalls/safeCalls.kt | 6 +- .../smartcasts/variables/delayedAssignment.kt | 2 +- .../variables/smartcastAfterReassignment.kt | 2 +- .../contracts/fromLibrary/notIsNullOrEmpty.kt | 2 +- .../fromSource/good/returnsImplies/eqNotEq.kt | 2 +- .../good/returnsImplies/receivers.kt | 2 +- .../ErrorNodeDiagnosticCollectorComponent.kt | 1 - .../fir/analysis/diagnostics/FirErrors.kt | 2 +- .../LightTreePositioningStrategies.kt | 23 ++ .../SourceElementPositioningStrategies.kt | 5 + .../diagnostics/PositioningStrategies.kt | 15 + .../diagnostics/tests/BreakContinue.fir.kt | 6 +- .../diagnostics/tests/Nullability.fir.kt | 2 +- ...LoopWithExtensionIteratorOnNullable.fir.kt | 2 +- .../uninitializedValNullability.fir.kt | 2 +- .../extensions/ExtensionFunctions.fir.kt | 2 +- .../tests/extensions/kt1875.fir.kt | 4 +- .../throwOutCandidatesByReceiver.fir.kt | 6 +- .../lambdaWithVariableAndNothing.fir.kt | 8 +- .../tests/inference/regressions/kt2842.fir.kt | 6 +- .../j+k/sam/enhancedSamConstructor.fir.kt | 4 +- .../InfixCallNullability.fir.kt | 10 +- .../QualifiedExpressionNullability.fir.kt | 6 +- .../ReceiverNullability.fir.kt | 8 +- .../nullabilityAndSmartCasts/kt1270.fir.kt | 13 - .../tests/nullabilityAndSmartCasts/kt1270.kt | 1 + .../nullabilityAndSmartCasts/kt2125.fir.kt | 2 +- .../noAnnotationInClassPath.fir.kt | 17 -- .../platformTypes/noAnnotationInClassPath.kt | 1 + .../derefenceExtension.fir.kt | 45 --- .../nullabilityWarnings/derefenceExtension.kt | 1 + .../derefenceMember.fir.kt | 40 --- .../nullabilityWarnings/derefenceMember.kt | 1 + .../nullabilityWarnings/invoke.fir.kt | 2 +- .../nullabilityWarnings/kt6829.fir.kt | 24 -- .../nullabilityWarnings/kt6829.kt | 1 + .../overriddenExtensions.fir.kt | 4 +- .../tests/regressions/kt12898.fir.kt | 2 +- .../tests/regressions/kt557.fir.kt | 2 +- .../invoke/implicitInvokeAfterSafeCall.fir.kt | 12 +- .../resolve/invoke/invokeAndSmartCast.fir.kt | 2 +- .../tests/resolve/invoke/kt30695_2.fir.kt | 4 +- .../diagnostics/tests/safeCall.fir.kt | 2 +- .../tests/smartCasts/alwaysNull.fir.kt | 2 +- .../smartCasts/castchecks/basicOff.fir.kt | 6 +- .../smartCasts/castchecks/basicOn.fir.kt | 6 +- .../smartCasts/castchecks/variables.fir.kt | 18 +- .../smartCasts/comparisonUnderAnd.fir.kt | 24 +- .../tests/smartCasts/complexComparison.fir.kt | 12 +- .../complexConditionsWithExcl.fir.kt | 20 +- .../tests/smartCasts/elvis/basicOff.fir.kt | 50 ---- .../tests/smartCasts/elvis/basicOff.kt | 1 + .../tests/smartCasts/elvis/basicOn.fir.kt | 8 +- .../tests/smartCasts/elvisExclExcl.fir.kt | 9 - .../tests/smartCasts/elvisExclExcl.kt | 1 + .../tests/smartCasts/elvisNothingRHS.fir.kt | 2 +- .../smartCasts/enumEntryMembers_after.fir.kt | 2 +- .../smartCasts/enumEntryMembers_before.fir.kt | 2 +- .../tests/smartCasts/exclUnderAnd.fir.kt | 8 +- .../tests/smartCasts/extensionSafeCall.fir.kt | 2 +- .../tests/smartCasts/fieldExclExcl.fir.kt | 12 - .../tests/smartCasts/fieldExclExcl.kt | 1 + .../tests/smartCasts/fieldPlus.fir.kt | 2 +- .../tests/smartCasts/inference/kt39010.fir.kt | 2 +- .../tests/smartCasts/kt32358_2.fir.kt | 2 +- .../tests/smartCasts/kt32358_3.fir.kt | 2 +- .../tests/smartCasts/level_1_0.fir.kt | 2 +- .../WhileTrueWithBreakInIfCondition.fir.kt | 2 +- .../assignElvisIfBreakInsideWhileTrue.fir.kt | 4 +- .../loops/assignWhenInsideWhileTrue.fir.kt | 2 +- .../callBreakBetweenInsideDoWhile.fir.kt | 4 +- .../loops/callBreakFirstInsideDoWhile.fir.kt | 4 +- .../loops/callBreakInsideDoWhile.fir.kt | 2 +- .../loops/callBreakSecondInsideDoWhile.fir.kt | 2 +- .../loops/callBreakThirdInsideDoWhile.fir.kt | 2 +- .../smartCasts/loops/doWhileEarlyBreak.fir.kt | 13 - .../smartCasts/loops/doWhileEarlyBreak.kt | 1 + .../loops/doWhileInConditionWithBreak.fir.kt | 9 - .../loops/doWhileInConditionWithBreak.kt | 1 + .../loops/doWhileNotNullBreak.fir.kt | 10 - .../smartCasts/loops/doWhileNotNullBreak.kt | 1 + .../loops/doWhileNullWithBreak.fir.kt | 9 - .../smartCasts/loops/doWhileNullWithBreak.kt | 1 + .../loops/elvisBreakInsideDoWhile.fir.kt | 2 +- .../loops/elvisIfBreakInsideWhileTrue.fir.kt | 9 - .../loops/elvisIfBreakInsideWhileTrue.kt | 1 + .../elvisLeftBreakInsideWhileTrue.fir.kt | 9 - .../loops/elvisLeftBreakInsideWhileTrue.kt | 1 + .../loops/ifBreakAssignInsideDoWhile.fir.kt | 2 +- .../loops/ifBreakAssignInsideWhileTrue.fir.kt | 2 +- .../loops/ifBreakExprInsideWhileTrue.fir.kt | 2 +- .../leftElvisBreakInsideWhileTrue.fir.kt | 2 +- .../loops/nestedLoopsWithLongBreak.fir.kt | 2 +- .../loops/plusAssignWhenInsideDoWhile.fir.kt | 2 +- .../loops/whenInsideWhileTrue.fir.kt | 2 +- .../loops/whileNullWithBreak.fir.kt | 9 - .../smartCasts/loops/whileNullWithBreak.kt | 1 + .../tests/smartCasts/loops/whileSimple.fir.kt | 10 - .../tests/smartCasts/loops/whileSimple.kt | 1 + .../smartCasts/loops/whileTrivial.fir.kt | 11 - .../tests/smartCasts/loops/whileTrivial.kt | 1 + .../loops/whileTrueBreakReturn.fir.kt | 2 +- .../loops/whileTrueEarlyBreak.fir.kt | 11 - .../smartCasts/loops/whileTrueEarlyBreak.kt | 1 + ...eWithAssertInConditionAndBreakAfter.fir.kt | 4 +- ...WithAssertInConditionAndBreakBefore.fir.kt | 4 +- .../smartCasts/objectLiterals/kt7110.fir.kt | 2 +- .../tests/smartCasts/openInSealed.fir.kt | 2 +- .../ownerDeclaresBothModifies.fir.kt | 2 +- .../smartCasts/publicVals/customGetter.fir.kt | 2 +- .../tests/smartCasts/publicVals/var.fir.kt | 4 +- .../smartCasts/safecalls/argument.fir.kt | 2 +- .../safecalls/chainMixedUnsafe.fir.kt | 2 +- .../smartCasts/safecalls/doubleCall.fir.kt | 2 +- .../smartCasts/safecalls/innerReceiver.fir.kt | 2 +- .../smartCasts/safecalls/insideIfExpr.fir.kt | 43 --- .../smartCasts/safecalls/insideIfExpr.kt | 1 + .../safecalls/nullableReceiver.fir.kt | 13 - .../smartCasts/safecalls/nullableReceiver.kt | 1 + .../nullableReceiverInLongChain.fir.kt | 12 +- .../nullableReceiverWithFlexible.fir.kt | 25 -- .../safecalls/nullableReceiverWithFlexible.kt | 1 + .../safeAccessReceiverNotNull.fir.kt | 8 +- .../tests/smartCasts/safecalls/simple.fir.kt | 2 +- .../tests/smartCasts/safecalls/twoArgs.fir.kt | 2 +- .../tests/smartCasts/smartCastOnWhen.fir.kt | 2 +- ...castOnSameFieldOfDifferentInstances.fir.kt | 11 - ...martcastOnSameFieldOfDifferentInstances.kt | 1 + .../tests/smartCasts/unstableToStable.fir.kt | 8 +- .../variables/lambdaBetweenArguments.fir.kt | 2 +- .../smartCasts/varnotnull/assignment.fir.kt | 4 +- .../varnotnull/boundInitializerWrong.fir.kt | 4 +- .../varnotnull/initInTryReturnInCatch.fir.kt | 6 +- .../varnotnull/initialization.fir.kt | 4 +- .../smartCasts/varnotnull/nestedWhile.fir.kt | 2 +- .../postfixNullableIncrement.fir.kt | 8 - .../varnotnull/postfixNullableIncrement.kt | 1 + .../prefixNullableClassIncrement.fir.kt | 13 - .../prefixNullableClassIncrement.kt | 1 + .../varnotnull/prefixNullableIncrement.fir.kt | 8 - .../varnotnull/prefixNullableIncrement.kt | 1 + .../varnotnull/setNotNullInTry.fir.kt | 14 - .../smartCasts/varnotnull/setNotNullInTry.kt | 1 + .../smartCasts/varnotnull/setNullInTry.fir.kt | 10 - .../smartCasts/varnotnull/setNullInTry.kt | 1 + .../varnotnull/setNullInTryFinally.fir.kt | 16 - .../varnotnull/setNullInTryFinally.kt | 1 + .../varnotnull/setNullInTryUnsound.fir.kt | 2 +- .../smartCasts/varnotnull/varNull.fir.kt | 2 +- .../javaProperties/TypeAnnotation.fir.kt | 13 - .../javaProperties/TypeAnnotation.kt | 1 + .../samAdapters/ReturnTypeAnnotation.fir.kt | 18 -- .../samAdapters/ReturnTypeAnnotation.kt | 1 + .../forEachRemainingNullability.fir.kt | 2 +- .../capturingInInitializer.fir.kt | 4 +- .../jumpoutInInitializer.fir.kt | 6 +- ...rtCastOnValueBoundToSubjectVariable.fir.kt | 4 +- .../contracts/fromStdlib/isNullOrBlank.fir.kt | 4 +- .../contracts/fromStdlib/isNullOrEmpty.fir.kt | 4 +- ...nullabilitySmartcastWhenNullability.fir.kt | 12 +- .../operatorsTests/equalsOperator.fir.kt | 12 +- .../contracts/smartcasts/receiver.fir.kt | 6 +- .../valueOfContractedFunctionIngored.fir.kt | 2 +- .../testsWithStdLib/coroutines/kt36947.fir.kt | 6 - .../testsWithStdLib/coroutines/kt36947.kt | 1 + .../restrictSuspension/outerYield_1_3.fir.kt | 2 +- .../smartcasts/letChangesToNotNull.fir.kt | 7 - .../smartcasts/letChangesToNotNull.kt | 1 + .../smartcasts/letChangesToNullComplex.fir.kt | 2 +- .../smartcasts/withChangesToNull.fir.kt | 2 +- .../testsWithStdLib/tryCatch/assignTry.fir.kt | 14 +- .../tryCatch/boundedSmartcasts.fir.kt | 20 +- .../tryCatch/correctSmartcasts.fir.kt | 6 +- .../tryCatch/correctSmartcasts_after.fir.kt | 6 +- .../tryCatch/falsePositiveSmartcasts.fir.kt | 28 +- .../falsePositiveSmartcasts_after.fir.kt | 26 +- .../contracts/analysis/common/neg/1.fir.kt | 6 +- .../analysis/smartcasts/neg/1.fir.kt | 38 +-- .../analysis/smartcasts/neg/10.fir.kt | 22 +- .../analysis/smartcasts/neg/15.fir.kt | 2 +- .../analysis/smartcasts/neg/4.fir.kt | 16 +- .../analysis/smartcasts/neg/6.fir.kt | 28 +- .../analysis/smartcasts/neg/7.fir.kt | 20 +- .../analysis/smartcasts/neg/8.fir.kt | 8 +- .../analysis/smartcasts/neg/9.fir.kt | 8 +- .../analysis/smartcasts/pos/12.fir.kt | 4 +- .../analysis/smartcasts/pos/14.fir.kt | 6 +- .../analysis/smartcasts/pos/6.fir.kt | 30 +- .../analysis/smartcasts/pos/8.fir.kt | 4 +- .../diagnostics/notLinked/dfa/neg/1.fir.kt | 124 ++++---- .../diagnostics/notLinked/dfa/neg/11.fir.kt | 8 +- .../diagnostics/notLinked/dfa/neg/12.fir.kt | 6 +- .../diagnostics/notLinked/dfa/neg/13.fir.kt | 4 +- .../diagnostics/notLinked/dfa/neg/14.fir.kt | 8 +- .../diagnostics/notLinked/dfa/neg/15.fir.kt | 10 +- .../diagnostics/notLinked/dfa/neg/19.fir.kt | 40 +-- .../diagnostics/notLinked/dfa/neg/20.fir.kt | 40 +-- .../diagnostics/notLinked/dfa/neg/21.fir.kt | 2 +- .../diagnostics/notLinked/dfa/neg/22.fir.kt | 12 +- .../diagnostics/notLinked/dfa/neg/23.fir.kt | 2 +- .../diagnostics/notLinked/dfa/neg/24.fir.kt | 12 +- .../diagnostics/notLinked/dfa/neg/26.fir.kt | 4 +- .../diagnostics/notLinked/dfa/neg/27.fir.kt | 12 +- .../diagnostics/notLinked/dfa/neg/29.fir.kt | 16 +- .../diagnostics/notLinked/dfa/neg/30.fir.kt | 4 +- .../diagnostics/notLinked/dfa/neg/34.fir.kt | 40 +-- .../diagnostics/notLinked/dfa/neg/35.fir.kt | 18 +- .../diagnostics/notLinked/dfa/neg/37.fir.kt | 16 +- .../diagnostics/notLinked/dfa/neg/38.fir.kt | 22 +- .../diagnostics/notLinked/dfa/neg/39.fir.kt | 24 +- .../diagnostics/notLinked/dfa/neg/4.fir.kt | 76 ++--- .../diagnostics/notLinked/dfa/neg/41.fir.kt | 10 +- .../diagnostics/notLinked/dfa/neg/43.fir.kt | 6 +- .../diagnostics/notLinked/dfa/neg/45.fir.kt | 2 +- .../diagnostics/notLinked/dfa/neg/6.fir.kt | 8 +- .../diagnostics/notLinked/dfa/neg/7.fir.kt | 8 +- .../diagnostics/notLinked/dfa/neg/8.fir.kt | 14 +- .../diagnostics/notLinked/dfa/neg/9.fir.kt | 2 +- .../diagnostics/notLinked/dfa/pos/13.fir.kt | 22 +- .../diagnostics/notLinked/dfa/pos/16.fir.kt | 114 ++++---- .../diagnostics/notLinked/dfa/pos/17.fir.kt | 60 ++-- .../diagnostics/notLinked/dfa/pos/18.fir.kt | 66 ++--- .../diagnostics/notLinked/dfa/pos/2.fir.kt | 100 +++---- .../diagnostics/notLinked/dfa/pos/25.fir.kt | 4 +- .../diagnostics/notLinked/dfa/pos/26.fir.kt | 4 +- .../diagnostics/notLinked/dfa/pos/27.fir.kt | 4 +- .../diagnostics/notLinked/dfa/pos/30.fir.kt | 50 ++-- .../diagnostics/notLinked/dfa/pos/31.fir.kt | 34 +-- .../diagnostics/notLinked/dfa/pos/35.fir.kt | 6 +- .../diagnostics/notLinked/dfa/pos/37.fir.kt | 18 +- .../diagnostics/notLinked/dfa/pos/40.fir.kt | 8 +- .../diagnostics/notLinked/dfa/pos/46.fir.kt | 12 +- .../diagnostics/notLinked/dfa/pos/59.fir.kt | 2 +- .../diagnostics/notLinked/dfa/pos/6.fir.kt | 274 +++++++++--------- .../diagnostics/notLinked/dfa/pos/61.fir.kt | 2 +- .../diagnostics/notLinked/dfa/pos/66.fir.kt | 12 +- .../diagnostics/notLinked/dfa/pos/68.fir.kt | 12 +- .../diagnostics/notLinked/dfa/pos/69.fir.kt | 8 +- .../diagnostics/notLinked/dfa/pos/7.fir.kt | 64 ++-- 249 files changed, 1208 insertions(+), 1649 deletions(-) delete mode 100644 compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt1270.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/noAnnotationInClassPath.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/derefenceExtension.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/derefenceMember.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/kt6829.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/elvis/basicOff.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/elvisExclExcl.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/fieldExclExcl.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/loops/doWhileEarlyBreak.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/loops/doWhileInConditionWithBreak.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/loops/doWhileNotNullBreak.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/loops/doWhileNullWithBreak.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/loops/elvisIfBreakInsideWhileTrue.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/loops/elvisLeftBreakInsideWhileTrue.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/loops/whileNullWithBreak.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/loops/whileSimple.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/loops/whileTrivial.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/loops/whileTrueEarlyBreak.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/safecalls/insideIfExpr.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiver.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverWithFlexible.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/smartcastOnSameFieldOfDifferentInstances.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNullableIncrement.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNullableClassIncrement.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNullableIncrement.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNotNullInTry.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNullInTry.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNullInTryFinally.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/TypeAnnotation.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/ReturnTypeAnnotation.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/coroutines/kt36947.fir.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/smartcasts/letChangesToNotNull.fir.kt diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/jumps.kt b/compiler/fir/analysis-tests/testData/resolve/cfg/jumps.kt index 47f1261ef41..8f052f6530b 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/jumps.kt +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/jumps.kt @@ -15,7 +15,7 @@ fun test_2(x: Int?) { } else { x } - y.inc() + y.inc() } fun test_3(x: Int?) { diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/syntheticSmartCast.kt b/compiler/fir/analysis-tests/testData/resolve/expresssions/syntheticSmartCast.kt index 53d7578055b..680f4d71965 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/syntheticSmartCast.kt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/syntheticSmartCast.kt @@ -34,7 +34,7 @@ fun test3(x: AnotherClass?) { fun test4(x: SomeClass?) { val bar = x?.bar if (bar != null) { - x.bar.length + x.bar.length } } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/bangbang.kt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/bangbang.kt index 191e6c3c1fc..327e8273b11 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/bangbang.kt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/bangbang.kt @@ -26,7 +26,7 @@ fun test_3(a: A?, b: Boolean) { if (b && a!!.foo()) { a.foo() // OK } - a.foo() // Bad + a.foo() // Bad } fun test_4(a: A?, b: Boolean) { @@ -38,9 +38,9 @@ fun test_4(a: A?, b: Boolean) { fun test_5(a: A?, b: Boolean) { if (b || a!!.foo()) { - a.foo() + a.foo() } - a.foo() + a.foo() } fun test_6(x: X) { diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/equalsToBoolean.kt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/equalsToBoolean.kt index 0633a92d865..f954bff67f3 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/equalsToBoolean.kt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/equalsToBoolean.kt @@ -8,13 +8,13 @@ fun test_1(b: Boolean?) { if ((b == true) == true) { b.not() // OK } else { - b.not() // Bad + b.not() // Bad } } fun test_2(b: Boolean?) { if ((b == true) != true) { - b.not() // Bad + b.not() // Bad } else { b.not() // OK } @@ -22,7 +22,7 @@ fun test_2(b: Boolean?) { fun test_3(b: Boolean?) { if ((b == true) == false) { - b.not() // Bad + b.not() // Bad } else { b.not() // OK } @@ -32,13 +32,13 @@ fun test_4(b: Boolean?) { if ((b == true) != false) { b.not() // OK } else { - b.not() // Bad + b.not() // Bad } } fun test_5(b: Boolean?) { if ((b != true) == true) { - b.not() // Bad + b.not() // Bad } else { b.not() // OK } @@ -48,7 +48,7 @@ fun test_6(b: Boolean?) { if ((b != true) != true) { b.not() // OK } else { - b.not() // Bad + b.not() // Bad } } @@ -56,13 +56,13 @@ fun test_7(b: Boolean?) { if ((b != true) == false) { b.not() // OK } else { - b.not() // Bad + b.not() // Bad } } fun test_8(b: Boolean?) { if ((b != true) != false) { - b.not() // Bad + b.not() // Bad } else { b.not() // OK } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/jumpFromRhsOfOperator.kt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/jumpFromRhsOfOperator.kt index 1a3e930d382..076f593e151 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/jumpFromRhsOfOperator.kt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/jumpFromRhsOfOperator.kt @@ -34,24 +34,24 @@ fun test_4(a: A?) { fun test_5(a: A?) { a == null || throw Exception() - a.foo() + a.foo() } fun teat_6(a: A?) { a != null && throw Exception() - a.foo() + a.foo() } fun test_7(a: A?) { if (a == null || throw Exception()) { - a.foo() + a.foo() } - a.foo() + a.foo() } fun test_8(a: A?) { if (a != null && throw Exception()) { - a.foo() + a.foo() } - a.foo() + a.foo() } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.kt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.kt index 799697c6597..2914d63d78d 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.kt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.kt @@ -104,18 +104,18 @@ fun test_7() { if (x != null) { x.length // OK - y.length // Bad + y.length // Bad z.length // OK } if (y != null) { - x.length // Bad + x.length // Bad y.length // OK - z.length // Bad + z.length // Bad } if (z != null) { x.length // OK - y.length // Bad + y.length // Bad z.length // OK } } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/equalsAndIdentity.kt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/equalsAndIdentity.kt index 7f20364c055..fcf5c715f73 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/equalsAndIdentity.kt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/equalsAndIdentity.kt @@ -16,12 +16,12 @@ fun test_1(x: A, y: A?) { fun test_2(x: A?, y: A?) { if (x == y) { - x.foo() - y.foo() + x.foo() + y.foo() } if (x === y) { - x.foo() - y.foo() + x.foo() + y.foo() } } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/nullability.kt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/nullability.kt index 135353bff85..3f5877d797c 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/nullability.kt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/nullability.kt @@ -39,18 +39,18 @@ fun test_1(x: A?) { if (x != null) { x.foo() } else { - x.foo() + x.foo() } - x.foo() + x.foo() } fun test_2(x: A?) { if (x == null) { - x.foo() + x.foo() } else { x.foo() } - x.foo() + x.foo() } fun test_3(x: A?) { @@ -67,8 +67,8 @@ fun test_5(q: Q?) { // `q.data` is a property that has an open getter, so we can NOT smartcast it to non-nullable MyData. if (q?.data?.s?.inc() != null) { q.data // good - q.data.s // should be bad - q.data.s.inc() // should be bad + q.data.s // should be bad + q.data.s.inc() // should be bad } } @@ -76,15 +76,15 @@ fun test_6(q: Q?) { // `q.data` is a property that has an open getter, so we can NOT smartcast it to non-nullable MyData. q?.data?.s?.inc() ?: return q.data // good - q.data.s // should be bad - q.data.s.inc() // should be bad + q.data.s // should be bad + q.data.s.inc() // should be bad } fun test_7(q: Q?) { if (q?.fdata()?.fs()?.inc() != null) { q.fdata() // good - q.fdata().fs() // bad - q.fdata().fs().inc() // bad + q.fdata().fs() // bad + q.fdata().fs().inc() // bad } } @@ -98,44 +98,44 @@ fun test_9(a: Int, b: Int?) { if (a == b) { b.inc() } - b.inc() + b.inc() if (a === b) { b.inc() } - b.inc() + b.inc() if (b == a) { b.inc() } - b.inc() + b.inc() if (b === a) { b.inc() } - b.inc() + b.inc() } fun test_10(a: Int?, b: Int?) { if (a == b) { - b.inc() + b.inc() } - b.inc() + b.inc() if (a === b) { - b.inc() + b.inc() } - b.inc() + b.inc() if (b == a) { - b.inc() + b.inc() } - b.inc() + b.inc() if (b === a) { - b.inc() + b.inc() } - b.inc() + b.inc() } fun test_11(q: QImpl?, q2: QImpl) { @@ -148,8 +148,8 @@ fun test_11(q: QImpl?, q2: QImpl) { // Smartcasting of `q.data` should have no effect on `q2.data`. // Issue: Smartcasting of QImpl.data affects all instances q2.data - q2.data.s // should be bad - q2.data.s.inc() // should be bad + q2.data.s // should be bad + q2.data.s.inc() // should be bad if (q2.data != null) { q2.data.s @@ -162,8 +162,8 @@ fun test_12(q: QImplWithCustomGetter?) { // `q.data` is a property that has an open getter, so we can NOT smartcast it to non-nullable MyData. if (q?.data?.s?.inc() != null) { q.data // good - q.data.s // should be bad - q.data.s.inc() // should be bad + q.data.s // should be bad + q.data.s.inc() // should be bad } } @@ -171,7 +171,7 @@ fun test_13(q: QImplMutable?) { // `q.data` is a property that is mutable, so we can NOT smartcast it to non-nullable MyData. if (q?.data?.s?.inc() != null) { q.data // good - q.data.s // should be bad - q.data.s.inc() // should be bad + q.data.s // should be bad + q.data.s.inc() // should be bad } } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/orInWhenBranch.kt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/orInWhenBranch.kt index f8fa330fba3..50a6d0cc510 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/orInWhenBranch.kt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/orInWhenBranch.kt @@ -22,6 +22,6 @@ fun test_3(a: Any?, b: Boolean) { fun test_4(a: Any?, b: Boolean) { if (a is String || b) { - a.foo() // Should be Bad + a.foo() // Should be Bad } } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCallAndEqualityToBool.kt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCallAndEqualityToBool.kt index 0669629735d..4ed7c2294c1 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCallAndEqualityToBool.kt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCallAndEqualityToBool.kt @@ -5,7 +5,7 @@ fun test_1(s: String?) { if (s?.check() == true) { s.length // Should be OK } else { - s.length // Should be bad + s.length // Should be bad } } @@ -13,13 +13,13 @@ fun test_2(s: String?) { if (s?.check() == false) { s.length // Should be OK } else { - s.length // Should be bad + s.length // Should be bad } } fun test_3(s: String?) { if (s?.check() != true) { - s.length // Should be bad + s.length // Should be bad } else { s.length // Should be OK } @@ -27,7 +27,7 @@ fun test_3(s: String?) { fun test_4(s: String?) { if (s?.check() != false) { - s.length // Should be bad + s.length // Should be bad } else { s.length // Should be OK } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCalls.kt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCalls.kt index 4378b7ecc59..83a74410769 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCalls.kt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCalls.kt @@ -5,7 +5,7 @@ fun String.let(block: () -> Unit) {} fun test(x: String?) { x?.foo(x.length == 1) - x.length + x.length } interface A { @@ -27,12 +27,12 @@ fun test_3(x: Any) { fun test_4(x: A?) { x?.id()?.bool() - x.id() + x.id() } fun Any?.boo(b: Boolean) {} fun test_5(x: A?) { x?.let { return }?.boo(x.bool()) - x.id() + x.id() } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/delayedAssignment.kt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/delayedAssignment.kt index 7c160fba45c..05c62c6d6d5 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/delayedAssignment.kt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/delayedAssignment.kt @@ -11,5 +11,5 @@ fun test(b: Boolean) { } else { a = null } - a.foo() + a.foo() } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/smartcastAfterReassignment.kt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/smartcastAfterReassignment.kt index f684cc63a20..bee9f7f464e 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/smartcastAfterReassignment.kt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/smartcastAfterReassignment.kt @@ -18,5 +18,5 @@ fun test_3() { x = "" x.length x = null - x.length + x.length } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromLibrary/notIsNullOrEmpty.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromLibrary/notIsNullOrEmpty.kt index e6abe4d7c53..b5ef1f744b1 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromLibrary/notIsNullOrEmpty.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromLibrary/notIsNullOrEmpty.kt @@ -7,7 +7,7 @@ fun test_1(s: String?) { fun test_2(s: String?) { // contracts related if (s.isNullOrEmpty()) { - s.length // Should be bad + s.length // Should be bad } else { s.length // Should be OK } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/eqNotEq.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/eqNotEq.kt index 2012d4f0aec..e0aa879b4a3 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/eqNotEq.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/eqNotEq.kt @@ -21,7 +21,7 @@ fun test_1(x: String?) { if (checkNotNull(x)) { x.length // OK } else { - x.length // Error + x.length // Error } } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/receivers.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/receivers.kt index e6cf24145ab..6087af3a99d 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/receivers.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/receivers.kt @@ -27,7 +27,7 @@ fun test_3(x: A?) { with(x) { myRequireNotNull() } - x.foo() + x.foo() } fun test_4(x: A?) { diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/collectors/components/ErrorNodeDiagnosticCollectorComponent.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/collectors/components/ErrorNodeDiagnosticCollectorComponent.kt index 80771809fda..6a2e10ea473 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/collectors/components/ErrorNodeDiagnosticCollectorComponent.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/collectors/components/ErrorNodeDiagnosticCollectorComponent.kt @@ -122,7 +122,6 @@ class ErrorNodeDiagnosticCollectorComponent(collector: AbstractDiagnosticCollect rootCause.actualType?.isNullable == true && (rootCause.expectedType == null || !rootCause.expectedType!!.isMarkedNullable) ) { - // TODO: report on call operation node, e.g., x.length instead of x.length val expectedType = rootCause.expectedType if (expectedType == null || expectedType.isEffectivelyNotNull()) { diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt index 011026d1fb7..83ee92ce381 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt @@ -209,7 +209,7 @@ object FirErrors { val WRONG_IMPLIES_CONDITION by warning0() // Nullability - val UNSAFE_CALL by error1() + val UNSAFE_CALL by error1(SourceElementPositioningStrategies.DOT_BY_SELECTOR) // TODO: val UNSAFE_IMPLICIT_INVOKE_CALL by error1() // TODO: val UNSAFE_INFIX_CALL by ... // TODO: val UNSAFE_OPERATOR_CALL by ... diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/LightTreePositioningStrategies.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/LightTreePositioningStrategies.kt index 75912ff75ae..676434586c3 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/LightTreePositioningStrategies.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/LightTreePositioningStrategies.kt @@ -271,6 +271,26 @@ object LightTreePositioningStrategies { return markElement(modifier ?: node, startOffset, endOffset, tree, node) } } + + val DOT_BY_SELECTOR: LightTreePositioningStrategy = object : LightTreePositioningStrategy() { + override fun mark( + node: LighterASTNode, + startOffset: Int, + endOffset: Int, + tree: FlyweightCapableTreeStructure + ): List { + if (node.tokenType != KtNodeTypes.REFERENCE_EXPRESSION && node.tokenType != KtNodeTypes.CALL_EXPRESSION) { + // TODO: normally CALL_EXPRESSION should not be here. In PSI we have REFERENCE_EXPRESSION even for x.bar() case + // Remove CALL_EXPRESSION from here and repeat code below twice (see PSI counterpart) when fixed + return super.mark(node, startOffset, endOffset, tree) + } + val parentNode = tree.getParent(node) ?: return super.mark(node, startOffset, endOffset, tree) + if (parentNode.tokenType == KtNodeTypes.DOT_QUALIFIED_EXPRESSION) { + return markElement(tree.dotOperator(parentNode) ?: node, startOffset, endOffset, tree, node) + } + return super.mark(node, startOffset, endOffset, tree) + } + } } fun FirSourceElement.hasValOrVar(): Boolean = @@ -285,6 +305,9 @@ fun FirSourceElement.hasPrimaryConstructor(): Boolean = private fun FlyweightCapableTreeStructure.constructorKeyword(node: LighterASTNode): LighterASTNode? = findChildByType(node, KtTokens.CONSTRUCTOR_KEYWORD) +private fun FlyweightCapableTreeStructure.dotOperator(node: LighterASTNode): LighterASTNode? = + findChildByType(node, KtTokens.DOT) + private fun FlyweightCapableTreeStructure.initKeyword(node: LighterASTNode): LighterASTNode? = findChildByType(node, KtTokens.INIT_KEYWORD) diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/SourceElementPositioningStrategies.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/SourceElementPositioningStrategies.kt index deb902c6457..3ba463eeb9b 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/SourceElementPositioningStrategies.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/SourceElementPositioningStrategies.kt @@ -62,4 +62,9 @@ object SourceElementPositioningStrategies { LightTreePositioningStrategies.PARAMETER_VARARG_MODIFIER, PositioningStrategies.PARAMETER_VARARG_MODIFIER ) + + val DOT_BY_SELECTOR = SourceElementPositioningStrategy( + LightTreePositioningStrategies.DOT_BY_SELECTOR, + PositioningStrategies.DOT_BY_SELECTOR + ) } \ No newline at end of file diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/PositioningStrategies.kt b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/PositioningStrategies.kt index ade1bd61250..14fd5581a38 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/PositioningStrategies.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/PositioningStrategies.kt @@ -703,4 +703,19 @@ object PositioningStrategies { } } } + + val DOT_BY_SELECTOR: PositioningStrategy = object : PositioningStrategy() { + override fun mark(element: PsiElement): List { + when (element) { + is KtNameReferenceExpression -> { + var parent = element + repeat(2) { + parent = parent.parent + (parent as? KtDotQualifiedExpression)?.operationTokenNode?.psi?.let { return mark(it) } + } + } + } + return super.mark(element) + } + } } diff --git a/compiler/testData/diagnostics/tests/BreakContinue.fir.kt b/compiler/testData/diagnostics/tests/BreakContinue.fir.kt index 3dd08bac65a..469ac667bd4 100644 --- a/compiler/testData/diagnostics/tests/BreakContinue.fir.kt +++ b/compiler/testData/diagnostics/tests/BreakContinue.fir.kt @@ -29,7 +29,7 @@ class C { while (a == null) { break; } - a.compareTo("2") + a.compareTo("2") } fun notContainsBreak(a: String?, b: String?) { @@ -70,7 +70,7 @@ class C { break@l } } - a.compareTo("2") + a.compareTo("2") } fun unresolvedBreak(a: String?, array: Array) { @@ -80,7 +80,7 @@ class C { } if (true) break else break@l } - a.compareTo("2") + a.compareTo("2") } fun twoLabelsOnLoop() { diff --git a/compiler/testData/diagnostics/tests/Nullability.fir.kt b/compiler/testData/diagnostics/tests/Nullability.fir.kt index e8503b1ae07..a59a6f45cfb 100644 --- a/compiler/testData/diagnostics/tests/Nullability.fir.kt +++ b/compiler/testData/diagnostics/tests/Nullability.fir.kt @@ -158,7 +158,7 @@ fun test() { fun f(out : String?) { out?.get(0) - out.get(0) + out.get(0) if (out != null) else return; out.get(0) } diff --git a/compiler/testData/diagnostics/tests/controlStructures/ForLoopWithExtensionIteratorOnNullable.fir.kt b/compiler/testData/diagnostics/tests/controlStructures/ForLoopWithExtensionIteratorOnNullable.fir.kt index a61a47ce9eb..adc7b453dc3 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/ForLoopWithExtensionIteratorOnNullable.fir.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/ForLoopWithExtensionIteratorOnNullable.fir.kt @@ -7,7 +7,7 @@ operator fun Container.iterator(): Iterator = null!! fun test() { val container: Container? = null // Error - container.iterator() + container.iterator() // for extension iterator, this code compiles, but should not for (s in container) {} } diff --git a/compiler/testData/diagnostics/tests/dataFlow/assignment/uninitializedValNullability.fir.kt b/compiler/testData/diagnostics/tests/dataFlow/assignment/uninitializedValNullability.fir.kt index cee27e5b00a..f65640dd63f 100644 --- a/compiler/testData/diagnostics/tests/dataFlow/assignment/uninitializedValNullability.fir.kt +++ b/compiler/testData/diagnostics/tests/dataFlow/assignment/uninitializedValNullability.fir.kt @@ -10,6 +10,6 @@ fun test(a: Any?, flag: Boolean, x: Any?) { } else { b = x - b.hashCode() + b.hashCode() } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/extensions/ExtensionFunctions.fir.kt b/compiler/testData/diagnostics/tests/extensions/ExtensionFunctions.fir.kt index d97a9489f92..26888c69552 100644 --- a/compiler/testData/diagnostics/tests/extensions/ExtensionFunctions.fir.kt +++ b/compiler/testData/diagnostics/tests/extensions/ExtensionFunctions.fir.kt @@ -64,7 +64,7 @@ import outer.* command.foo - command.equals(null) + command.equals(null) command?.equals(null) command.equals1(null) command?.equals1(null) diff --git a/compiler/testData/diagnostics/tests/extensions/kt1875.fir.kt b/compiler/testData/diagnostics/tests/extensions/kt1875.fir.kt index 97b7009ccad..30a0fe540d1 100644 --- a/compiler/testData/diagnostics/tests/extensions/kt1875.fir.kt +++ b/compiler/testData/diagnostics/tests/extensions/kt1875.fir.kt @@ -9,13 +9,13 @@ interface T { } fun test(t: T) { - t.f(1) //unsafe call error + t.f(1) //unsafe call error t.f?.invoke(1) } fun test1(t: T?) { t.f(1) // todo resolve f as value and report UNSAFE_CALL t?.f(1) - t.f?.invoke(1) + t.f?.invoke(1) t?.f?.invoke(1) } diff --git a/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver.fir.kt b/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver.fir.kt index 22fe4826bd5..138db690973 100644 --- a/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver.fir.kt +++ b/compiler/testData/diagnostics/tests/extensions/throwOutCandidatesByReceiver.fir.kt @@ -8,7 +8,7 @@ fun List.a() {} fun test1(i: Int?) { 1.a() - i.a() + i.a() } fun test2(c: Collection) { @@ -19,7 +19,7 @@ fun Int.foo() {} fun test3(s: String?) { "".foo() - s.foo() + s.foo() "".foo(1) s.foo("a") } @@ -52,5 +52,5 @@ fun test7(l: List) { } fun test8(l: List?) { - l.b() + l.b() } diff --git a/compiler/testData/diagnostics/tests/inference/completion/lambdaWithVariableAndNothing.fir.kt b/compiler/testData/diagnostics/tests/inference/completion/lambdaWithVariableAndNothing.fir.kt index bea156ac175..e9ddf1d9b6f 100644 --- a/compiler/testData/diagnostics/tests/inference/completion/lambdaWithVariableAndNothing.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/completion/lambdaWithVariableAndNothing.fir.kt @@ -23,7 +23,7 @@ fun testNoSmartCast1(s: String?) { if (s != null) "" else noSmartCast1(null) { "" } ) - s.length + s.length } fun testNoSmartCast2(s: String?) { @@ -31,7 +31,7 @@ fun testNoSmartCast2(s: String?) { if (s != null) ( {""} ) else noSmartCast2(null) { "" } ) - s.length + s.length } fun testNoSmartCast3(s: String?) { @@ -39,7 +39,7 @@ fun testNoSmartCast3(s: String?) { if (s != null) "" else noSmartCast3(null) { "" } ) - s.length + s.length } // KT-36069 @@ -48,5 +48,5 @@ fun testNoSmartCast4(s: String?) { if (s != null) ( {""} ) else noSmartCast4(null) { "" } ) - s.length + s.length } diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt2842.fir.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt2842.fir.kt index f058a9a90a1..ff15f73a325 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt2842.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt2842.fir.kt @@ -3,14 +3,14 @@ package c interface A fun test(a: A?) { - a.foo() //no error + a.foo() //no error } fun A.foo() {} //------------ fun test(nullabilityInfoMap: Map?) { - nullabilityInfoMap.iterator() //no error + nullabilityInfoMap.iterator() //no error } //resolves to @@ -20,7 +20,7 @@ public fun Map.iterator(): Iterator> {} //------------- fun foo() : Boolean { val nullableList = getNullableList() - return nullableList.contains("") + return nullableList.contains("") } diff --git a/compiler/testData/diagnostics/tests/j+k/sam/enhancedSamConstructor.fir.kt b/compiler/testData/diagnostics/tests/j+k/sam/enhancedSamConstructor.fir.kt index 5a6c239f2a3..0b5a2d8db28 100644 --- a/compiler/testData/diagnostics/tests/j+k/sam/enhancedSamConstructor.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/sam/enhancedSamConstructor.fir.kt @@ -17,12 +17,12 @@ public interface J2 extends J { // FILE: main.kt fun main() { J { s: String -> s} // should be prohibited, because SAM value parameter has nullable type - J { "" + it.length } + J { "" + it.length } J { null } J { it?.length?.toString() } J2 { s: String -> s} - J2 { "" + it.length } + J2 { "" + it.length } J2 { null } J2 { it?.length?.toString() } } diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/InfixCallNullability.fir.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/InfixCallNullability.fir.kt index 72cd24bbdde..4f3edd28f85 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/InfixCallNullability.fir.kt +++ b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/InfixCallNullability.fir.kt @@ -13,18 +13,18 @@ fun test(x : Int?, a : A?) { x?.plus(1) x + 1 -x - x.unaryMinus() + x.unaryMinus() x?.unaryMinus() - a.plus(1) + a.plus(1) a?.plus(1) a plus 1 a + 1 -a - a.unaryMinus() + a.unaryMinus() a?.unaryMinus() - a.div(1) + a.div(1) a / 1 a div 1 a?.div(1) @@ -36,6 +36,6 @@ fun test(x : Int?, a : A?) { 1 in a a contains 1 - a.contains(1) + a.contains(1) a?.contains(1) } diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/QualifiedExpressionNullability.fir.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/QualifiedExpressionNullability.fir.kt index 2f5c6a7e097..afbacdf9d23 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/QualifiedExpressionNullability.fir.kt +++ b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/QualifiedExpressionNullability.fir.kt @@ -7,7 +7,7 @@ fun main() { val x: Foo? = null val y: Foo? = null - x.foo(y) + x.foo(y) x!!.foo(y) x.foo(y!!) x!!.foo(y!!) @@ -16,8 +16,8 @@ fun main() { val b: Foo? = null val c: Foo? = null - a.foo(b.foo(c)) - a!!.foo(b.foo(c)) + a.foo(b.foo(c)) + a!!.foo(b.foo(c)) a.foo(b!!.foo(c)) a!!.foo(b!!.foo(c)) a.foo(b.foo(c!!)) diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/ReceiverNullability.fir.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/ReceiverNullability.fir.kt index 9e276aeb021..37770900ab6 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/ReceiverNullability.fir.kt +++ b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/ReceiverNullability.fir.kt @@ -6,8 +6,8 @@ fun A.bar() {} fun A?.buzz() {} fun test(a : A?) { - a.foo() // error - a.bar() // error + a.foo() // error + a.bar() // error a.buzz() a?.foo() @@ -34,8 +34,8 @@ fun A?.test3() { bar() // error buzz() - this.foo() // error - this.bar() // error + this.foo() // error + this.bar() // error this.buzz() this?.foo() diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt1270.fir.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt1270.fir.kt deleted file mode 100644 index a874fdd3e2d..00000000000 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt1270.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_VARIABLE -//KT-1270 Poor highlighting when trying to dereference a nullable reference - -package kt1270 - -fun foo() { - val sc = java.util.HashMap()[""] - val value = sc.value -} - -private class SomeClass() { - val value : Int = 5 -} diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt1270.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt1270.kt index 7f56511c759..37992b3da4a 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt1270.kt +++ b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt1270.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_VARIABLE //KT-1270 Poor highlighting when trying to dereference a nullable reference diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2125.fir.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2125.fir.kt index de9fdea7140..cbea5e11219 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2125.fir.kt +++ b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2125.fir.kt @@ -5,7 +5,7 @@ package e fun main() { val compareTo = 1 val s: String? = null - s.compareTo("") + s.compareTo("") val bar = 2 s.bar() diff --git a/compiler/testData/diagnostics/tests/platformTypes/noAnnotationInClassPath.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/noAnnotationInClassPath.fir.kt deleted file mode 100644 index 8bf5b4f0e03..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/noAnnotationInClassPath.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -// FILE: A.java - -// It's supposed that there is no JSR-305 annotation in classpath -public interface A { - public boolean foo(@javax.annotation.Nullable T y) {} -} - -// FILE: B.java - -public class B { - public static void bar(A y) {} -} - -// FILE: main.kt -fun test() { - B.bar() { it.hashCode() > 0 } -} diff --git a/compiler/testData/diagnostics/tests/platformTypes/noAnnotationInClassPath.kt b/compiler/testData/diagnostics/tests/platformTypes/noAnnotationInClassPath.kt index 9d7e4b8a14d..68bc08b12d1 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/noAnnotationInClassPath.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/noAnnotationInClassPath.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java // It's supposed that there is no JSR-305 annotation in classpath diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/derefenceExtension.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/derefenceExtension.fir.kt deleted file mode 100644 index b283f99169b..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/derefenceExtension.fir.kt +++ /dev/null @@ -1,45 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -// FILE: J.java - -import org.jetbrains.annotations.*; - -public class J { - @NotNull - public static J staticNN; - @Nullable - public static J staticN; - public static J staticJ; -} - -// FILE: k.kt - -fun test() { - // @NotNull platform type - val platformNN = J.staticNN - // @Nullable platform type - val platformN = J.staticN - // platform type with no annotation - val platformJ = J.staticJ - - platformNN.foo() - platformN.foo() - platformJ.foo() - - with(platformNN) { - foo() - } - with(platformN) { - foo() - } - with(platformJ) { - foo() - } - - platformNN.bar() - platformN.bar() - platformJ.bar() -} - -fun J.foo() {} -fun J?.bar() {} diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/derefenceExtension.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/derefenceExtension.kt index 4ae96335e20..7d60e65caba 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/derefenceExtension.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/derefenceExtension.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER // FILE: J.java diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/derefenceMember.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/derefenceMember.fir.kt deleted file mode 100644 index 4422bd3d76e..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/derefenceMember.fir.kt +++ /dev/null @@ -1,40 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -// FILE: J.java - -import org.jetbrains.annotations.*; - -public class J { - @NotNull - public static J staticNN; - @Nullable - public static J staticN; - public static J staticJ; - - public void foo() {} -} - -// FILE: k.kt - -fun test() { - // @NotNull platform type - val platformNN = J.staticNN - // @Nullable platform type - val platformN = J.staticN - // platform type with no annotation - val platformJ = J.staticJ - - platformNN.foo() - platformN.foo() - platformJ.foo() - - with(platformNN) { - foo() - } - with(platformN) { - foo() - } - with(platformJ) { - foo() - } -} diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/derefenceMember.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/derefenceMember.kt index e5623f1313a..b882bf9d42f 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/derefenceMember.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/derefenceMember.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER // FILE: J.java diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/invoke.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/invoke.fir.kt index f858bc8d56f..8189379f712 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/invoke.fir.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/invoke.fir.kt @@ -18,6 +18,6 @@ public class J { fun test() { J.staticNN() - J.staticN() + J.staticN() J.staticJ() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/kt6829.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/kt6829.fir.kt deleted file mode 100644 index 6bc3106d2f2..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/kt6829.fir.kt +++ /dev/null @@ -1,24 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -// KT-6829 False warning on map to @Nullable - -// FILE: J.java - -import org.jetbrains.annotations.*; - -public class J { - - @Nullable - public String method() { return ""; } -} - -// FILE: k.kt - -fun foo(collection: Collection) { - val mapped = collection.map { it.method() } - mapped[0].length -} - -public fun Iterable.map(transform: (T) -> R): List { - null!! -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/kt6829.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/kt6829.kt index 672e15d006f..bbd9e2115e9 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/kt6829.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/kt6829.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER // KT-6829 False warning on map to @Nullable diff --git a/compiler/testData/diagnostics/tests/platformTypes/typeEnhancement/overriddenExtensions.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/typeEnhancement/overriddenExtensions.fir.kt index 1efd7128a34..6050510761f 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/typeEnhancement/overriddenExtensions.fir.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/typeEnhancement/overriddenExtensions.fir.kt @@ -8,8 +8,8 @@ class E : B1() { fun baz() { val x: String? = "" - x.foo(x) - x.foo("") + x.foo(x) + x.foo("") x.bar(x) x.bar("") } diff --git a/compiler/testData/diagnostics/tests/regressions/kt12898.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt12898.fir.kt index 24aa3ce70c9..f54ea71e143 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt12898.fir.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt12898.fir.kt @@ -10,7 +10,7 @@ class C(override val t: Any?) : B fun f(b: B<*, Any>) { val y = b.t if (y is String?) { - y.length + y.length } } diff --git a/compiler/testData/diagnostics/tests/regressions/kt557.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt557.fir.kt index c48032772db..e5b427e5149 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt557.fir.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt557.fir.kt @@ -8,5 +8,5 @@ fun Array.length() : Int { } fun test(array : Array?) { - array?.sure>().length() + array?.sure>().length() } diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/implicitInvokeAfterSafeCall.fir.kt b/compiler/testData/diagnostics/tests/resolve/invoke/implicitInvokeAfterSafeCall.fir.kt index 21bb974a2bc..b47186d0eeb 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/implicitInvokeAfterSafeCall.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/implicitInvokeAfterSafeCall.fir.kt @@ -12,7 +12,7 @@ class Another1 { fun Another1.main(x: Bar1?) { x?.value {} - x?.value.invoke({}) + x?.value.invoke({}) } // Test case 2: additional receiver, non-generic invoke @@ -26,7 +26,7 @@ class Another2 { fun Another2.main(x: Bar2?) { x?.value(1) - x?.value.invoke(1) + x?.value.invoke(1) } // Test case 3: additional generic receiver, generic invoke @@ -40,7 +40,7 @@ class Another3 { fun Another3.main(x: Bar3?) { x?.value(1) - x?.value.invoke(1) + x?.value.invoke(1) } // Test case 4: additional receiver, generic invoke with nullable receiver @@ -68,7 +68,7 @@ class Another5 { fun Another5.main(x: Bar5?) { x?.value {} - x?.value.invoke({}) + x?.value.invoke({}) } // Test case 6: top-level generic invoke @@ -96,7 +96,7 @@ operator fun Foo7.invoke(x: Int) {} fun Another7.main(x: Bar7?) { x?.value(1) - x?.value.invoke(1) + x?.value.invoke(1) } // Test case 8: top-level non-generic invoke @@ -136,5 +136,5 @@ class Another10 { fun Another10.main(x: Bar10?) { x?.value {} - x?.value.invoke({}) + x?.value.invoke({}) } diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAndSmartCast.fir.kt b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAndSmartCast.fir.kt index adcc02931d2..a339133b60c 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/invokeAndSmartCast.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/invokeAndSmartCast.fir.kt @@ -7,7 +7,7 @@ fun test(a: A) { (a.x)("") } "".(a.x)() - a.x("") + a.x("") (a.x)("") with("") { diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/kt30695_2.fir.kt b/compiler/testData/diagnostics/tests/resolve/invoke/kt30695_2.fir.kt index 1f172f753b1..ee5b1fb0b16 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/kt30695_2.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/kt30695_2.fir.kt @@ -30,7 +30,7 @@ fun testNullableReceiver(nullable: Cls?) { } fun testNotNullableReceiver(notNullable: Cls) { - notNullable.nullableExtensionProperty() + notNullable.nullableExtensionProperty() notNullable?.extensionProperty() } @@ -38,6 +38,6 @@ fun testFlexibleReceiver() { val flexible = JavaClass.createFlexible() flexible.extensionProperty() flexible?.extensionProperty() - flexible.nullableExtensionProperty() + flexible.nullableExtensionProperty() flexible?.nullableExtensionProperty() } diff --git a/compiler/testData/diagnostics/tests/safeCall.fir.kt b/compiler/testData/diagnostics/tests/safeCall.fir.kt index 0fab2d0aaf5..2cdf67aa545 100644 --- a/compiler/testData/diagnostics/tests/safeCall.fir.kt +++ b/compiler/testData/diagnostics/tests/safeCall.fir.kt @@ -1,7 +1,7 @@ // !WITH_NEW_INFERENCE fun f(s: String, action: (String.() -> Unit)?) { - s.foo().bar().action() + s.foo().bar().action() } fun String.foo() = "" diff --git a/compiler/testData/diagnostics/tests/smartCasts/alwaysNull.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/alwaysNull.fir.kt index eacb222a921..7addcc32b87 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/alwaysNull.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/alwaysNull.fir.kt @@ -3,7 +3,7 @@ fun foo(): String { var s: String? s = null s?.length - s.length + s.length if (s == null) return s!! var t: String? = "y" if (t == null) t = "x" diff --git a/compiler/testData/diagnostics/tests/smartCasts/castchecks/basicOff.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/castchecks/basicOff.fir.kt index 6cc76dce8d8..48eba2309dd 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/castchecks/basicOff.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/castchecks/basicOff.fir.kt @@ -13,7 +13,7 @@ fun g(a: SomeClass?) { // 'a' can be cast to SomeSubClass a.hashCode() a.foo - (a as? SomeSubClass).foo + (a as? SomeSubClass).foo (a as SomeSubClass).foo } val b = (a as? SomeSubClass)?.foo @@ -21,7 +21,7 @@ fun g(a: SomeClass?) { // 'a' can be cast to SomeSubClass a.hashCode() a.foo - (a as? SomeSubClass).foo + (a as? SomeSubClass).foo (a as SomeSubClass).foo } val c = a as? SomeSubClass @@ -29,7 +29,7 @@ fun g(a: SomeClass?) { // 'a' and 'c' can be cast to SomeSubClass a.hashCode() a.foo - (a as? SomeSubClass).foo + (a as? SomeSubClass).foo c.hashCode() c.foo } diff --git a/compiler/testData/diagnostics/tests/smartCasts/castchecks/basicOn.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/castchecks/basicOn.fir.kt index 0a93220068b..0a2f990344a 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/castchecks/basicOn.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/castchecks/basicOn.fir.kt @@ -13,7 +13,7 @@ fun g(a: SomeClass?) { // 'a' can be cast to SomeSubClass a.hashCode() a.foo - (a as? SomeSubClass).foo + (a as? SomeSubClass).foo (a as SomeSubClass).foo } val b = (a as? SomeSubClass)?.foo @@ -21,7 +21,7 @@ fun g(a: SomeClass?) { // 'a' can be cast to SomeSubClass a.hashCode() a.foo - (a as? SomeSubClass).foo + (a as? SomeSubClass).foo (a as SomeSubClass).foo } val c = a as? SomeSubClass @@ -29,7 +29,7 @@ fun g(a: SomeClass?) { // 'a' and 'c' can be cast to SomeSubClass a.hashCode() a.foo - (a as? SomeSubClass).foo + (a as? SomeSubClass).foo c.hashCode() c.foo } diff --git a/compiler/testData/diagnostics/tests/smartCasts/castchecks/variables.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/castchecks/variables.fir.kt index e4f801c3529..2553f583b3e 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/castchecks/variables.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/castchecks/variables.fir.kt @@ -18,18 +18,18 @@ fun g(a: SomeClass?) { b = "Hello" if (b != null) { // 'a' cannot be cast to SomeSubClass! - a.hashCode() + a.hashCode() a.foo - (a as? SomeSubClass).foo + (a as? SomeSubClass).foo (a as SomeSubClass).foo } var c = a as? SomeSubClass c = Impl if (c != null) { // 'a' cannot be cast to SomeSubClass - a.hashCode() + a.hashCode() a.foo - (a as? SomeSubClass).foo + (a as? SomeSubClass).foo c.hashCode() c.foo } @@ -41,18 +41,18 @@ fun f(a: SomeClass?) { if (aa as? SomeSubClass != null) { aa = null // 'aa' cannot be cast to SomeSubClass - aa.hashCode() + aa.hashCode() aa.foo - (aa as? SomeSubClass).foo + (aa as? SomeSubClass).foo (aa as SomeSubClass).foo } val b = (aa as? SomeSubClass)?.foo aa = null if (b != null) { // 'aa' cannot be cast to SomeSubClass - aa.hashCode() + aa.hashCode() aa.foo - (aa as? SomeSubClass).foo + (aa as? SomeSubClass).foo (aa as SomeSubClass).foo } aa = a @@ -61,7 +61,7 @@ fun f(a: SomeClass?) { // 'c' can be cast to SomeSubClass aa.hashCode() aa.foo - (aa as? SomeSubClass).foo + (aa as? SomeSubClass).foo c.hashCode() c.foo } diff --git a/compiler/testData/diagnostics/tests/smartCasts/comparisonUnderAnd.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/comparisonUnderAnd.fir.kt index 0942e634d82..7cb7444019d 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/comparisonUnderAnd.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/comparisonUnderAnd.fir.kt @@ -6,30 +6,30 @@ fun foo(x : String?, y : String?) { y.length } else { - x.length - y.length + x.length + y.length } if (y != null || x == y) { - x.length - y.length + x.length + y.length } else { // y == null but x != y - x.length - y.length + x.length + y.length } if (y == null && x != y) { // y == null but x != y - x.length - y.length + x.length + y.length } else { - x.length - y.length + x.length + y.length } if (y == null || x != y) { - x.length - y.length + x.length + y.length } else { // Both not null diff --git a/compiler/testData/diagnostics/tests/smartCasts/complexComparison.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/complexComparison.fir.kt index a0b569474bb..aa9eca4af42 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/complexComparison.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/complexComparison.fir.kt @@ -3,21 +3,21 @@ fun foo(x: String?, y: String?, z: String?, w: String?) { if (x != null && y != null && (x == z || y == z)) z.length else - z.length + z.length if (x != null || y != null || (x != z && y != z)) - z.length + z.length else - z.length + z.length if (x == null || y == null || (x != z && y != z)) - z.length + z.length else z.length if (x != null && y == x && z == y && w == z) w.length else - w.length + w.length if ((x != null && y == x) || (z != null && y == z)) y.length else - y.length + y.length } diff --git a/compiler/testData/diagnostics/tests/smartCasts/complexConditionsWithExcl.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/complexConditionsWithExcl.fir.kt index 195b7264fcc..1789cdb3530 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/complexConditionsWithExcl.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/complexConditionsWithExcl.fir.kt @@ -1,26 +1,26 @@ fun foo(x: String?, y: String?, z: String?) { if ((x!!.hashCode() == 0 || y!!.hashCode() == 1) && z!!.hashCode() == 2) { x.length - y.length + y.length // condition is true => z!! after and is called z.length } else { x.length - y.length - z.length + y.length + z.length } // First element is always analyzed x.length var xx = y ?: z if ((xx!!.hashCode() == 0 && y!!.hashCode() == 1) || z!!.hashCode() == 2) { xx.length - y.length - z.length + y.length + z.length } else { xx.length - y.length + y.length // condition is false => z!! after or is called z.length } @@ -35,16 +35,16 @@ fun foo(x: String?, y: String?, z: String?) { } else { xx.length - y.length - z.length + y.length + z.length } // First element is always analyzed x.length xx = y ?: z if (xx!!.hashCode() == 0 || y!!.hashCode() == 1 || z!!.hashCode() == 2) { xx.length - y.length - z.length + y.length + z.length } else { // all three are called diff --git a/compiler/testData/diagnostics/tests/smartCasts/elvis/basicOff.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/elvis/basicOff.fir.kt deleted file mode 100644 index a97995bf7b1..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/elvis/basicOff.fir.kt +++ /dev/null @@ -1,50 +0,0 @@ -// !LANGUAGE: -BooleanElvisBoundSmartCasts - -interface Order { - val expired: Boolean? - - fun notExpired(): Boolean - - fun doSomething() -} - -fun foo(o: Any) { - val order = o as? Order - if (order?.expired ?: false) { - order.doSomething() - } - else { - - } - if (order?.notExpired() ?: false) { - order.doSomething() - } -} - -fun bar(o: Any) { - val order = o as? Order - if (order?.expired ?: true) { - - } - else { - order!!.doSomething() - } - if (order?.notExpired() ?: true) { - - } - else { - order!!.doSomething() - } -} - -fun baz(o: Boolean?) { - if (o ?: false) { - o.hashCode() - } - if (o ?: true) { - - } - else { - o.hashCode() - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/elvis/basicOff.kt b/compiler/testData/diagnostics/tests/smartCasts/elvis/basicOff.kt index aa8525d1d2e..c15d4fe3ffc 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/elvis/basicOff.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/elvis/basicOff.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: -BooleanElvisBoundSmartCasts interface Order { diff --git a/compiler/testData/diagnostics/tests/smartCasts/elvis/basicOn.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/elvis/basicOn.fir.kt index 414fb5033f0..89029fb6fd7 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/elvis/basicOn.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/elvis/basicOn.fir.kt @@ -11,13 +11,13 @@ interface Order { fun foo(o: Any) { val order = o as? Order if (order?.expired ?: false) { - order.doSomething() + order.doSomething() } else { } if (order?.notExpired() ?: false) { - order.doSomething() + order.doSomething() } } @@ -39,12 +39,12 @@ fun bar(o: Any) { fun baz(o: Boolean?) { if (o ?: false) { - o.hashCode() + o.hashCode() } if (o ?: true) { } else { - o.hashCode() + o.hashCode() } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/elvisExclExcl.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/elvisExclExcl.fir.kt deleted file mode 100644 index 9f7cab3fbbe..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/elvisExclExcl.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -// Based on KT-9100 -fun test(x: Any?, y: Any?): Any { - val z = x ?: y!! - y.hashCode() - // !! / ?. is necessary here, because y!! above may not be executed - y?.hashCode() - y!!.hashCode() - return z -} diff --git a/compiler/testData/diagnostics/tests/smartCasts/elvisExclExcl.kt b/compiler/testData/diagnostics/tests/smartCasts/elvisExclExcl.kt index ac6084bbe2c..67ce0a76f2c 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/elvisExclExcl.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/elvisExclExcl.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // Based on KT-9100 fun test(x: Any?, y: Any?): Any { val z = x ?: y!! diff --git a/compiler/testData/diagnostics/tests/smartCasts/elvisNothingRHS.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/elvisNothingRHS.fir.kt index 6f98ac66762..b1374cd0426 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/elvisNothingRHS.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/elvisNothingRHS.fir.kt @@ -4,7 +4,7 @@ class C { fun test(a: C?, nn: () -> Nothing?) { a ?: nn() - a.foo() + a.foo() a ?: return a.foo() diff --git a/compiler/testData/diagnostics/tests/smartCasts/enumEntryMembers_after.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/enumEntryMembers_after.fir.kt index 89fe005a236..1bbd7a7008a 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/enumEntryMembers_after.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/enumEntryMembers_after.fir.kt @@ -12,7 +12,7 @@ fun printMessages() { Message.HELLO.text!! Message.HELLO.text.length - Message.NOTHING.text.length + Message.NOTHING.text.length Message.NOTHING.text!! Message.NOTHING.text.length diff --git a/compiler/testData/diagnostics/tests/smartCasts/enumEntryMembers_before.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/enumEntryMembers_before.fir.kt index 3279bad6e1c..251e75b1d54 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/enumEntryMembers_before.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/enumEntryMembers_before.fir.kt @@ -12,7 +12,7 @@ fun printMessages() { Message.HELLO.text!! Message.HELLO.text.length - Message.NOTHING.text.length + Message.NOTHING.text.length Message.NOTHING.text!! Message.NOTHING.text.length diff --git a/compiler/testData/diagnostics/tests/smartCasts/exclUnderAnd.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/exclUnderAnd.fir.kt index 92375c17b25..cd23155b55e 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/exclUnderAnd.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/exclUnderAnd.fir.kt @@ -2,12 +2,12 @@ class D(val a: String, val b: Boolean) fun foo(p: Boolean, v: D?): String { if (p && v!!.b) v.a - else v.a + else v.a if (p && v!! == D("?", false)) v.a - else v.a - if (p || v!!.b) v.a + else v.a + if (p || v!!.b) v.a else v.a - if (p || v!! == D("?", false)) v.a + if (p || v!! == D("?", false)) v.a else v.a return "" } diff --git a/compiler/testData/diagnostics/tests/smartCasts/extensionSafeCall.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/extensionSafeCall.fir.kt index fe696141e76..33fc365b7a8 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/extensionSafeCall.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/extensionSafeCall.fir.kt @@ -9,5 +9,5 @@ fun T?.let(f: (T) -> Unit) { fun test(your: Your?) { (your?.foo() as? Any)?.let {} // strange smart cast to 'Your' at this point - your.hashCode() + your.hashCode() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/fieldExclExcl.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/fieldExclExcl.fir.kt deleted file mode 100644 index ba139fb72fc..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/fieldExclExcl.fir.kt +++ /dev/null @@ -1,12 +0,0 @@ -// !DIAGNOSTICS: -UNNECESSARY_NOT_NULL_ASSERTION -// See KT-9126: Variable change does not affect data flow info for its fields - -class My(val x: Int?) - -fun foo() { - var y: My? = My(42) - if (y!!.x != null) { - y = My(null) - y!!.x.hashCode() - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/fieldExclExcl.kt b/compiler/testData/diagnostics/tests/smartCasts/fieldExclExcl.kt index 2d406e0dc06..ecd7948c674 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/fieldExclExcl.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/fieldExclExcl.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNNECESSARY_NOT_NULL_ASSERTION // See KT-9126: Variable change does not affect data flow info for its fields diff --git a/compiler/testData/diagnostics/tests/smartCasts/fieldPlus.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/fieldPlus.fir.kt index e0b0a52ecc2..7ec20a52a1f 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/fieldPlus.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/fieldPlus.fir.kt @@ -9,6 +9,6 @@ fun foo() { var y: My? = My(42) if (y!!.x != null) { y = My(null) - (y + My(0)).x.hashCode() + (y + My(0)).x.hashCode() } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/inference/kt39010.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/inference/kt39010.fir.kt index e59ff0887e9..1c01fc7674d 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/inference/kt39010.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/inference/kt39010.fir.kt @@ -5,7 +5,7 @@ class A { class B(var a: A<*>?) { fun bar() { if (a != null) { - a.foo() + a.foo() } } } diff --git a/compiler/testData/diagnostics/tests/smartCasts/kt32358_2.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/kt32358_2.fir.kt index 1ca5c52cac0..95a8dd74db7 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/kt32358_2.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/kt32358_2.fir.kt @@ -14,7 +14,7 @@ inline fun callItContracted(fn: () -> R): R { fun smartIt(p1: String?, p2: String?) { p1 ?: callIt { return } - p1.length + p1.length p2 ?: callItContracted { return } p2.length diff --git a/compiler/testData/diagnostics/tests/smartCasts/kt32358_3.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/kt32358_3.fir.kt index f3e92e052df..869bc94e263 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/kt32358_3.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/kt32358_3.fir.kt @@ -6,5 +6,5 @@ fun callIt(fn: () -> R): R = TODO() fun smartIt(p1: String?, p2: String?) { p1 ?: callIt { TODO() } - p1.length // smartcast + p1.length // smartcast } diff --git a/compiler/testData/diagnostics/tests/smartCasts/level_1_0.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/level_1_0.fir.kt index 7fd08a927d0..0707da7903b 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/level_1_0.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/level_1_0.fir.kt @@ -36,7 +36,7 @@ fun kt6840_2(s: String?) { fun kt1635(s: String?) { s?.hashCode()!! - s.hashCode() + s.hashCode() } fun kt2127() { diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/WhileTrueWithBreakInIfCondition.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/WhileTrueWithBreakInIfCondition.fir.kt index 168d317f4f4..b317ea2382e 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/WhileTrueWithBreakInIfCondition.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/WhileTrueWithBreakInIfCondition.fir.kt @@ -9,5 +9,5 @@ fun checkJump(x: Int?, y: Int?) { y.hashCode() } // Smart cast here is erroneous: y is nullable - y.hashCode() + y.hashCode() } diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/assignElvisIfBreakInsideWhileTrue.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/assignElvisIfBreakInsideWhileTrue.fir.kt index d33da59cc71..2f7d91038e7 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/assignElvisIfBreakInsideWhileTrue.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/assignElvisIfBreakInsideWhileTrue.fir.kt @@ -4,8 +4,8 @@ public fun foo(x: String?, y: String?): Int { // z is not null in both branches z.length // y is nullable if x != null - y.length + y.length } // y is null because of the break - return y.length + return y.length } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/assignWhenInsideWhileTrue.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/assignWhenInsideWhileTrue.fir.kt index 9ae054e7a89..a39f757f3df 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/assignWhenInsideWhileTrue.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/assignWhenInsideWhileTrue.fir.kt @@ -13,5 +13,5 @@ public fun foo(x: String?): Int { checkSubtype(y) } // x is null because of the break - return x.length + return x.length } diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/callBreakBetweenInsideDoWhile.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/callBreakBetweenInsideDoWhile.fir.kt index 5f6a3ef3f84..096f65c3ec1 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/callBreakBetweenInsideDoWhile.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/callBreakBetweenInsideDoWhile.fir.kt @@ -10,7 +10,7 @@ public fun foo(x: String?, z: String?, w: String?): Int { // w is not null because of w!! w.length // z is nullable despite of z!! - z.length + z.length // x is null because of the break - return x.length + return x.length } diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/callBreakFirstInsideDoWhile.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/callBreakFirstInsideDoWhile.fir.kt index 91cd9cd460a..da00f4a1c6d 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/callBreakFirstInsideDoWhile.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/callBreakFirstInsideDoWhile.fir.kt @@ -7,7 +7,7 @@ public fun foo(x: String?, z: String?): Int { gav(if (x == null) break else x, z!!) } while (bar()) // z is nullable despite of z!! - z.length + z.length // x is null because of the break - return x.length + return x.length } diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/callBreakInsideDoWhile.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/callBreakInsideDoWhile.fir.kt index 1c48328167c..d18854ef874 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/callBreakInsideDoWhile.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/callBreakInsideDoWhile.fir.kt @@ -10,5 +10,5 @@ public fun foo(x: String?): Int { } while (bar()) y.hashCode() // x is null because of the break - return x.length + return x.length } diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/callBreakSecondInsideDoWhile.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/callBreakSecondInsideDoWhile.fir.kt index 0e7ba8e3c8d..c5ae40d008b 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/callBreakSecondInsideDoWhile.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/callBreakSecondInsideDoWhile.fir.kt @@ -9,5 +9,5 @@ public fun foo(x: String?, z: String?): Int { // z is not null because of z!! z.length // x is null because of the break - return x.length + return x.length } diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/callBreakThirdInsideDoWhile.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/callBreakThirdInsideDoWhile.fir.kt index b9bd9023c2f..9d6fac8fde0 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/callBreakThirdInsideDoWhile.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/callBreakThirdInsideDoWhile.fir.kt @@ -12,5 +12,5 @@ public fun foo(x: String?, z: String?, w: String?): Int { // z is not null because of z!! z.length // x is null because of the break - return x.length + return x.length } diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileEarlyBreak.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileEarlyBreak.fir.kt deleted file mode 100644 index fc422b57203..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileEarlyBreak.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -fun x(): Boolean { return true } - -fun y(): Boolean { return false } - -public fun foo(p: String?): Int { - do { - if (y()) break - // We do not always reach this statement - p!!.length - } while (!x()) - // Here we have do while loop but p is still nullable due to break before - return p.length -} diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileEarlyBreak.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileEarlyBreak.kt index bb247bf53d4..7547c07aa97 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileEarlyBreak.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileEarlyBreak.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun x(): Boolean { return true } fun y(): Boolean { return false } diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileInConditionWithBreak.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileInConditionWithBreak.fir.kt deleted file mode 100644 index 67cac1f788a..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileInConditionWithBreak.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -fun bar(): Boolean { return true } - -fun foo(s: String?): Int { - do { - if (bar()) break - } while (s!!.length > 0) - // This call is unsafe due to break - return s.length -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileInConditionWithBreak.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileInConditionWithBreak.kt index 705c0b7bedf..a4408991e01 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileInConditionWithBreak.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileInConditionWithBreak.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun bar(): Boolean { return true } fun foo(s: String?): Int { diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileNotNullBreak.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileNotNullBreak.fir.kt deleted file mode 100644 index 1b666f7e37e..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileNotNullBreak.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -fun x(): Boolean { return true } - -public fun foo(p: String?): Int { - // See KT-6283 - do { - if (p != null) break - } while (!x()) - // p can be null despite of the break - return p.length -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileNotNullBreak.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileNotNullBreak.kt index 2fef8ba84eb..5d03080c6a3 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileNotNullBreak.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileNotNullBreak.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun x(): Boolean { return true } public fun foo(p: String?): Int { diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileNullWithBreak.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileNullWithBreak.fir.kt deleted file mode 100644 index 5bda17d85b3..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileNullWithBreak.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -fun bar(): Boolean { return true } - -fun foo(s: String?): Int { - do { - if (bar()) break - } while (s==null) - // This call is unsafe due to break - return s.length -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileNullWithBreak.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileNullWithBreak.kt index 96fc41f637f..11f9189c434 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileNullWithBreak.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/doWhileNullWithBreak.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun bar(): Boolean { return true } fun foo(s: String?): Int { diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/elvisBreakInsideDoWhile.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/elvisBreakInsideDoWhile.fir.kt index ee74f603b96..d3e04db1587 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/elvisBreakInsideDoWhile.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/elvisBreakInsideDoWhile.fir.kt @@ -6,5 +6,5 @@ public fun foo(x: String?): Int { x.length } while (true) // x is null because of the break - return x.length + return x.length } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/elvisIfBreakInsideWhileTrue.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/elvisIfBreakInsideWhileTrue.fir.kt deleted file mode 100644 index 0f01873f47a..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/elvisIfBreakInsideWhileTrue.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -public fun foo(x: String?, y: String?): Int { - while (true) { - x ?: if (y == null) break - // y is nullable if x != null - y.length - } - // y is null because of the break - return y.length -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/elvisIfBreakInsideWhileTrue.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/elvisIfBreakInsideWhileTrue.kt index b8b04d502f4..ef2399abbe4 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/elvisIfBreakInsideWhileTrue.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/elvisIfBreakInsideWhileTrue.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL public fun foo(x: String?, y: String?): Int { while (true) { x ?: if (y == null) break diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/elvisLeftBreakInsideWhileTrue.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/elvisLeftBreakInsideWhileTrue.fir.kt deleted file mode 100644 index 0b4a792714c..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/elvisLeftBreakInsideWhileTrue.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -public fun foo(x: String?, y: String?): Int { - while (true) { - (if (x != null) break else y) ?: y!! - // y is not null in both branches but it's hard to determine - y.length - } - // y can be null because of the break - return y.length -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/elvisLeftBreakInsideWhileTrue.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/elvisLeftBreakInsideWhileTrue.kt index 45024dd6817..4f8680f4d5f 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/elvisLeftBreakInsideWhileTrue.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/elvisLeftBreakInsideWhileTrue.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL public fun foo(x: String?, y: String?): Int { while (true) { (if (x != null) break else y) ?: y!! diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/ifBreakAssignInsideDoWhile.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/ifBreakAssignInsideDoWhile.fir.kt index 98b61acb518..03a54081ba0 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/ifBreakAssignInsideDoWhile.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/ifBreakAssignInsideDoWhile.fir.kt @@ -10,5 +10,5 @@ public fun foo(x: String?): Int { } while (bar()) y.hashCode() // x is null because of the break - return x.length + return x.length } diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/ifBreakAssignInsideWhileTrue.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/ifBreakAssignInsideWhileTrue.fir.kt index ec66a50a872..39c51610e2c 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/ifBreakAssignInsideWhileTrue.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/ifBreakAssignInsideWhileTrue.fir.kt @@ -6,5 +6,5 @@ public fun foo(x: String?): Int { // In future we can infer this initialization y.hashCode() // x is null because of the break - return x.length + return x.length } diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/ifBreakExprInsideWhileTrue.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/ifBreakExprInsideWhileTrue.fir.kt index 8234f7efc5a..1540c954cf6 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/ifBreakExprInsideWhileTrue.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/ifBreakExprInsideWhileTrue.fir.kt @@ -6,5 +6,5 @@ public fun foo(x: String?): Int { y.length } // x is null because of the break - return x.length + return x.length } diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/leftElvisBreakInsideWhileTrue.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/leftElvisBreakInsideWhileTrue.fir.kt index 9b7d6777452..e7e1e9e1731 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/leftElvisBreakInsideWhileTrue.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/leftElvisBreakInsideWhileTrue.fir.kt @@ -7,5 +7,5 @@ public fun foo(x: String?, y: String?): Int { y.length } // y is null because of the break - return y.length + return y.length } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/nestedLoopsWithLongBreak.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/nestedLoopsWithLongBreak.fir.kt index de8e7ba820a..4a5f10d0dc9 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/nestedLoopsWithLongBreak.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/nestedLoopsWithLongBreak.fir.kt @@ -13,7 +13,7 @@ public fun foo(p: String?, r: String?, q: String?): Int { if (!x(p)) break } // Long break allows r == null - r.length + r.length // Smart cast is possible q.length return p.length diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/plusAssignWhenInsideDoWhile.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/plusAssignWhenInsideDoWhile.fir.kt index 47c7213a4ff..29f7fd721fe 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/plusAssignWhenInsideDoWhile.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/plusAssignWhenInsideDoWhile.fir.kt @@ -18,5 +18,5 @@ public fun foo(x: String?): Int { // y is always Int even here checkSubtype(y) // x is null because of the break - return x.length + return x.length } diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/whenInsideWhileTrue.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/whenInsideWhileTrue.fir.kt index ce14ee4a22e..4a2ea8d5de4 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/whenInsideWhileTrue.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/whenInsideWhileTrue.fir.kt @@ -8,5 +8,5 @@ public fun foo(x: String?): Int { } } // x is null because of the break - return x.length + return x.length } diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/whileNullWithBreak.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/whileNullWithBreak.fir.kt deleted file mode 100644 index 6eaa9dce0c5..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/whileNullWithBreak.fir.kt +++ /dev/null @@ -1,9 +0,0 @@ -fun bar(): Boolean { return true } - -fun foo(s: String?): Int { - while (s==null) { - if (bar()) break - } - // Call is unsafe due to break - return s.length -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/whileNullWithBreak.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/whileNullWithBreak.kt index 156e85dcf9b..97882971faa 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/whileNullWithBreak.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/whileNullWithBreak.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun bar(): Boolean { return true } fun foo(s: String?): Int { diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/whileSimple.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/whileSimple.fir.kt deleted file mode 100644 index 292c3289fc8..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/whileSimple.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -fun x(): Boolean { return true } - -public fun foo(p: String?): Int { - while(x()) { - p!!.length - if (x()) break - } - // p is nullable because it's possible loop body is not executed at all - return p.length -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/whileSimple.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/whileSimple.kt index a0c7777ef01..6d3f8951a25 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/whileSimple.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/whileSimple.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun x(): Boolean { return true } public fun foo(p: String?): Int { diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/whileTrivial.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/whileTrivial.fir.kt deleted file mode 100644 index a8e4f6eaaa4..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/whileTrivial.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -fun x(): Boolean { return true } - -public fun foo(p: String?): Int { - // Like whileTrue but 2 == 2 is in use - while(2 == 2) { - p!!.length - if (x()) break - } - // Smart cast should not work in this case, see KT-6284 - return p.length -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/whileTrivial.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/whileTrivial.kt index dc7d8aeae2b..87ac7643d51 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/whileTrivial.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/whileTrivial.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun x(): Boolean { return true } public fun foo(p: String?): Int { diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/whileTrueBreakReturn.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/whileTrueBreakReturn.fir.kt index f17eb58eed8..ff719629287 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/whileTrueBreakReturn.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/whileTrueBreakReturn.fir.kt @@ -8,5 +8,5 @@ public fun foo(p: String?): Int { p.length } // p can be null because break is earlier than return - return p.length + return p.length } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/whileTrueEarlyBreak.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/whileTrueEarlyBreak.fir.kt deleted file mode 100644 index 13bf41a0571..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/whileTrueEarlyBreak.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -fun x(): Boolean { return true } - -public fun foo(p: String?): Int { - while(true) { - if (x()) break - // We do not always reach this statement - p!!.length - } - // Here we have while (true) loop but p is nullable due to break before - return p.length -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/whileTrueEarlyBreak.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/whileTrueEarlyBreak.kt index 3a9b8232955..33e76cdf465 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/whileTrueEarlyBreak.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/whileTrueEarlyBreak.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun x(): Boolean { return true } public fun foo(p: String?): Int { diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/whileWithAssertInConditionAndBreakAfter.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/whileWithAssertInConditionAndBreakAfter.fir.kt index bd00cf67aa3..304eee4bd4f 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/whileWithAssertInConditionAndBreakAfter.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/whileWithAssertInConditionAndBreakAfter.fir.kt @@ -8,7 +8,7 @@ fun foo() { } // TODO: this testdata fixates undesired behavior (it should be an unsafe call) - x.length // 'x' is unsoundly smartcasted here + x.length // 'x' is unsoundly smartcasted here } fun bar() { @@ -19,5 +19,5 @@ fun bar() { } // TODO: this testdata fixates undesired behavior (it should be an unsafe call) - x.size // 'x' is unsoundly smartcasted here + x.size // 'x' is unsoundly smartcasted here } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/loops/whileWithAssertInConditionAndBreakBefore.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/loops/whileWithAssertInConditionAndBreakBefore.fir.kt index bc203cb2564..f324ac77928 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/loops/whileWithAssertInConditionAndBreakBefore.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/loops/whileWithAssertInConditionAndBreakBefore.fir.kt @@ -7,7 +7,7 @@ fun foo() { break } - x.length // 'x' is unsoundly smartcasted here + x.length // 'x' is unsoundly smartcasted here } fun bar() { @@ -17,5 +17,5 @@ fun bar() { break } - x.size // 'x' is unsoundly smartcasted here + x.size // 'x' is unsoundly smartcasted here } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/objectLiterals/kt7110.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/objectLiterals/kt7110.fir.kt index a7c686d1143..5f824e2341b 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/objectLiterals/kt7110.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/objectLiterals/kt7110.fir.kt @@ -7,5 +7,5 @@ abstract class A(val s: String) { fun foo(o: String?): Int { val a = object : A(o!!){} a.bar() - return o.length + return o.length } diff --git a/compiler/testData/diagnostics/tests/smartCasts/openInSealed.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/openInSealed.fir.kt index bdd8e40e512..e8928c7d8f1 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/openInSealed.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/openInSealed.fir.kt @@ -2,7 +2,7 @@ sealed class My(open val x: Int?) { init { if (x != null) { // Should be error: property is open - x.hashCode() + x.hashCode() } } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/ownerDeclaresBothModifies.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/ownerDeclaresBothModifies.fir.kt index 220b5a5acdb..a51ccd9e472 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/ownerDeclaresBothModifies.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/ownerDeclaresBothModifies.fir.kt @@ -9,5 +9,5 @@ fun foo(arg: Int?) { } if (x != null) x = 42 // Unsafe because of lambda - x.hashCode() + x.hashCode() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/publicVals/customGetter.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/publicVals/customGetter.fir.kt index 3283419eeea..6cbdc76ca22 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/publicVals/customGetter.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/publicVals/customGetter.fir.kt @@ -5,7 +5,7 @@ public class X { public fun fn(): Int { if (y != null) // With non-default getter smartcast is not possible - return y.length + return y.length else return 0 } diff --git a/compiler/testData/diagnostics/tests/smartCasts/publicVals/var.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/publicVals/var.fir.kt index 8b43b66f59c..8b8e840c20a 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/publicVals/var.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/publicVals/var.fir.kt @@ -4,10 +4,10 @@ public class X { public fun fn(): Int { if (x != null) // Smartcast is not possible for variable properties - return x.length + return x.length else if (y != null) // Even if they are private - return y.length + return y.length else return 0 } diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/argument.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/argument.fir.kt index a09a86e9b36..0e78b7fcbc0 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/argument.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/argument.fir.kt @@ -2,5 +2,5 @@ fun calc(x: List?): Int { // After KT-5840 fix !! assertion should become unnecessary here x?.get(x!!.size - 1) // x?. or x!! above should not provide smart cast here - return x.size + return x.size } diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/chainMixedUnsafe.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/chainMixedUnsafe.fir.kt index 626a304de1b..3cfad929905 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/chainMixedUnsafe.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/chainMixedUnsafe.fir.kt @@ -1,5 +1,5 @@ fun calc(x: List?): Int { // x is not-null only inside subList - x?.subList(0, x.size - 1).get(x.size) + x?.subList(0, x.size - 1).get(x.size) return x!!.size } diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/doubleCall.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/doubleCall.fir.kt index 6e579a9c4ed..544417a42a3 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/doubleCall.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/doubleCall.fir.kt @@ -2,5 +2,5 @@ fun calc(x: List?): Int { // x should be non-null in arguments list, including inner call x?.get(x.get(x.size - 1).length) // but not also here! - return x.size + return x.size } diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/innerReceiver.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/innerReceiver.fir.kt index b8eb112e3b9..86be7d57101 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/innerReceiver.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/innerReceiver.fir.kt @@ -4,5 +4,5 @@ fun calc(x: String?, y: String?): Int { // Smart cast because of y!! in receiver x?.subSequence(y!!.subSequence(0, 1).length, y.length) // No smart cast possible - return y.length + return y.length } diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/insideIfExpr.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/insideIfExpr.fir.kt deleted file mode 100644 index f48d7247887..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/insideIfExpr.fir.kt +++ /dev/null @@ -1,43 +0,0 @@ -// See KT-11007: Wrong smart cast to not-null type after safe calls in if / when expression - -val String.copy: String - get() = this - -fun foo() { - val s: String? = null - val ss = if (true) { - s?.length - } else { - s?.length - } - ss.hashCode() // Smart-cast to Int, should be unsafe call - val sss = if (true) { - s?.copy - } - else { - s?.copy - } - sss.length -} - -class My { - val String.copy2: String - get() = this - - fun foo() { - val s: String? = null - val ss = if (true) { - s?.length - } else { - s?.length - } - ss.hashCode() - val sss = if (true) { - s?.copy2 - } - else { - s?.copy2 - } - sss.length - } -} diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/insideIfExpr.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/insideIfExpr.kt index d588ecf52fe..c33faf712f4 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/insideIfExpr.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/insideIfExpr.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // See KT-11007: Wrong smart cast to not-null type after safe calls in if / when expression val String.copy: String diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiver.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiver.fir.kt deleted file mode 100644 index 89fa1a6820f..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiver.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -// See KT-10056 -class Foo(val bar: String) - -fun test(foo: Foo?) { - foo?.bar.let { - // Error, foo?.bar is nullable - it.length - // Error, foo is nullable - foo.bar.length - // Correct - foo?.bar?.length - } -} diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiver.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiver.kt index 647485c1a2c..016bff46fe1 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiver.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiver.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // See KT-10056 class Foo(val bar: String) diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverInLongChain.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverInLongChain.fir.kt index eac3fe6a690..9ecefd65b5b 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverInLongChain.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverInLongChain.fir.kt @@ -11,22 +11,22 @@ fun String.notNullLet(f: (String) -> Unit) = f(this) fun test(foo: Foo?) { foo?.bar?.gav.let { // Error, foo?.bar?.gav is nullable - it.length + it.length // Error, foo is nullable - foo.bar.gav.length + foo.bar.gav.length // Correct foo?.bar?.gav?.length } foo?.bar?.gav.call { it }?.notNullLet { - foo.hashCode() - foo.bar.hashCode() + foo.hashCode() + foo.bar.hashCode() } } fun testNotNull(foo: Foo) { val s: String? = "" foo.baz(s!!)?.gav.let { - it.length + it.length // Ok because of foo. s.length.hashCode() } @@ -35,7 +35,7 @@ fun testNotNull(foo: Foo) { fun testNullable(foo: Foo?) { val s: String? = "" foo?.baz(s!!)?.gav.let { - it.length + it.length // Ok because of foo?. s?.length?.hashCode() } diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverWithFlexible.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverWithFlexible.fir.kt deleted file mode 100644 index 6c6b3d7b15e..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverWithFlexible.fir.kt +++ /dev/null @@ -1,25 +0,0 @@ -// FILE: Foo.java -public class Foo { - public String bar; - - private Foo(String bar) { - this.bar = bar; - } - - public static Foo create(String bar) { - return new Foo(bar); - } -} - -// FILE: Test.kt -fun test() { - val foo = Foo.create(null) - foo?.bar.let { - // Error, foo?.bar is nullable - it.length - // Foo is nullable but flexible, so call is considered safe here - foo.bar.length - // Correct - foo?.bar?.length - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverWithFlexible.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverWithFlexible.kt index 4935db0141e..090d64852d7 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverWithFlexible.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverWithFlexible.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: Foo.java public class Foo { public String bar; diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/safeAccessReceiverNotNull.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/safeAccessReceiverNotNull.fir.kt index 0aba569f424..35f672f1bd2 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/safeAccessReceiverNotNull.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/safeAccessReceiverNotNull.fir.kt @@ -18,7 +18,7 @@ fun kt6840_2(s: String?) { fun kt1635(s: String?) { s?.hashCode()!! - s.hashCode() + s.hashCode() } fun kt2127() { @@ -80,7 +80,7 @@ fun useA(a: A): Int = a.hashCode() fun kt7491_2() { val a = getA() - (a?.let { useA(a) } ?: a.y ).toString() + (a?.let { useA(a) } ?: a.y ).toString() } fun String.correct() = true @@ -88,7 +88,7 @@ fun String.correct() = true fun kt8492(s: String?) { if (s?.correct() ?: false) { // To be supported - s.length + s.length } } @@ -118,7 +118,7 @@ class Wrapper { fun falsePositive(w: Wrapper) { if (w.unwrap() != null) { // Here we should NOT have smart cast - w.unwrap().length + w.unwrap().length } } diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/simple.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/simple.fir.kt index f46376751e0..291021474ab 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/simple.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/simple.fir.kt @@ -2,5 +2,5 @@ fun calc(x: List?): Int { // x should be non-null in arguments list x?.get(x.size - 1) // but not also here! - return x.size + return x.size } diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/twoArgs.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/twoArgs.fir.kt index 0a7578ac04c..92db14d822a 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/twoArgs.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/twoArgs.fir.kt @@ -2,5 +2,5 @@ fun calc(x: List?): Int { // x should be non-null in arguments list x?.subList(x.size - 1, x.size) // but not also here! - return x.size + return x.size } diff --git a/compiler/testData/diagnostics/tests/smartCasts/smartCastOnWhen.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/smartCastOnWhen.fir.kt index 956fddab24d..7a4517c38a5 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/smartCastOnWhen.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/smartCastOnWhen.fir.kt @@ -15,6 +15,6 @@ fun bar(): Int { return when(ss) { "abc" -> ss else -> "xyz" - }.length + }.length } diff --git a/compiler/testData/diagnostics/tests/smartCasts/smartcastOnSameFieldOfDifferentInstances.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/smartcastOnSameFieldOfDifferentInstances.fir.kt deleted file mode 100644 index 5d103f9d0d6..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/smartcastOnSameFieldOfDifferentInstances.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_EXPRESSION -// See KT-27260 - -class A(val x: String?) { - fun foo(other: A) { - when { - x == null && other.x == null -> "1" - x.length > 0 -> "2" - } - } -} diff --git a/compiler/testData/diagnostics/tests/smartCasts/smartcastOnSameFieldOfDifferentInstances.kt b/compiler/testData/diagnostics/tests/smartCasts/smartcastOnSameFieldOfDifferentInstances.kt index b28bd82c100..cf397f1798a 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/smartcastOnSameFieldOfDifferentInstances.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/smartcastOnSameFieldOfDifferentInstances.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_EXPRESSION // See KT-27260 diff --git a/compiler/testData/diagnostics/tests/smartCasts/unstableToStable.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/unstableToStable.fir.kt index ac6ba703d48..472d38cca3b 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/unstableToStable.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/unstableToStable.fir.kt @@ -3,15 +3,15 @@ class Foo(var x: Int?) { if (x != null) { val y = x // Error: x is not stable, Type(y) = Int? - x.hashCode() - y.hashCode() + x.hashCode() + y.hashCode() if (y == x) { // Still error - y.hashCode() + y.hashCode() } if (x == null && y != x) { // Still error - y.hashCode() + y.hashCode() } } } diff --git a/compiler/testData/diagnostics/tests/smartCasts/variables/lambdaBetweenArguments.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/variables/lambdaBetweenArguments.fir.kt index fe3bf6d9c91..1c423e36f0d 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/variables/lambdaBetweenArguments.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/variables/lambdaBetweenArguments.fir.kt @@ -6,5 +6,5 @@ fun foo(x: Int, f: () -> Unit, y: Int) {} fun bar() { var x: Int? x = 4 - foo(x, { x = null; x.hashCode() }, x) + foo(x, { x = null; x.hashCode() }, x) } diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/assignment.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/assignment.fir.kt index 8ec130dfe67..bf4e3e6e11e 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/assignment.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/assignment.fir.kt @@ -1,11 +1,11 @@ // !WITH_NEW_INFERENCE fun foo() { var v: String? = null - v.length + v.length v = "abc" v.length v = null - v.length + v.length v = "abc" v.length } diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/boundInitializerWrong.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/boundInitializerWrong.fir.kt index 0c7204ecaa3..07ee21341b6 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/boundInitializerWrong.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/boundInitializerWrong.fir.kt @@ -23,7 +23,7 @@ fun bar(s: String?) { val hashCode = ss?.hashCode() ss = null if (hashCode != null) { - ss.hashCode() + ss.hashCode() } } @@ -41,6 +41,6 @@ fun baz(arg: Some?) { val ss = arg?.s if (ss != null) { arg.hashCode() - arg.s.hashCode() + arg.s.hashCode() } } diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/initInTryReturnInCatch.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/initInTryReturnInCatch.fir.kt index 8d988515094..6885f08f2de 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/initInTryReturnInCatch.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/initInTryReturnInCatch.fir.kt @@ -37,7 +37,7 @@ fun test3() { catch (e: B) { return } - a.hashCode() // a is nullable here + a.hashCode() // a is nullable here } fun test4() { var a: Int? = null @@ -50,7 +50,7 @@ fun test4() { catch (e: B) { return } - a.hashCode() // a is nullable here + a.hashCode() // a is nullable here } fun test5() { var a: Int?// = null @@ -76,5 +76,5 @@ fun test6() { finally { a = null } - a.hashCode() // a is null here + a.hashCode() // a is null here } diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/initialization.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/initialization.fir.kt index e2f610bd2ea..0b14f9a664a 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/initialization.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/initialization.fir.kt @@ -2,7 +2,7 @@ fun foo() { var v: String? = "xyz" // It is possible in principle to provide smart cast here - v.length + v.length v = null - v.length + v.length } diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/nestedWhile.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/nestedWhile.fir.kt index 2e72334ca0b..53cdd54a5e3 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/nestedWhile.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/nestedWhile.fir.kt @@ -12,7 +12,7 @@ fun foo(): Bar { var y: Bar? = Bar() while (x != null) { // Here call is unsafe because of initialization and also inner loop - y.next() + y.next() while (y != null) { if (x == y) // x is not null because of outer while diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNullableIncrement.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNullableIncrement.fir.kt deleted file mode 100644 index 596ca003a75..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNullableIncrement.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -operator fun Int?.inc(): Int? { return this } - -public fun box(arg: Int?) : Int? { - var i : Int? = arg - var j = i++ - j.toInt() - return i -} diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNullableIncrement.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNullableIncrement.kt index 452815a072d..7aaa63c9b65 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNullableIncrement.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/postfixNullableIncrement.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL operator fun Int?.inc(): Int? { return this } public fun box(arg: Int?) : Int? { diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNullableClassIncrement.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNullableClassIncrement.fir.kt deleted file mode 100644 index 1a85571d761..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNullableClassIncrement.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -class MyClass - -// Correct at compile time but wrong at run-time -operator fun MyClass?.inc(): MyClass? { return null } - -public fun box() { - var i : MyClass? - i = MyClass() - // type of j should be MyClass? - var j = ++i - // j is null so call should be unsafe - j.hashCode() -} diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNullableClassIncrement.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNullableClassIncrement.kt index ed45c89bd94..b6f51d75cd6 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNullableClassIncrement.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNullableClassIncrement.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class MyClass // Correct at compile time but wrong at run-time diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNullableIncrement.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNullableIncrement.fir.kt deleted file mode 100644 index 9288f78fe11..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNullableIncrement.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -operator fun Int?.inc(): Int? { return this } - -public fun box(arg: Int?) : Int? { - var i = arg - var j = ++i - j.toInt() - return ++j -} diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNullableIncrement.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNullableIncrement.kt index 21b83aab131..fe55de23b34 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNullableIncrement.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/prefixNullableIncrement.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL operator fun Int?.inc(): Int? { return this } public fun box(arg: Int?) : Int? { diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNotNullInTry.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNotNullInTry.fir.kt deleted file mode 100644 index 55e0426d009..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNotNullInTry.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -// !LANGUAGE: +SoundSmartCastsAfterTry - -fun bar(arg: Any?) = arg - -fun foo() { - var s: String? - s = null - try { - s = "Test" - } catch (ex: Exception) {} - bar(s) - if (s != null) { } - s.hashCode() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNotNullInTry.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNotNullInTry.kt index 5cabdad83b5..52b65bd4b48 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNotNullInTry.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNotNullInTry.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +SoundSmartCastsAfterTry fun bar(arg: Any?) = arg diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNullInTry.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNullInTry.fir.kt deleted file mode 100644 index 07519649c8c..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNullInTry.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -// !LANGUAGE: +SoundSmartCastsAfterTry - -fun foo() { - var s: String? - s = "Test" - try { - s = null - } catch (ex: Exception) {} - s.hashCode() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNullInTry.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNullInTry.kt index 48f791d2f26..9d7e6105dd7 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNullInTry.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNullInTry.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +SoundSmartCastsAfterTry fun foo() { diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNullInTryFinally.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNullInTryFinally.fir.kt deleted file mode 100644 index 52ed2372cd6..00000000000 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNullInTryFinally.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// !LANGUAGE: +SoundSmartCastsAfterTry - -fun bar() {} - -fun foo() { - var s: String? - s = "Test" - try { - s = null - } - catch (ex: Exception) {} - finally { - bar() - } - s.hashCode() -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNullInTryFinally.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNullInTryFinally.kt index 108b479a032..3c6b160ac90 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNullInTryFinally.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNullInTryFinally.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +SoundSmartCastsAfterTry fun bar() {} diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNullInTryUnsound.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNullInTryUnsound.fir.kt index faa6fb418dd..f5822f0adb9 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNullInTryUnsound.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/setNullInTryUnsound.fir.kt @@ -6,5 +6,5 @@ fun foo() { try { s = null } catch (ex: Exception) {} - s.hashCode() + s.hashCode() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/varNull.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/varNull.fir.kt index 050f108d5fc..73fbbe41bbd 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/varNull.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/varNull.fir.kt @@ -2,5 +2,5 @@ fun foo(): Int { var s: String? = "abc" s = null - return s.length + return s.length } diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/TypeAnnotation.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/TypeAnnotation.fir.kt deleted file mode 100644 index d939f5286e1..00000000000 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/TypeAnnotation.fir.kt +++ /dev/null @@ -1,13 +0,0 @@ -// FILE: KotlinFile.kt -fun foo(javaClass: JavaClass) { - javaClass.getSomething().length - javaClass.something.length -} - -// FILE: JavaClass.java -import org.jetbrains.annotations.*; - -public class JavaClass { - @Nullable - public String getSomething() { return null; } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/TypeAnnotation.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/TypeAnnotation.kt index dfe10b33f48..af23b4eec37 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/TypeAnnotation.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/TypeAnnotation.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: KotlinFile.kt fun foo(javaClass: JavaClass) { javaClass.getSomething().length diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/ReturnTypeAnnotation.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/ReturnTypeAnnotation.fir.kt deleted file mode 100644 index 62dbadb3447..00000000000 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/ReturnTypeAnnotation.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -// FILE: KotlinFile.kt -fun foo(javaInterface: JavaInterface) { - val value = javaInterface.compute { "" } - value.length -} - -// FILE: JavaInterface.java -import org.jetbrains.annotations.*; - -public interface JavaInterface { - @Nullable - String compute(@NotNull Provider provider); -} - -// FILE: Provider.java -public interface Provider { - public T compute(); -} diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/ReturnTypeAnnotation.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/ReturnTypeAnnotation.kt index 1b2ae16b243..339a2552a67 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/ReturnTypeAnnotation.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/ReturnTypeAnnotation.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: KotlinFile.kt fun foo(javaInterface: JavaInterface) { val value = javaInterface.compute { "" } diff --git a/compiler/testData/diagnostics/tests/targetedBuiltIns/forEachRemainingNullability.fir.kt b/compiler/testData/diagnostics/tests/targetedBuiltIns/forEachRemainingNullability.fir.kt index 225842d3c4c..77dc6f828de 100644 --- a/compiler/testData/diagnostics/tests/targetedBuiltIns/forEachRemainingNullability.fir.kt +++ b/compiler/testData/diagnostics/tests/targetedBuiltIns/forEachRemainingNullability.fir.kt @@ -36,6 +36,6 @@ fun foo(x: Iterator, y: Iterator) { x.forEachRemaining { it -> it.length } x.forEachRemaining { it -> it?.length } - y.forEachRemaining { it -> it.length } + y.forEachRemaining { it -> it.length } y.forEachRemaining { it -> it?.length } } diff --git a/compiler/testData/diagnostics/tests/when/withSubjectVariable/capturingInInitializer.fir.kt b/compiler/testData/diagnostics/tests/when/withSubjectVariable/capturingInInitializer.fir.kt index ff3ca7cb0a5..2f683f0339d 100644 --- a/compiler/testData/diagnostics/tests/when/withSubjectVariable/capturingInInitializer.fir.kt +++ b/compiler/testData/diagnostics/tests/when/withSubjectVariable/capturingInInitializer.fir.kt @@ -27,11 +27,11 @@ fun testUnsafeCaptureVarInInitializer() { val s = when (val y = run { x = null; 32 }) { 0 -> { - x.inc() // NB smart cast should be impossible + x.inc() // NB smart cast should be impossible "0" } else -> "!= 0" } - x.inc() // NB smart cast should be impossible + x.inc() // NB smart cast should be impossible } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/when/withSubjectVariable/jumpoutInInitializer.fir.kt b/compiler/testData/diagnostics/tests/when/withSubjectVariable/jumpoutInInitializer.fir.kt index 22d8bec9894..e5605332055 100644 --- a/compiler/testData/diagnostics/tests/when/withSubjectVariable/jumpoutInInitializer.fir.kt +++ b/compiler/testData/diagnostics/tests/when/withSubjectVariable/jumpoutInInitializer.fir.kt @@ -12,7 +12,7 @@ fun testJumpOutInElvis(x: Int?) { x.inc() } - x.inc() + x.inc() } fun testJumpOutInElvisLikeIf(x: Int?) { @@ -24,7 +24,7 @@ fun testJumpOutInElvisLikeIf(x: Int?) { x.inc() } - x.inc() + x.inc() } @@ -36,7 +36,7 @@ fun testJumpOutInIf(x: Int?) { 0 -> "0" else -> "not 0" } - x.inc() + x.inc() } x.inc() // Actually, safe, but it's OK if it's error diff --git a/compiler/testData/diagnostics/tests/when/withSubjectVariable/smartCastOnValueBoundToSubjectVariable.fir.kt b/compiler/testData/diagnostics/tests/when/withSubjectVariable/smartCastOnValueBoundToSubjectVariable.fir.kt index c68e4f16a15..e9f408fbd5c 100644 --- a/compiler/testData/diagnostics/tests/when/withSubjectVariable/smartCastOnValueBoundToSubjectVariable.fir.kt +++ b/compiler/testData/diagnostics/tests/when/withSubjectVariable/smartCastOnValueBoundToSubjectVariable.fir.kt @@ -18,8 +18,8 @@ fun test2(x: String?) { fun test3(x: String?, y: String?) { when (val z = x ?: y!!) { - "foo" -> x.length - "bar" -> y.length + "foo" -> x.length + "bar" -> y.length "baz" -> z.length } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/fromStdlib/isNullOrBlank.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/fromStdlib/isNullOrBlank.fir.kt index 7d77791f6e6..b9ec0d859bc 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/fromStdlib/isNullOrBlank.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/fromStdlib/isNullOrBlank.fir.kt @@ -3,7 +3,7 @@ fun testIsNullOrBlank(x: String?) { if (x.isNullOrBlank()) { - x.length + x.length } else { x.length @@ -15,6 +15,6 @@ fun testIsNotNullOrBlank(x: String?) { x.length } - x.length + x.length } diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/fromStdlib/isNullOrEmpty.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/fromStdlib/isNullOrEmpty.fir.kt index 5b942185d8c..a3f8b51349c 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/fromStdlib/isNullOrEmpty.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/fromStdlib/isNullOrEmpty.fir.kt @@ -3,7 +3,7 @@ fun testIsNullOrEmpty(x: String?) { if (x.isNullOrEmpty()) { - x.length + x.length } else { x.length @@ -15,6 +15,6 @@ fun testIsNotNullOrEmpty(x: String?) { x.length } - x.length + x.length } diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/nullabilitySmartcastWhenNullability.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/nullabilitySmartcastWhenNullability.fir.kt index 4afb690ba1c..b155a85fe99 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/nullabilitySmartcastWhenNullability.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/nullabilitySmartcastWhenNullability.fir.kt @@ -14,7 +14,7 @@ fun nullWhenNull(x: Int?): Int? { fun testNullWhenNull(x: Int?) { if (nullWhenNull(x) == null) { - x.dec() + x.dec() } else { x.dec() @@ -24,10 +24,10 @@ fun testNullWhenNull(x: Int?) { x.dec() } else { - x.dec() + x.dec() } - x.dec() + x.dec() } // NB. it is the same function as `nullWhenNull`, but annotations specifies other facet of the function behaviour @@ -43,15 +43,15 @@ fun testNotNullWhenNotNull (x: Int?) { x == null } else { - x.dec() + x.dec() } if (notNullWhenNotNull(x) != null) { - x.dec() + x.dec() } else { x == null } - x.dec() + x.dec() } diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/operatorsTests/equalsOperator.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/operatorsTests/equalsOperator.fir.kt index cd49f2c178e..2d4b9aefc56 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/operatorsTests/equalsOperator.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/operatorsTests/equalsOperator.fir.kt @@ -20,28 +20,28 @@ fun myEqualsNotNull(x: Int?): Boolean { } fun testBasicEquals(x: Int?) { - x.inc() + x.inc() if (myEqualsNull(x)) { - x.inc() + x.inc() } else { x.inc() } - x.inc() + x.inc() } fun testBasicNotEquals(x: Int?) { - x.inc() + x.inc() if (myEqualsNotNull(x)) { x.inc() } else { - x.inc() + x.inc() } - x.inc() + x.inc() } diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/receiver.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/receiver.fir.kt index 31e6a20b5c8..e26d902954e 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/receiver.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/receiver.fir.kt @@ -14,7 +14,7 @@ fun Any?.isNull(): Boolean { fun smartcastOnReceiver(x: Int?) { if (x.isNull()) { - x.inc() + x.inc() } else { x.dec() @@ -26,10 +26,10 @@ class UnstableReceiver { fun smartcastOnUnstableReceiver() { if (x.isNull()) { - x.inc() + x.inc() } else { - x.dec() + x.dec() } } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/valueOfContractedFunctionIngored.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/valueOfContractedFunctionIngored.fir.kt index d4cd0aca299..cc764056435 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/valueOfContractedFunctionIngored.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/valueOfContractedFunctionIngored.fir.kt @@ -6,6 +6,6 @@ import kotlin.contracts.* fun f3(value: String?) { if (!value.isNullOrEmpty() is Boolean) { - value.length + value.length } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt36947.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt36947.fir.kt deleted file mode 100644 index 934c889f46f..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt36947.fir.kt +++ /dev/null @@ -1,6 +0,0 @@ -val foo = iterator { - yield(0) - val nullable: String? = null - nullable.length - nullable.get(2) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt36947.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt36947.kt index b4e2ed48a6e..800637930e3 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt36947.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt36947.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL val foo = iterator { yield(0) val nullable: String? = null diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/outerYield_1_3.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/outerYield_1_3.fir.kt index f03df720e81..61e34280411 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/outerYield_1_3.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/outerYield_1_3.fir.kt @@ -87,7 +87,7 @@ fun test() { this@with.yield("") yield2("") - this@with.yield2("") + this@with.yield2("") } } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/smartcasts/letChangesToNotNull.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/smartcasts/letChangesToNotNull.fir.kt deleted file mode 100644 index ca9ee064daa..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/smartcasts/letChangesToNotNull.fir.kt +++ /dev/null @@ -1,7 +0,0 @@ -// KT-9051: Allow smart cast for captured variables if they are not modified - -fun foo(y: String?) { - var x: String? = null - y?.let { x = it } - x.length // Smart cast is not possible -} diff --git a/compiler/testData/diagnostics/testsWithStdLib/smartcasts/letChangesToNotNull.kt b/compiler/testData/diagnostics/testsWithStdLib/smartcasts/letChangesToNotNull.kt index 4d1925cb2ff..f8351d3c9c1 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/smartcasts/letChangesToNotNull.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/smartcasts/letChangesToNotNull.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // KT-9051: Allow smart cast for captured variables if they are not modified fun foo(y: String?) { diff --git a/compiler/testData/diagnostics/testsWithStdLib/smartcasts/letChangesToNullComplex.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/smartcasts/letChangesToNullComplex.fir.kt index 71076c521c4..f2e8cb736fe 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/smartcasts/letChangesToNullComplex.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/smartcasts/letChangesToNullComplex.fir.kt @@ -5,7 +5,7 @@ fun bar(z: String?) = z fun foo(y: String?) { var x: String? = "" if (x != null) { - bar(y?.let { x = null; it }).length + bar(y?.let { x = null; it }).length x.length // Smart cast is not possible } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/smartcasts/withChangesToNull.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/smartcasts/withChangesToNull.fir.kt index 8e41c4cccbe..8de02b914d9 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/smartcasts/withChangesToNull.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/smartcasts/withChangesToNull.fir.kt @@ -2,7 +2,7 @@ fun foo(y: String?) { var x: String? = "" if (x != null) { with(y?.let { x = null; it }) { - this.length + this.length x.length } x.length diff --git a/compiler/testData/diagnostics/testsWithStdLib/tryCatch/assignTry.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/tryCatch/assignTry.fir.kt index 6198ffd2694..641f7d94e6d 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/tryCatch/assignTry.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/tryCatch/assignTry.fir.kt @@ -15,7 +15,7 @@ fun test2() { catch (e: ExcB) { 10 } - s.length + s.length } fun test3() { @@ -28,7 +28,7 @@ fun test3() { catch (e: ExcB) { return } - s.length + s.length } fun test4() { @@ -41,7 +41,7 @@ fun test4() { finally { "" } - s.length + s.length } fun test5() { @@ -54,7 +54,7 @@ fun test5() { finally { return } - s.length + s.length } fun test6() { @@ -67,7 +67,7 @@ fun test6() { catch (e: ExcB) { return } - s.length + s.length } fun test7() { @@ -80,7 +80,7 @@ fun test7() { catch (e: ExcB) { "" } - s.length + s.length } fun test8() { @@ -89,7 +89,7 @@ fun test8() { } catch (e: ExcA) { null } - s.length + s.length } fun test9() { diff --git a/compiler/testData/diagnostics/testsWithStdLib/tryCatch/boundedSmartcasts.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/tryCatch/boundedSmartcasts.fir.kt index 1e3d0b9beea..6f8a3939007 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/tryCatch/boundedSmartcasts.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/tryCatch/boundedSmartcasts.fir.kt @@ -13,11 +13,11 @@ fun test0(x: Int?) { if (x != null) { x.inc() - y.inc() + y.inc() } if (y != null) { - x.inc() + x.inc() y.inc() } } @@ -32,11 +32,11 @@ fun test1(x: Int?) { if (x != null) { x.inc() - y.inc() + y.inc() } if (y != null) { - x.inc() + x.inc() y.inc() } } @@ -51,11 +51,11 @@ fun test2(x: Int?) { if (x != null) { x.inc() - y.inc() + y.inc() } if (y != null) { - x.inc() + x.inc() y.inc() } } @@ -69,11 +69,11 @@ fun test3(x: Int?) { if (x != null) { x.inc() - y.inc() + y.inc() } if (y != null) { - x.inc() + x.inc() y.inc() } } @@ -91,11 +91,11 @@ fun test5(x: Int?) { if (x != null) { x.inc() - y.inc() + y.inc() } if (y != null) { - x.inc() + x.inc() y.inc() } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/tryCatch/correctSmartcasts.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/tryCatch/correctSmartcasts.fir.kt index e4d02ce214a..5e7436f0400 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/tryCatch/correctSmartcasts.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/tryCatch/correctSmartcasts.fir.kt @@ -15,8 +15,8 @@ fun test1(s: String?) { catch (e: Exception) { requireNotNull(s) } - t2.not() - s.length + t2.not() + s.length } } @@ -74,7 +74,7 @@ fun test5(s: String?) { catch (e: ExcB) { } - s.length + s.length } fun test6(s: String?) { diff --git a/compiler/testData/diagnostics/testsWithStdLib/tryCatch/correctSmartcasts_after.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/tryCatch/correctSmartcasts_after.fir.kt index 252ab90a563..5da0dd0a0d6 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/tryCatch/correctSmartcasts_after.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/tryCatch/correctSmartcasts_after.fir.kt @@ -16,8 +16,8 @@ fun test1(s: String?) { catch (e: Exception) { requireNotNull(s) } - t2.not() - s.length + t2.not() + s.length } } @@ -75,7 +75,7 @@ fun test5(s: String?) { catch (e: ExcB) { } - s.length + s.length } fun test6(s: String?) { diff --git a/compiler/testData/diagnostics/testsWithStdLib/tryCatch/falsePositiveSmartcasts.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/tryCatch/falsePositiveSmartcasts.fir.kt index 5d3b627ae11..7aa8bdbce75 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/tryCatch/falsePositiveSmartcasts.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/tryCatch/falsePositiveSmartcasts.fir.kt @@ -13,15 +13,15 @@ fun test1() { try { x = null } catch (e: Exception) { - x.length // smartcast shouldn't be allowed (OOME could happen after `x = null`) + x.length // smartcast shouldn't be allowed (OOME could happen after `x = null`) throw e } finally { // smartcast shouldn't be allowed, `x = null` could've happened - x.length + x.length } // smartcast shouldn't be allowed, `x = null` could've happened - x.length + x.length } // With old DFA of try/catch info about unsound smartcasts after try @@ -33,12 +33,12 @@ fun test2() { try { x = null } catch (e: Exception) { - x.length + x.length } finally { - x.length + x.length } - x.length + x.length } fun test3() { @@ -49,7 +49,7 @@ fun test3() { } catch (e: Exception) { t2 = null } - t2.not() // wrong smartcast, NPE + t2.not() // wrong smartcast, NPE } } @@ -59,7 +59,7 @@ fun test4() { try { t2 = null } finally { } - t2.not() // wrong smartcast, NPE + t2.not() // wrong smartcast, NPE } } @@ -80,10 +80,10 @@ fun test5() { } finally { s1.length - s2.length + s2.length } s1.length - s2.length + s2.length } fun test6(s1: String?, s2: String?) { @@ -97,10 +97,10 @@ fun test6(s1: String?, s2: String?) { return } finally { - s.length + s.length requireNotNull(s2) } - s.length - s1.length + s.length + s1.length s2.length -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/testsWithStdLib/tryCatch/falsePositiveSmartcasts_after.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/tryCatch/falsePositiveSmartcasts_after.fir.kt index 3458df14c11..7627cccf623 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/tryCatch/falsePositiveSmartcasts_after.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/tryCatch/falsePositiveSmartcasts_after.fir.kt @@ -14,15 +14,15 @@ fun test1() { try { x = null } catch (e: Exception) { - x.length // smartcast shouldn't be allowed (OOME could happen after `x = null`) + x.length // smartcast shouldn't be allowed (OOME could happen after `x = null`) throw e } finally { // smartcast shouldn't be allowed, `x = null` could've happened - x.length + x.length } // smartcast shouldn't be allowed, `x = null` could've happened - x.length + x.length } // With old DFA of try/catch info about unsound smartcasts after try @@ -35,12 +35,12 @@ fun test2() { x = null } catch (e: Exception) { // BAD - x.length + x.length } finally { - x.length + x.length } - x.length + x.length } fun test3() { @@ -51,7 +51,7 @@ fun test3() { } catch (e: Exception) { t2 = null } - t2.not() // wrong smartcast, NPE + t2.not() // wrong smartcast, NPE } } @@ -61,7 +61,7 @@ fun test4() { try { t2 = null } finally { } - t2.not() // wrong smartcast, NPE + t2.not() // wrong smartcast, NPE } } @@ -82,10 +82,10 @@ fun test5() { } finally { s1.length - s2.length + s2.length } s1.length - s2.length + s2.length } fun test6(s1: String?, s2: String?) { @@ -99,10 +99,10 @@ fun test6(s1: String?, s2: String?) { return } finally { - s.length + s.length requireNotNull(s2) } - s.length - s1.length + s.length + s1.length s2.length } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common/neg/1.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common/neg/1.fir.kt index c5adafadcdf..7e8619e31bd 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common/neg/1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common/neg/1.fir.kt @@ -46,7 +46,7 @@ fun case_1(value_1: Int?) { if (contracts.case_1(value_1) { value_2 = 10 }) { println(value_2) } else { - value_1.inv() + value_1.inv() println(value_2) } } @@ -58,8 +58,8 @@ fun case_2(value_1: Int?, value_2: Int?, value_3: Any?) { true -> { println(value_3?.xor(true)) println(value_4) - println(value_1.inv()) - println(value_2.inv()) + println(value_1.inv()) + println(value_2.inv()) } false -> { println(value_4) diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/1.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/1.fir.kt index 15ee30d4812..79675c1390b 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/1.fir.kt @@ -11,13 +11,13 @@ fun case_1(value_1: Any?) { // TESTCASE NUMBER: 2 fun case_2(value_1: Int?) { funWithReturnsAndInvertCondition(value_1 != null) - println(value_1.inc()) + println(value_1.inc()) } // TESTCASE NUMBER: 3 fun case_3(value_1: Int?) { funWithReturns(value_1 == null) - println(value_1.inc()) + println(value_1.inc()) } // TESTCASE NUMBER: 4 @@ -29,13 +29,13 @@ fun case_4(value_1: Any?) { // TESTCASE NUMBER: 5 fun case_5(value_1: String?) { funWithReturnsAndNullCheck(value_1) - println(value_1.length) + println(value_1.length) } // TESTCASE NUMBER: 6 fun case_6(value_1: String?) { funWithReturnsAndNullCheck(value_1) - println(value_1.length) + println(value_1.length) } // TESTCASE NUMBER: 7 @@ -44,7 +44,7 @@ object case_7_object { } fun case_7() { funWithReturns(case_7_object.prop_1 == null) - case_7_object.prop_1.inc() + case_7_object.prop_1.inc() } // TESTCASE NUMBER: 8 @@ -61,14 +61,14 @@ fun case_8(value_1: Any?) { // TESTCASE NUMBER: 9 fun case_9(value_1: String?) { - if (!funWithReturnsTrue(value_1 != null)) println(value_1.length) - if (!funWithReturnsTrueAndInvertCondition(value_1 == null)) println(value_1.length) - if (funWithReturnsFalse(value_1 != null)) println(value_1.length) - if (funWithReturnsFalseAndInvertCondition(value_1 == null)) println(value_1.length) - if (funWithReturnsNotNull(value_1 != null) == null) println(value_1.length) - if (funWithReturnsNotNullAndInvertCondition(value_1 == null) == null) println(value_1.length) - if (funWithReturnsNull(value_1 != null) != null) println(value_1.length) - if (funWithReturnsNullAndInvertCondition(value_1 == null) != null) println(value_1.length) + if (!funWithReturnsTrue(value_1 != null)) println(value_1.length) + if (!funWithReturnsTrueAndInvertCondition(value_1 == null)) println(value_1.length) + if (funWithReturnsFalse(value_1 != null)) println(value_1.length) + if (funWithReturnsFalseAndInvertCondition(value_1 == null)) println(value_1.length) + if (funWithReturnsNotNull(value_1 != null) == null) println(value_1.length) + if (funWithReturnsNotNullAndInvertCondition(value_1 == null) == null) println(value_1.length) + if (funWithReturnsNull(value_1 != null) != null) println(value_1.length) + if (funWithReturnsNullAndInvertCondition(value_1 == null) != null) println(value_1.length) } // TESTCASE NUMBER: 10 @@ -83,14 +83,14 @@ fun case_10(value_1: Any?) { // TESTCASE NUMBER: 11 fun case_11(value_1: Number?) { - if (!funWithReturnsTrueAndNotNullCheck(value_1)) println(value_1.toByte()) + if (!funWithReturnsTrueAndNotNullCheck(value_1)) println(value_1.toByte()) if (!funWithReturnsTrueAndNullCheck(value_1)) println(value_1) - if (funWithReturnsFalseAndNotNullCheck(value_1)) println(value_1.toByte()) + if (funWithReturnsFalseAndNotNullCheck(value_1)) println(value_1.toByte()) if (funWithReturnsFalseAndNullCheck(value_1)) println(value_1) - if ((funWithReturnsNotNullAndNotNullCheck(value_1) == null)) println(value_1.toByte()) - if (!!!(funWithReturnsNotNullAndNotNullCheck(value_1) != null)) println(value_1.toByte()) + if ((funWithReturnsNotNullAndNotNullCheck(value_1) == null)) println(value_1.toByte()) + if (!!!(funWithReturnsNotNullAndNotNullCheck(value_1) != null)) println(value_1.toByte()) if (!!(funWithReturnsNotNullAndNullCheck(value_1) == null)) println(value_1) - if (!(funWithReturnsNullAndNotNullCheck(value_1) == null)) println(value_1.toByte()) - if (!!(funWithReturnsNullAndNotNullCheck(value_1) != null)) println(value_1.toByte()) + if (!(funWithReturnsNullAndNotNullCheck(value_1) == null)) println(value_1.toByte()) + if (!!(funWithReturnsNullAndNotNullCheck(value_1) != null)) println(value_1.toByte()) if (!!!(funWithReturnsNullAndNullCheck(value_1) == null)) println(value_1) } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/10.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/10.fir.kt index f621ad1346d..b307dd1035e 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/10.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/10.fir.kt @@ -213,7 +213,7 @@ fun case_2(value_1: Any?) { // TESTCASE NUMBER: 3 fun case_3(number: Int?) { - if (!funWithReturnsTrueAndNullCheck(number)) number.inc() + if (!funWithReturnsTrueAndNullCheck(number)) number.inc() } // TESTCASE NUMBER: 4 @@ -250,8 +250,8 @@ fun case_8(value_1: Any?) { // TESTCASE NUMBER: 9 fun case_9(value_1: Number?) { - if (!funWithReturnsTrueAndNullCheck(value_1)) println(value_1.toByte()) - if (funWithReturnsFalseAndNullCheck(value_1)) println(value_1.toByte()) + if (!funWithReturnsTrueAndNullCheck(value_1)) println(value_1.toByte()) + if (funWithReturnsFalseAndNullCheck(value_1)) println(value_1.toByte()) if (funWithReturnsFalseAndNotNullCheck(value_1)) println(value_1) if (!(funWithReturnsNotNullAndNullCheck(value_1) != null)) println(value_1) if (!(funWithReturnsNullAndNullCheck(value_1) == null)) println(value_1) @@ -458,9 +458,9 @@ fun case_19(value_1: Number) { // TESTCASE NUMBER: 20 fun case_20(value_1: String?, value_2: String?, value_3: String?, value_4: String?) { if (!value_1.case_20_1()) println(value_1) - if (!value_2.case_20_2()) println(value_2.length) + if (!value_2.case_20_2()) println(value_2.length) when (value_3.case_20_3()) { - true -> println(value_4.length) + true -> println(value_4.length) false -> println(value_3) } } @@ -468,13 +468,13 @@ fun case_20(value_1: String?, value_2: String?, value_3: String?, value_4: Strin // TESTCASE NUMBER: 21 fun case_21(value_1: String?) { when { !value_1.case_21_1() -> println(value_1) } - when { !value_1.case_21_2() -> println(value_1.length) } + when { !value_1.case_21_2() -> println(value_1.length) } when { - value_1.case_21_5() == null -> println(value_1.length) + value_1.case_21_5() == null -> println(value_1.length) value_1.case_21_5() != null -> println(value_1) } when { - value_1.case_21_7() != null -> println(value_1.length) + value_1.case_21_7() != null -> println(value_1.length) value_1.case_21_7() == null -> println(value_1) } } @@ -505,19 +505,19 @@ fun case_25(value_1: Any?, value_2: Int?, value_3: Any?, value_4: Int?) { when { value_1.case_25_1(value_2) -> { println(value_1.length) - println(value_2.inv()) + println(value_2.inv()) } } when { value_3.case_25_2(value_4) == null -> { println(value_3.length) - println(value_4.inv()) + println(value_4.inv()) } } when { value_3.case_25_3(value_4) != null -> { println(value_3.length) - println(value_4.inv()) + println(value_4.inv()) } } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/15.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/15.fir.kt index 6241d48e330..43e98cfd178 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/15.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/15.fir.kt @@ -44,6 +44,6 @@ fun case_2(value: Any) { // TESTCASE NUMBER: 3 fun case_3(value: String?) { if (!value.isNullOrEmpty() is Boolean) { - value.length + value.length } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/4.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/4.fir.kt index 04eeb256a6f..b2bafefdab4 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/4.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/4.fir.kt @@ -152,7 +152,7 @@ fun case_2(value_1: Number) { // TESTCASE NUMBER: 3 fun case_3(value_1: String?, value_2: String?) { value_1.case_3_1() - println(value_1.length) + println(value_1.length) value_2.case_3_2() println(value_2) } @@ -160,7 +160,7 @@ fun case_3(value_1: String?, value_2: String?) { // TESTCASE NUMBER: 4 fun case_4(value_1: String?, value_2: String?) { value_1.case_4_1() - println(value_1.length) + println(value_1.length) value_2.case_4_2() println(value_2) } @@ -183,7 +183,7 @@ fun case_6(value_1: Number) { // TESTCASE NUMBER: 7 fun case_7(value_1: String?, value_2: String?) { - if (value_1.case_7_1()) println(value_1.length) + if (value_1.case_7_1()) println(value_1.length) if (value_2.case_7_2()) println(value_2) if (!(value_2.case_7_3() == null)) println(value_2) if (value_2.case_7_3() == null) println(value_2) @@ -191,7 +191,7 @@ fun case_7(value_1: String?, value_2: String?) { // TESTCASE NUMBER: 8 fun case_8(value_1: String?, value_2: String?) { - when { value_1.case_8_1() -> println(value_1.length) } + when { value_1.case_8_1() -> println(value_1.length) } when { value_2.case_8_2() -> println(value_2) } when { !(value_2.case_8_3() == null) -> println(value_2) } when { value_2.case_8_3() == null -> println(value_2) } @@ -199,13 +199,13 @@ fun case_8(value_1: String?, value_2: String?) { // TESTCASE NUMBER: 9 fun case_9(value_1: Number?) { - if (value_1?.case_9() == null) println(value_1.toByte()) + if (value_1?.case_9() == null) println(value_1.toByte()) } // TESTCASE NUMBER: 10 fun case_10(value_1: Number?) { if (value_1?.case_10() == null) { - println(value_1.toByte()) + println(value_1.toByte()) } else { println(value_1.toByte()) } @@ -217,13 +217,13 @@ fun case_10(value_1: Number?) { */ fun case_11(value_1: Number?, value_2: Number?) { if (value_1?.case_11_1() == null) { - println(value_1.toByte()) + println(value_1.toByte()) } else { println(value_1.toByte()) } if (value_2?.case_11_2() != null) { println(value_2.toByte()) } else { - println(value_2.toByte()) + println(value_2.toByte()) } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/6.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/6.fir.kt index 1e92240aca7..1e60fb25615 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/6.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/6.fir.kt @@ -111,7 +111,7 @@ import contracts.* fun case_1(value_1: Any?, value_2: Int?) { value_1.case_1(value_2) println(value_1.length) - println(value_2.inv()) + println(value_2.inv()) } // TESTCASE NUMBER: 2 @@ -125,7 +125,7 @@ fun case_2(value_1: Number?, value_2: Any?) { fun case_3(value_1: Any?, value_2: String?) { value_1.case_3(value_2) println(value_1.inv()) - println(value_2.length) + println(value_2.length) } // TESTCASE NUMBER: 4 @@ -133,7 +133,7 @@ fun case_4(value_1: Any?, value_2: Number, value_3: Any?, value_4: String?) { value_1.case_4(value_2, value_3, value_4) println(value_2.inv()) println(value_3.toByte()) - println(value_4.length) + println(value_4.length) } // TESTCASE NUMBER: 5 @@ -141,19 +141,19 @@ fun case_5(value_1: Any?, value_2: Int?, value_3: Any?, value_4: Int?, value_5: when { value_1.case_5_1(value_2) -> { println(value_1.length) - println(value_2.inv()) + println(value_2.inv()) } } when { !value_3.case_5_2(value_4) -> { println(value_3.length) - println(value_4.inv()) + println(value_4.inv()) } } when { value_5.case_5_3(value_6) != null -> { println(value_5.length) - println(value_6.inv()) + println(value_6.inv()) } } } @@ -182,19 +182,19 @@ fun case_6(value_1: Number?, value_2: Any?, value_3: Number?, value_4: Any?, val fun case_7(value_1: Any?, value_2: String?, value_3: Any?, value_4: String?, value_5: Any?, value_6: String?) { if (value_1.case_7_1(value_2)) { println(value_1.inv()) - println(value_2.length) + println(value_2.length) } if (value_3.case_7_2(value_4)) { println(value_3.inv()) - println(value_4.length) + println(value_4.length) } if (value_5.case_7_3(value_6) != null) { println(value_5.inv()) - println(value_6.length) + println(value_6.length) } if (value_5.case_7_4(value_6) == null) { println(value_5.inv()) - println(value_6.length) + println(value_6.length) } } @@ -202,14 +202,14 @@ fun case_7(value_1: Any?, value_2: String?, value_3: Any?, value_4: String?, val fun case_8(value_1: Any?, value_2: Number, value_3: Any?, value_4: String?) { when { value_1.case_8_1(value_2, value_3, value_4) -> println(value_2.inv()) } when { value_1.case_8_1(value_2, value_3, value_4) -> println(value_3.toByte()) } - when { value_1.case_8_1(value_2, value_3, value_4) -> println(value_4.length) } + when { value_1.case_8_1(value_2, value_3, value_4) -> println(value_4.length) } when { !value_1.case_8_2(value_2, value_3, value_4) -> println(value_2.inv()) } when { !value_1.case_8_2(value_2, value_3, value_4) -> println(value_3.toByte()) } - when { !value_1.case_8_2(value_2, value_3, value_4) -> println(value_4.length) } + when { !value_1.case_8_2(value_2, value_3, value_4) -> println(value_4.length) } when { value_1.case_8_3(value_2, value_3, value_4) == null -> println(value_2.inv()) } when { value_1.case_8_3(value_2, value_3, value_4) == null -> println(value_3.toByte()) } - when { value_1.case_8_3(value_2, value_3, value_4) == null -> println(value_4.length) } + when { value_1.case_8_3(value_2, value_3, value_4) == null -> println(value_4.length) } when { value_1.case_8_4(value_2, value_3, value_4) != null -> println(value_2.inv()) } when { value_1.case_8_4(value_2, value_3, value_4) != null -> println(value_3.toByte()) } - when { value_1.case_8_4(value_2, value_3, value_4) != null -> println(value_4.length) } + when { value_1.case_8_4(value_2, value_3, value_4) != null -> println(value_4.length) } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/7.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/7.fir.kt index b2153d58533..c69828fe00a 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/7.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/7.fir.kt @@ -210,7 +210,7 @@ import contracts.* // TESTCASE NUMBER: 1 fun case_1(value_1: Int?) { case_1_1(value_1) - value_1.inv() + value_1.inv() case_1_2(value_1) value_1.inv() case_1_1(value_1) @@ -220,7 +220,7 @@ fun case_1(value_1: Int?) { // TESTCASE NUMBER: 2 fun case_2(value_1: Number?) { case_2_1(value_1) - value_1.toByte() + value_1.toByte() case_2_2(value_1) value_1.inv() } @@ -246,7 +246,7 @@ fun case_4(value_1: Any?) { // TESTCASE NUMBER: 5 fun case_5(value_1: Int?) { if (case_5_1(value_1)) { - value_1.inv() + value_1.inv() if (case_5_2(value_1)) { value_1.inv() case_5_1(value_1) @@ -254,7 +254,7 @@ fun case_5(value_1: Int?) { } } if (!case_5_3(value_1)) { - value_1.inv() + value_1.inv() if (!case_5_4(value_1)) { value_1.inv() case_5_1(value_1) @@ -262,7 +262,7 @@ fun case_5(value_1: Int?) { } } if (case_5_5(value_1) != null) { - value_1.inv() + value_1.inv() if (case_5_6(value_1) != null) { value_1.inv() case_5_1(value_1) @@ -270,7 +270,7 @@ fun case_5(value_1: Int?) { } } if (case_5_7(value_1) == null) { - value_1.inv() + value_1.inv() if (case_5_8(value_1) == null) { value_1.inv() case_5_1(value_1) @@ -283,25 +283,25 @@ fun case_5(value_1: Int?) { fun case_6(value_1: Number?) { when { case_6_1(value_1) -> { - value_1.toByte() + value_1.toByte() when { case_6_2(value_1) -> value_1.inv() } } } when { !case_6_3(value_1) -> { - value_1.toByte() + value_1.toByte() when { !case_6_4(value_1) -> value_1.inv() } } } when { case_6_5(value_1) != null -> { - value_1.toByte() + value_1.toByte() when { case_6_6(value_1) != null -> value_1.inv() } } } when { case_6_7(value_1) == null -> { - value_1.toByte() + value_1.toByte() when { case_6_8(value_1) == null -> value_1.inv() } } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/8.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/8.fir.kt index 86c1ce2fec9..3e5cb46bcbf 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/8.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/8.fir.kt @@ -103,11 +103,11 @@ fun case_4(value_1: Number, value_2: (() -> Unit)?) { fun case_5(value_1: Number?, value_2: String?) { when (value_2.case_5(value_1)) { true -> { - println(value_2.length) + println(value_2.length) println(value_1.toByte()) } false -> { - println(value_2.length) + println(value_2.length) println(value_1.inv()) } } @@ -118,11 +118,11 @@ fun case_6(value_1: Number, value_2: String?, value_3: Any?) { when (value_3.case_6(value_1, value_2)) { true -> { println(value_3.equals("")) - println(value_2.length) + println(value_2.length) } false -> { println(value_3.length) - println(value_2.length) + println(value_2.length) } null -> { println(value_1.inv()) diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/9.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/9.fir.kt index ff2c8a47167..d8c134af56f 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/9.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/9.fir.kt @@ -4,25 +4,25 @@ // TESTCASE NUMBER: 1 fun case_1(arg: Int?) { funWithAtMostOnceCallsInPlace { arg!! } - arg.inc() + arg.inc() } // TESTCASE NUMBER: 2 fun case_2(arg: Int?) { funWithUnknownCallsInPlace { arg!! } - arg.inc() + arg.inc() } // TESTCASE NUMBER: 3 fun case_3() { val value_1: Boolean? funWithAtMostOnceCallsInPlace { value_1 = false } - value_1.not() + value_1.not() } // TESTCASE NUMBER: 4 fun case_4() { val value_1: Boolean? funWithUnknownCallsInPlace { value_1 = true } - value_1.not() + value_1.not() } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/12.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/12.fir.kt index 214075f51f4..f7cb961a66f 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/12.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/12.fir.kt @@ -10,7 +10,7 @@ fun case_1(arg: Int?) { // TESTCASE NUMBER: 2 fun case_2(arg: Int?) { funWithAtLeastOnceCallsInPlace { arg!! } - arg.inc() + arg.inc() } // TESTCASE NUMBER: 3 @@ -24,5 +24,5 @@ fun case_3() { fun case_4() { val value_1: Boolean? funWithAtLeastOnceCallsInPlace { value_1 = true } - value_1.not() + value_1.not() } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/14.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/14.fir.kt index b6f2561540f..898e0aa9c0d 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/14.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/14.fir.kt @@ -49,21 +49,21 @@ import contracts.* // TESTCASE NUMBER: 1 fun case_1(value_1: Int?) { if (contracts.case_1(value_1)!!) { - value_1.inv() + value_1.inv() } } // TESTCASE NUMBER: 2 fun case_2(value_1: Int?) { if (!contracts.case_2(value_1)!!) { - value_1.inv() + value_1.inv() } } // TESTCASE NUMBER: 3 fun case_3(value_1: Int?) { if (contracts.case_3(value_1)!!) { - value_1.inv() + value_1.inv() } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/6.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/6.fir.kt index 615f0914cd7..e34ca6410b2 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/6.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/6.fir.kt @@ -110,7 +110,7 @@ import contracts.* fun case_1(value_1: Any?, value_2: Int?) { value_1.case_1(value_2) println(value_1.length) - println(value_2.inv()) + println(value_2.inv()) } // TESTCASE NUMBER: 2 @@ -124,7 +124,7 @@ fun case_2(value_1: Number?, value_2: Any?) { fun case_3(value_1: Any?, value_2: String?) { value_1.case_3(value_2) println(value_1.inv()) - println(value_2.length) + println(value_2.length) } // TESTCASE NUMBER: 4 @@ -132,7 +132,7 @@ fun case_4(value_1: Any?, value_2: Number, value_3: Any?, value_4: String?) { value_1.case_4(value_2, value_3, value_4) println(value_2.inv()) println(value_3.toByte()) - println(value_4.length) + println(value_4.length) } // TESTCASE NUMBER: 5 @@ -140,25 +140,25 @@ fun case_5(value_1: Any?, value_2: Int?, value_3: Any?, value_4: Int?, value_5: when { value_1.case_5_1(value_2) -> { println(value_1.length) - println(value_2.inv()) + println(value_2.inv()) } } when { !value_3.case_5_2(value_4) -> { println(value_3.length) - println(value_4.inv()) + println(value_4.inv()) } } when { value_5.case_5_3(value_6) != null -> { println(value_5.length) - println(value_6.inv()) + println(value_6.inv()) } } when { value_5.case_5_4(value_6) == null -> { println(value_5.length) - println(value_6.inv()) + println(value_6.inv()) } } } @@ -187,19 +187,19 @@ fun case_6(value_1: Number?, value_2: Any?, value_3: Number?, value_4: Any?, val fun case_7(value_1: Any?, value_2: String?, value_3: Any?, value_4: String?, value_5: Any?, value_6: String?) { if (value_1.case_7_1(value_2)) { println(value_1.inv()) - println(value_2.length) + println(value_2.length) } if (value_3.case_7_2(value_4)) { println(value_3.inv()) - println(value_4.length) + println(value_4.length) } if (value_5.case_7_3(value_6) != null) { println(value_5.inv()) - println(value_6.length) + println(value_6.length) } if (value_5.case_7_4(value_6) == null) { println(value_5.inv()) - println(value_6.length) + println(value_6.length) } } @@ -207,14 +207,14 @@ fun case_7(value_1: Any?, value_2: String?, value_3: Any?, value_4: String?, val fun case_8(value_1: Any?, value_2: Number, value_3: Any?, value_4: String?, value_5: Any?, value_6: Number, value_7: Any?, value_8: String?) { when { value_1.case_8_1(value_2, value_3, value_4) -> println(value_2.inv()) } when { value_1.case_8_1(value_2, value_3, value_4) -> println(value_3.toByte()) } - when { value_1.case_8_1(value_2, value_3, value_4) -> println(value_4.length) } + when { value_1.case_8_1(value_2, value_3, value_4) -> println(value_4.length) } when { !value_5.case_8_2(value_6, value_7, value_8) -> println(value_6.inv()) } when { !value_5.case_8_2(value_6, value_7, value_8) -> println(value_7.toByte()) } - when { !value_5.case_8_2(value_6, value_7, value_8) -> println(value_8.length) } + when { !value_5.case_8_2(value_6, value_7, value_8) -> println(value_8.length) } when { value_5.case_8_3(value_6, value_7, value_8) != null -> println(value_6.inv()) } when { value_5.case_8_3(value_6, value_7, value_8) != null -> println(value_7.toByte()) } - when { value_5.case_8_3(value_6, value_7, value_8) != null -> println(value_8.length) } + when { value_5.case_8_3(value_6, value_7, value_8) != null -> println(value_8.length) } when { value_5.case_8_4(value_6, value_7, value_8) == null -> println(value_6.inv()) } when { value_5.case_8_4(value_6, value_7, value_8) == null -> println(value_7.toByte()) } - when { value_5.case_8_4(value_6, value_7, value_8) == null -> println(value_8.length) } + when { value_5.case_8_4(value_6, value_7, value_8) == null -> println(value_8.length) } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/8.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/8.fir.kt index f7efa9bf4b1..7266c75c17d 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/8.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/8.fir.kt @@ -111,7 +111,7 @@ fun case_5(value_1: Number?, value_2: String?) { println(value_1.toByte()) } false -> { - println(value_2.length) + println(value_2.length) println(value_1.inv()) } } @@ -130,7 +130,7 @@ fun case_6(value_1: Number, value_2: String?, value_3: Any?) { } false -> { println(value_3.length) - println(value_2.length) + println(value_2.length) } null -> { println(value_1.inv()) diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/1.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/1.fir.kt index 0a18e90197d..280bc9152a5 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/1.fir.kt @@ -6,13 +6,13 @@ fun case_1(x: Any?) { if (x != null is Boolean) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -23,13 +23,13 @@ fun case_3() { if (Object.prop_1 == null !== null) else { Object.prop_1 - Object.prop_1.equals(null) + Object.prop_1.equals(null) Object.prop_1.propT - Object.prop_1.propAny + Object.prop_1.propAny Object.prop_1.propNullableT Object.prop_1.propNullableAny Object.prop_1.funT() - Object.prop_1.funAny() + Object.prop_1.funAny() Object.prop_1.funNullableT() Object.prop_1.funNullableAny() } @@ -39,13 +39,13 @@ fun case_3() { fun case_4(x: Char?) { if (x != null || false is Boolean) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -56,13 +56,13 @@ fun case_5() { val x: Unit? = null if (x !== null is Boolean?) x - if (x !== null == null) x.equals(null) + if (x !== null == null) x.equals(null) if (x !== null == null) x.propT - if (x !== null == null) x.propAny + if (x !== null == null) x.propAny if (x !== null == null) x.propNullableT if (x !== null == null) x.propNullableAny if (x !== null == null) x.funT() - if (x !== null == null) x.funAny() + if (x !== null == null) x.funAny() if (x !== null == null) x.funNullableT() if (x !== null == null) x.funNullableAny() } @@ -73,13 +73,13 @@ fun case_6(x: EmptyClass?) { if ((x != null && !y) is Boolean) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -89,13 +89,13 @@ fun case_6(x: EmptyClass?) { fun case_7() { if (nullableNumberProperty != null || nullableNumberProperty != null is Boolean) { nullableNumberProperty - nullableNumberProperty.equals(null) + nullableNumberProperty.equals(null) nullableNumberProperty.propT - nullableNumberProperty.propAny + nullableNumberProperty.propAny nullableNumberProperty.propNullableT nullableNumberProperty.propNullableAny nullableNumberProperty.funT() - nullableNumberProperty.funAny() + nullableNumberProperty.funAny() nullableNumberProperty.funNullableT() nullableNumberProperty.funNullableAny() } @@ -113,7 +113,7 @@ fun case_9(x: TypealiasNullableString?) { } else if (false is Boolean) { x - x.get(0) + x.get(0) } } @@ -124,13 +124,13 @@ fun case_10() { if (a.prop_4 === null || true is Boolean) { if (a.prop_4 != null !== null) { a.prop_4 - a.prop_4.equals(null) + a.prop_4.equals(null) a.prop_4.propT - a.prop_4.propAny + a.prop_4.propAny a.prop_4.propNullableT a.prop_4.propNullableAny a.prop_4.funT() - a.prop_4.funAny() + a.prop_4.funAny() a.prop_4.funNullableT() a.prop_4.funNullableAny() } @@ -150,11 +150,11 @@ fun case_11(x: TypealiasNullableStringIndirect?, y: TypealiasNullableStringIndir x x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -270,13 +270,13 @@ val case_17 = if (nullableIntProperty == null == true == false) 0 else { fun case_18(a: DeepObject.A.B.C.D.E.F.G.J?) { if (a != null !== null) { a - a.equals(null) + a.equals(null) a.propT - a.propAny + a.propAny a.propNullableT a.propNullableAny a.funT() - a.funAny() + a.funAny() a.funNullableT() a.funNullableAny() } @@ -302,17 +302,17 @@ fun case_19(b: Boolean) { } } else null - if (a != null !is Boolean && a.B19 != null is Boolean && a.B19.C19 != null is Boolean && a.B19.C19.D19 != null == null && a.B19.C19.D19.x != null !== null) { - a.B19.C19.D19.x - a.B19.C19.D19.x.equals(null) - a.B19.C19.D19.x.propT - a.B19.C19.D19.x.propAny - a.B19.C19.D19.x.propNullableT - a.B19.C19.D19.x.propNullableAny - a.B19.C19.D19.x.funT() - a.B19.C19.D19.x.funAny() - a.B19.C19.D19.x.funNullableT() - a.B19.C19.D19.x.funNullableAny() + if (a != null !is Boolean && a.B19 != null is Boolean && a.B19.C19 != null is Boolean && a.B19.C19.D19 != null == null && a.B19.C19.D19.x != null !== null) { + a.B19.C19.D19.x + a.B19.C19.D19.x.equals(null) + a.B19.C19.D19.x.propT + a.B19.C19.D19.x.propAny + a.B19.C19.D19.x.propNullableT + a.B19.C19.D19.x.propNullableAny + a.B19.C19.D19.x.funT() + a.B19.C19.D19.x.funAny() + a.B19.C19.D19.x.funNullableT() + a.B19.C19.D19.x.funNullableAny() } } @@ -330,13 +330,13 @@ fun case_20(b: Boolean) { if (a.B19.C19.D19 !== null !is Boolean) { a.B19.C19.D19 - a.B19.C19.D19.equals(null) + a.B19.C19.D19.equals(null) a.B19.C19.D19.propT - a.B19.C19.D19.propAny + a.B19.C19.D19.propAny a.B19.C19.D19.propNullableT a.B19.C19.D19.propNullableAny a.B19.C19.D19.funT() - a.B19.C19.D19.funAny() + a.B19.C19.D19.funAny() a.B19.C19.D19.funNullableT() a.B19.C19.D19.funNullableAny() } @@ -346,13 +346,13 @@ fun case_20(b: Boolean) { fun case_21() { if (EnumClassWithNullableProperty.B.prop_1 !== null is Boolean == true !is Boolean != true) { EnumClassWithNullableProperty.B.prop_1 - EnumClassWithNullableProperty.B.prop_1.equals(null) + EnumClassWithNullableProperty.B.prop_1.equals(null) EnumClassWithNullableProperty.B.prop_1.propT - EnumClassWithNullableProperty.B.prop_1.propAny + EnumClassWithNullableProperty.B.prop_1.propAny EnumClassWithNullableProperty.B.prop_1.propNullableT EnumClassWithNullableProperty.B.prop_1.propNullableAny EnumClassWithNullableProperty.B.prop_1.funT() - EnumClassWithNullableProperty.B.prop_1.funAny() + EnumClassWithNullableProperty.B.prop_1.funAny() EnumClassWithNullableProperty.B.prop_1.funNullableT() EnumClassWithNullableProperty.B.prop_1.funNullableAny() } @@ -362,15 +362,15 @@ fun case_21() { fun case_22(a: (() -> Unit)?) { if (a != null !is Boolean) { a() - a().equals(null) - a().propT - a().propAny - a().propNullableT - a().propNullableAny - a().funT() - a().funAny() - a().funNullableT() - a().funNullableAny() + a().equals(null) + a().propT + a().propAny + a().propNullableT + a().propNullableAny + a().funT() + a().funAny() + a().funNullableT() + a().funNullableAny() } } @@ -398,13 +398,13 @@ fun case_24(a: ((() -> Unit) -> Unit)?, b: (() -> Unit)?) = if (a !== null is Boolean && b !== null !is Boolean) { a(?")!>b) a(b) - ?")!>b.equals(null) + ?")!>b.equals(null) ?")!>b.propT - ?")!>b.propAny + ?")!>b.propAny ?")!>b.propNullableT ?")!>b.propNullableAny ?")!>b.funT() - ?")!>b.funAny() + ?")!>b.funAny() ?")!>b.funNullableT() ?")!>b.funNullableAny() } else null @@ -443,13 +443,13 @@ fun case_26(a: ((Float) -> Int?)?, b: Float?) { val x = a(b) if (x != null == true === false) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -461,13 +461,13 @@ fun case_27() { if (Object.prop_1 == null == true == true == true == true == true == true == true == true == true == true == true == true == true == true is Boolean) else { Object.prop_1 - Object.prop_1.equals(null) + Object.prop_1.equals(null) Object.prop_1.propT - Object.prop_1.propAny + Object.prop_1.propAny Object.prop_1.propNullableT Object.prop_1.propNullableAny Object.prop_1.funT() - Object.prop_1.funAny() + Object.prop_1.funAny() Object.prop_1.funNullableT() Object.prop_1.funNullableAny() } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/11.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/11.fir.kt index 4ee80f19c8e..50ea24660e2 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/11.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/11.fir.kt @@ -26,7 +26,7 @@ fun case_3() { if (x is Boolean) { funWithAnyArg(try { x = null; true } catch (e: Exception) { false }) x - x.not() + x.not() } } @@ -36,7 +36,7 @@ fun case_4() { if (x != null) { false || when { else -> {x = null; true} } x - x.not() + x.not() } } @@ -58,7 +58,7 @@ fun case_6() { x as Boolean if (if (true) { x = null; true } else { false }) { x - x.not() + x.not() } } @@ -69,5 +69,5 @@ fun case_7() { if (if (true) { x = null; true } else { false }) {} x - x.not() + x.not() } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/12.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/12.fir.kt index 01ed2fc397b..ac6cd9a935d 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/12.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/12.fir.kt @@ -18,7 +18,7 @@ fun case_2() { } catch (e: Exception) { x = null } - x.not() + x.not() } } @@ -31,7 +31,7 @@ fun case_3() { } catch (e: Exception) { x = null } - x.not() + x.not() } } @@ -42,5 +42,5 @@ fun case_4() { try { x = null } finally { } - x.not() + x.not() } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/13.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/13.fir.kt index 6ef6de25fb7..48f60a6a8c8 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/13.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/13.fir.kt @@ -16,7 +16,7 @@ fun case_2() { x!! x(if (true) {x=null;0} else 0, x) x - x.fun_1() + x.fun_1() } // TESTCASE NUMBER: 3 @@ -25,5 +25,5 @@ fun case_3() { x!! val y = x[if (true) {x=null;0} else 0, x[0]] x - x.fun_1() + x.fun_1() } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/14.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/14.fir.kt index 6d4234beba6..79e1fcb4671 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/14.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/14.fir.kt @@ -6,7 +6,7 @@ fun case_1(x: Int?) { if ((x is Int) ?: (x is Int)) { x - x.inv() + x.inv() } } @@ -14,7 +14,7 @@ fun case_1(x: Int?) { fun case_2(x: Int?) { if (x?.equals(1) ?: x is Int) { x - x.inv() + x.inv() } } @@ -22,7 +22,7 @@ fun case_2(x: Int?) { fun case_3(x: Boolean?) { if (x ?: (x != null)) { x - x.not() + x.not() } } @@ -30,7 +30,7 @@ fun case_3(x: Boolean?) { fun case_4(x: Boolean?) { if (if (x != null) x else x != null) { x - x.not() + x.not() } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/15.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/15.fir.kt index b6b5c5a1f8e..83f18f2d875 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/15.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/15.fir.kt @@ -38,7 +38,7 @@ fun case_3() { if (x != null) { false || when { else -> { x = null; true} } x - x.not() + x.not() } } @@ -64,7 +64,7 @@ fun case_4() { fun case_5() { var x: Boolean? = true if (x != null) { - when { else -> { x = null; false} } || x.not() + when { else -> { x = null; false} } || x.not() } } @@ -88,7 +88,7 @@ fun case_6() { fun case_7() { var x: Boolean? = true if (x != null) { - (if (true) {x = null; null} else true) ?: x.not() + (if (true) {x = null; null} else true) ?: x.not() } } @@ -110,7 +110,7 @@ fun case_9() { if (x is Boolean) { funWithAnyArg(try { x = null; true } catch (e: Exception) { false }) x - x.not() + x.not() } } @@ -122,7 +122,7 @@ fun case_9() { fun case_10() { var x: Boolean? = true if (x is Boolean) { - select(if (true) {x = null;Class()} else Class()).prop_9 = x.not() + select(if (true) {x = null;Class()} else Class()).prop_9 = x.not() } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/19.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/19.fir.kt index bfd8574ab45..29281311324 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/19.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/19.fir.kt @@ -15,7 +15,7 @@ fun case_1(x: Boolean?) { } x - x.not() + x.not() } /* @@ -31,7 +31,7 @@ fun case_2(x: Boolean?) { } x - x.not() + x.not() } /* @@ -47,7 +47,7 @@ fun case_3(x: Boolean?) { } while (true) x - x.not() + x.not() } /* @@ -99,7 +99,7 @@ fun case_7(x: Boolean?) { } x - x.not() + x.not() } /* @@ -115,7 +115,7 @@ fun case_8(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 9 @@ -144,7 +144,7 @@ fun case_10(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 11 @@ -156,7 +156,7 @@ fun case_11(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 12 @@ -166,7 +166,7 @@ fun case_12(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 13 @@ -176,7 +176,7 @@ fun case_13(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 14 @@ -186,7 +186,7 @@ fun case_14(x: Boolean?) { } while (true) x - x.not() + x.not() } // TESTCASE NUMBER: 15 @@ -196,7 +196,7 @@ fun case_15(x: Boolean?) { } while (true) x - x.not() + x.not() } // TESTCASE NUMBER: 16 @@ -225,7 +225,7 @@ fun case_17(x: Boolean?) { } x - x.not() + x.not() } /* @@ -243,7 +243,7 @@ fun case_18(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 19 @@ -257,7 +257,7 @@ fun case_19(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 20 @@ -272,7 +272,7 @@ fun case_20(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 21 @@ -282,7 +282,7 @@ fun case_21(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 22 @@ -292,7 +292,7 @@ fun case_22(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 23 @@ -304,7 +304,7 @@ fun case_23(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 24 @@ -317,7 +317,7 @@ fun case_24(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 25 @@ -329,7 +329,7 @@ fun case_25(x: Boolean?) { } x - x.not() + x.not() } /* diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/20.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/20.fir.kt index 1fe7ee1eb71..44ea11ab5d3 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/20.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/20.fir.kt @@ -15,7 +15,7 @@ fun case_1(x: Boolean?) { } x - x.not() + x.not() } /* @@ -31,7 +31,7 @@ fun case_2(x: Boolean?) { } x - x.not() + x.not() } /* @@ -47,7 +47,7 @@ fun case_3(x: Boolean?) { } while (true) x - x.not() + x.not() } /* @@ -99,7 +99,7 @@ fun case_7(x: Boolean?) { } x - x.not() + x.not() } /* @@ -115,7 +115,7 @@ fun case_8(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 9 @@ -144,7 +144,7 @@ fun case_10(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 11 @@ -156,7 +156,7 @@ fun case_11(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 12 @@ -166,7 +166,7 @@ fun case_12(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 13 @@ -176,7 +176,7 @@ fun case_13(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 14 @@ -186,7 +186,7 @@ fun case_14(x: Boolean?) { } while (true) x - x.not() + x.not() } // TESTCASE NUMBER: 15 @@ -196,7 +196,7 @@ fun case_15(x: Boolean?) { } while (true) x - x.not() + x.not() } // TESTCASE NUMBER: 16 @@ -225,7 +225,7 @@ fun case_17(x: Boolean?) { } x - x.not() + x.not() } /* @@ -243,7 +243,7 @@ fun case_18(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 19 @@ -257,7 +257,7 @@ fun case_19(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 20 @@ -272,7 +272,7 @@ fun case_20(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 21 @@ -282,7 +282,7 @@ fun case_21(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 22 @@ -292,7 +292,7 @@ fun case_22(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 23 @@ -304,7 +304,7 @@ fun case_23(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 24 @@ -317,7 +317,7 @@ fun case_24(x: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 25 @@ -329,7 +329,7 @@ fun case_25(x: Boolean?) { } x - x.not() + x.not() } /* diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/21.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/21.fir.kt index 15eda2907a9..05f3312dcc5 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/21.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/21.fir.kt @@ -16,7 +16,7 @@ class Case1 { x this.x y.x - y.x.inv() + y.x.inv() } else { x = 10 } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/22.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/22.fir.kt index 5ebd0bf5fd1..71d43d415ad 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/22.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/22.fir.kt @@ -14,7 +14,7 @@ fun case_1(x: Boolean?, y: Boolean?) { } x - x.not() + x.not() } /* @@ -29,7 +29,7 @@ fun case_2(x: Boolean?, y: Boolean?) { } while (true) x - x.not() + x.not() } /* @@ -44,7 +44,7 @@ fun case_3(x: Boolean?, y: Boolean?) { } x - x.not() + x.not() } /* @@ -59,7 +59,7 @@ fun case_4(x: Boolean?, y: Boolean?) { } while (true) x - x.not() + x.not() } // TESTCASE NUMBER: 5 @@ -92,7 +92,7 @@ fun case_7(x: Boolean?, y: Boolean?) { } x - x.not() + x.not() } /* @@ -107,7 +107,7 @@ fun case_8(x: Boolean?, y: Boolean?) { } x - x.not() + x.not() } /* diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/23.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/23.fir.kt index 28e4a41a952..19ec9118af8 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/23.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/23.fir.kt @@ -61,7 +61,7 @@ inline fun case_6() { var x: T? = 10 as T if (x is K) { x = null - x.equals(10) + x.equals(10) x println(1) } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/24.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/24.fir.kt index 81536473ecf..9a5d4c663f4 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/24.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/24.fir.kt @@ -16,7 +16,7 @@ fun case_1() { x = null } x - x.not() + x.not() } } @@ -32,7 +32,7 @@ fun case_2() { x = null } finally { } x - x.not() + x.not() } } @@ -52,7 +52,7 @@ fun case_3(x: String?) { } } x - x.length + x.length } /* @@ -69,7 +69,7 @@ fun case_4(x: String?) { } } x - x.length + x.length } /* @@ -86,7 +86,7 @@ fun case_5(x: String?) { } } while (true) x - x.length + x.length } /* @@ -105,5 +105,5 @@ fun case_6(x: String?) { } } while (true) x - x.length + x.length } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/26.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/26.fir.kt index 08cad2f0ca1..4da5f9b1b57 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/26.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/26.fir.kt @@ -55,7 +55,7 @@ fun case_5() { var x: Class? = Class() x!! x(if (true) {x=null;0} else 0, x) - x.fun_1() + x.fun_1() } // TESTCASE NUMBER: 6 @@ -76,7 +76,7 @@ fun case_7() { var x: Class? = Class() x!! x(if (true) {x=null;0} else 0)(x) - x.fun_1() + x.fun_1() } // TESTCASE NUMBER: 8 diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/27.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/27.fir.kt index de66e6e0583..4f19703d7e7 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/27.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/27.fir.kt @@ -14,7 +14,7 @@ fun case_1(x: Boolean?, y: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 2 @@ -38,7 +38,7 @@ fun case_3(x: Boolean?, y: Boolean?) { } x - x.not() + x.not() } /* @@ -53,7 +53,7 @@ fun case_4(x: Boolean?, y: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 5 @@ -64,7 +64,7 @@ fun case_5(x: Boolean?, y: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 6 @@ -79,7 +79,7 @@ fun case_6(x: Boolean?, y: Boolean?) { } x - x.not() + x.not() } // TESTCASE NUMBER: 7 @@ -108,5 +108,5 @@ fun case_8(x: Boolean?, y: Boolean?) { } x - x.not() + x.not() } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/29.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/29.fir.kt index 7a6af78a908..1f32dd0cb51 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/29.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/29.fir.kt @@ -10,7 +10,7 @@ fun case_1(a: Any?) { } a - a.equals(10) + a.equals(10) } // TESTCASE NUMBER: 2 @@ -23,7 +23,7 @@ fun case_2(a: Any?) { })() a - a.equals(10) + a.equals(10) } // TESTCASE NUMBER: 3 @@ -36,7 +36,7 @@ fun case_3(a: Any?) { } a - a.equals(10) + a.equals(10) } // TESTCASE NUMBER: 4 @@ -49,7 +49,7 @@ fun case_4(a: Any?) { } a - a.equals(10) + a.equals(10) } /* @@ -65,7 +65,7 @@ fun case_5(a: Any?) { } a - a.equals(10) + a.equals(10) } /* @@ -81,7 +81,7 @@ fun case_6(a: Any?) { } a - a.equals(10) + a.equals(10) } /* @@ -97,7 +97,7 @@ fun case_7(a: Any?) { } a - a.equals(10) + a.equals(10) } // TESTCASE NUMBER: 8 @@ -112,5 +112,5 @@ fun case_8(a: Any?) { } a - a.equals(10) + a.equals(10) } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/30.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/30.fir.kt index 83a0c6a30f8..dbef0bc6f61 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/30.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/30.fir.kt @@ -30,8 +30,8 @@ class Case5(val y: Any?): ClassWithCostructorParam(y as Interface1), Interface1 // TESTCASE NUMBER: 6 fun case_6(a: Int?) = object : ClassWithCostructorParam(a!!) { - fun run() = a.toShort() + fun run() = a.toShort() init { - println(a.toShort()) + println(a.toShort()) } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/34.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/34.fir.kt index c2ae00182c8..eb64aabd76c 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/34.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/34.fir.kt @@ -14,7 +14,7 @@ fun case_1() { break } x - x.length + x.length } /* @@ -29,7 +29,7 @@ fun case_3() { break } x - x.length + x.length } /* @@ -44,7 +44,7 @@ fun case_4() { break } x - x.not() + x.not() } // TESTCASE NUMBER: 5 @@ -57,7 +57,7 @@ fun case_5() { break } x - x.not() + x.not() } // TESTCASE NUMBER: 6 @@ -65,12 +65,12 @@ fun case_6() { var x: Boolean? = true while (false && x!!) { x - x.not() + x.not() x = null break } x - x.not() + x.not() } // TESTCASE NUMBER: 7 @@ -78,12 +78,12 @@ fun case_7() { var x: Boolean? = true while (true || x!!) { x - x.not() + x.not() x = null break } x - x.not() + x.not() } // TESTCASE NUMBER: 8 @@ -91,12 +91,12 @@ fun case_8() { var x: Boolean? = true while (!(false && x!!)) { x - x.not() + x.not() x = null break } x - x.not() + x.not() } // TESTCASE NUMBER: 9 @@ -137,12 +137,12 @@ fun case_12() { var x: Boolean? = true do { x - x.not() + x.not() x = null break } while (true && x!!) x - x.not() + x.not() } // TESTCASE NUMBER: 13 @@ -150,12 +150,12 @@ fun case_13() { var x: Boolean? = true do { x - x.not() + x.not() x = null break } while (false && x!!) x - x.not() + x.not() } // TESTCASE NUMBER: 14 @@ -163,12 +163,12 @@ fun case_14() { var x: Boolean? = true do { x - x.not() + x.not() x = null break } while (true || x!!) x - x.not() + x.not() } // TESTCASE NUMBER: 15 @@ -176,12 +176,12 @@ fun case_15() { var x: Boolean? = true do { x - x.not() + x.not() x = null break } while (!(false && x!!)) x - x.not() + x.not() } /* @@ -195,7 +195,7 @@ fun case_16() { break } x - x.not() + x.not() } /* @@ -209,5 +209,5 @@ fun case_17() { break } x - x.not() + x.not() } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/35.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/35.fir.kt index 7c82b872312..74c65c8446c 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/35.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/35.fir.kt @@ -12,7 +12,7 @@ fun case_1() { x = "Test" println("${if (true) x = null else 1}") x - x.length + x.length } /* @@ -25,7 +25,7 @@ fun case_2() { x = "Test" println("${try { x = null } finally { }}") x - x.length + x.length } /* @@ -38,7 +38,7 @@ fun case_3() { x = "Test" println("${try { } finally { x = null }}") x - x.length + x.length } /* @@ -51,7 +51,7 @@ fun case_4() { x = "Test" println("${try { x = null } catch (e: Exception) { } finally { }}") x - x.length + x.length } /* @@ -64,7 +64,7 @@ fun case_5() { x = "Test" println("${try { } catch (e: Exception) { x = null } finally { }}") x - x.length + x.length } /* @@ -77,7 +77,7 @@ fun case_6() { x = "Test" println("${try { } catch (e: Exception) { } finally { x = null }}") x - x.length + x.length } /* @@ -90,7 +90,7 @@ fun case_7() { x = "Test" println("${try { x = null } catch (e: Exception) { }}") x - x.length + x.length } /* @@ -103,7 +103,7 @@ fun case_8() { x = "Test" println("${try { } catch (e: Exception) { x = null }}") x - x.length + x.length } /* @@ -116,5 +116,5 @@ fun case_9() { x = "Test" println("${when (null) { else -> x = null } }") x - x.length + x.length } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/37.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/37.fir.kt index ceaacb181be..14cb2e392c8 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/37.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/37.fir.kt @@ -13,7 +13,7 @@ fun case_1() { x x++ x - x.equals(10) + x.equals(10) } } @@ -28,7 +28,7 @@ fun case_2() { x x-- x - x.equals(10) + x.equals(10) } /* @@ -42,7 +42,7 @@ fun case_3() { x --x x - x.equals(10) + x.equals(10) } /* @@ -56,7 +56,7 @@ fun case_4() { x ++x x - x.equals(10) + x.equals(10) } // TESTCASE NUMBER: 5 @@ -66,7 +66,7 @@ fun case_5() { x x = x + x x - x.equals(10) + x.equals(10) } // TESTCASE NUMBER: 6 @@ -76,7 +76,7 @@ fun case_6() { x x = x - x x - x.equals(10) + x.equals(10) } } @@ -91,7 +91,7 @@ fun case_7() { x x += x x - x.equals(10) + x.equals(10) } /* @@ -105,5 +105,5 @@ fun case_8() { x x -= x x - x.equals(10) + x.equals(10) } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/38.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/38.fir.kt index a9ffdf256fe..c427c09fcf6 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/38.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/38.fir.kt @@ -16,7 +16,7 @@ fun case_1() { } } x - x.length + x.length } /* @@ -33,7 +33,7 @@ fun case_2() { } } x - x.length + x.length } /* @@ -50,7 +50,7 @@ fun case_3(y: Nothing?) { } } x - x.length + x.length } /* @@ -69,7 +69,7 @@ fun case_4(y: Nothing?) { } } x - x.length + x.length } // TESTCASE NUMBER: 5 @@ -82,7 +82,7 @@ fun case_5(y: Nothing?) { } } x - x.length + x.length } // TESTCASE NUMBER: 6 @@ -98,7 +98,7 @@ fun case_6(y: Nothing?) { break } x - x.length + x.length } /* @@ -115,7 +115,7 @@ fun case_7() { } while (x == null) } while (true) x - x.length + x.length } /* @@ -134,7 +134,7 @@ fun case_8(y: Nothing?) { } while (x === y) } while (true) x - x.length + x.length } // TESTCASE NUMBER: 9 @@ -146,7 +146,7 @@ fun case_9() { x = null } while (x != null) x - x.length + x.length } } @@ -159,7 +159,7 @@ fun case_10() { x = null } while (true) x - x.length + x.length } } @@ -173,6 +173,6 @@ fun case_11() { break } while (x == null) x - x.length + x.length } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/39.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/39.fir.kt index bba69fbb6fd..f994dc91d35 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/39.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/39.fir.kt @@ -13,7 +13,7 @@ fun case_1() { println(x ?: break) } x - x.length + x.length } /* @@ -27,7 +27,7 @@ fun case_2(y: MutableList) { y[x ?: break] = 10 } x - x.inv() + x.inv() } /* @@ -41,7 +41,7 @@ fun case_3(y: MutableList) { y[0] = x ?: break } x - x.inv() + x.inv() } // TESTCASE NUMBER: 4 @@ -51,7 +51,7 @@ fun case_4() { x ?: break } x - x.inv() + x.inv() } // TESTCASE NUMBER: 5 @@ -61,7 +61,7 @@ fun case_5(y: Boolean) { y && (x ?: break) } x - x.not() + x.not() } // TESTCASE NUMBER: 6 @@ -71,7 +71,7 @@ fun case_6(y: Boolean) { y || (x ?: break) } x - x.not() + x.not() } // TESTCASE NUMBER: 7 @@ -81,7 +81,7 @@ fun case_7(y: Boolean?) { y ?: x ?: break } x - x.not() + x.not() } /* @@ -96,7 +96,7 @@ fun case_8() { y += x ?: break } x - x.inv() + x.inv() } /* @@ -111,7 +111,7 @@ fun case_9() { y -= x ?: break } x - x.inv() + x.inv() } /* @@ -126,7 +126,7 @@ fun case_10() { val z = y - (x ?: break) } x - x.inv() + x.inv() } /* @@ -141,7 +141,7 @@ fun case_11() { val z = y * (x ?: break) } x - x.inv() + x.inv() } // TESTCASE NUMBER: 12 @@ -152,7 +152,7 @@ fun case_12() { y += if (x == null) break else 10 } x - x.inv() + x.inv() } // TESTCASE NUMBER: 13 diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/4.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/4.fir.kt index c21d640524a..5857d42bc0e 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/4.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/4.fir.kt @@ -8,8 +8,8 @@ fun case_1(x: Any?) { x x.inv() x.not() - x.propAny - x.funAny() + x.propAny + x.funAny() } } @@ -19,8 +19,8 @@ fun case_2(x: Any?) { x x.inv() x.not() - x.propAny - x.funAny() + x.propAny + x.funAny() } } @@ -29,8 +29,8 @@ inline fun case_3(x: Any?) { if (x is Int is T) { x x.inv() - x.propAny - x.funAny() + x.propAny + x.funAny() } } @@ -39,8 +39,8 @@ inline fun case_4(x: Any?) { if (x is Int is T == null) { x x.inv() - x.propAny - x.funAny() + x.propAny + x.funAny() } } @@ -49,8 +49,8 @@ fun case_5(x: Any?) { if (x is Int != null) { x x.inv() - x.propAny - x.funAny() + x.propAny + x.funAny() } } @@ -59,8 +59,8 @@ fun case_6(x: Any?) { if (x is Int == null) { x x.inv() - x.propAny - x.funAny() + x.propAny + x.funAny() } } @@ -69,8 +69,8 @@ fun case_7(x: Any?) { if (!(x !is Int) == false) { x x.inv() - x.propAny - x.funAny() + x.propAny + x.funAny() } } @@ -79,8 +79,8 @@ fun case_8(x: Any?) { if (!(x !is Int) == true) else { x x.inv() - x.propAny - x.funAny() + x.propAny + x.funAny() } } @@ -89,8 +89,8 @@ fun case_9(x: Any?) { if (x !is Int !is Any?) { x x.inv() - x.propAny - x.funAny() + x.propAny + x.funAny() } } @@ -98,8 +98,8 @@ fun case_9(x: Any?) { inline fun case_10(x: Any?) { if (x is T is K is L) { x - x.propAny - x.funAny() + x.propAny + x.funAny() } } @@ -107,8 +107,8 @@ inline fun case_10(x: Any?) { inline fun case_11(x: Any?) { if (x is Int !is K !is T !is L) { x - x.propAny - x.funAny() + x.propAny + x.funAny() } } @@ -116,8 +116,8 @@ inline fun case_11(x: Any?) { inline fun case_12(x: Any?) { if (x !is K !is T !is L) { x - x.propAny - x.funAny() + x.propAny + x.funAny() } } @@ -125,8 +125,8 @@ inline fun case_12(x: Any?) { inline fun case_13(x: Any?) { if (!(x !is K !is T !is L)) { x - x.propAny - x.funAny() + x.propAny + x.funAny() } } @@ -134,8 +134,8 @@ inline fun case_13(x: Any?) { inline fun case_14(x: Any?) { if (!(x !is T is Boolean)) { x - x.propAny - x.funAny() + x.propAny + x.funAny() } } @@ -143,8 +143,8 @@ inline fun case_14(x: Any?) { inline fun case_15(x: Any?) { if (!(x !is T) is Boolean) { x - x.propAny - x.funAny() + x.propAny + x.funAny() } } @@ -152,8 +152,8 @@ inline fun case_15(x: Any?) { inline fun case_16(x: Any?) { if (((x is K) is T) is L) { x - x.propAny - x.funAny() + x.propAny + x.funAny() } } @@ -161,8 +161,8 @@ inline fun case_16(x: Any?) { inline fun case_17(x: Any?) { if (x is T is T) { x - x.propAny - x.funAny() + x.propAny + x.funAny() } } @@ -170,8 +170,8 @@ inline fun case_17(x: Any?) { inline fun case_18(x: Any?) { if (x !is T is T) { x - x.propAny - x.funAny() + x.propAny + x.funAny() } } @@ -179,7 +179,7 @@ inline fun case_18(x: Any?) { inline fun case_19(x: Any?) { if (x is T !is T) { x - x.propAny - x.funAny() + x.propAny + x.funAny() } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/41.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/41.fir.kt index a3e18e78507..d2fa24869ce 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/41.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/41.fir.kt @@ -38,11 +38,11 @@ inline fun case_3(x: Any?) { is T? -> return else -> { x - x.equals(10) + x.equals(10) } } x - x.equals(10) + x.equals(10) } // TESTCASE NUMBER: 4 @@ -51,11 +51,11 @@ inline fun case_4(x: Any?) { is T -> return else -> { x - x.equals(10) + x.equals(10) } } x - x.equals(10) + x.equals(10) } // TESTCASE NUMBER: 5 @@ -72,7 +72,7 @@ inline fun case_5(x: Any?) { inline fun case_6(x: Any?) { if (x is T?) return x - x.equals(10) + x.equals(10) } // TESTCASE NUMBER: 7 diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/43.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/43.fir.kt index 213579890a6..1b2f19114f8 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/43.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/43.fir.kt @@ -27,7 +27,7 @@ fun case_2(x: Boolean?, y: Any?) { if (x == false) return if (y != x) { y - y.equals(10) + y.equals(10) } } @@ -39,7 +39,7 @@ fun case_3(x : Unit?, y : Any?) { if (x == kotlin.Unit) return if (y != x) { y - y.equals(10) + y.equals(10) } } @@ -51,7 +51,7 @@ fun case_4(x : EnumClassSingle?, y : Any?) { if (x == EnumClassSingle.EVERYTHING) return if (y != x) { y - y.equals(10) + y.equals(10) } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/45.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/45.fir.kt index 90152bf3f53..ab7a6254b79 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/45.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/45.fir.kt @@ -9,7 +9,7 @@ fun case_1(x: Number?): Long? { if (x is Long?) return x x - return x.toLong() + return x.toLong() } /* diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/6.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/6.fir.kt index 35387be3f9a..3e56c9a480a 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/6.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/6.fir.kt @@ -105,7 +105,7 @@ inline fun case_12(x: Any?) { if (x !is T) { if (x is T is K) { x - x.equals(10) + x.equals(10) } } } @@ -115,7 +115,7 @@ inline fun case_13(x: Any?) { if (x !is T) { if (x !is K) { x - x.equals(10) + x.equals(10) } } } @@ -125,7 +125,7 @@ inline fun case_14(x: Any?) { if (x is K) else { if (x !is T) { x - x.equals(10) + x.equals(10) } } } @@ -135,7 +135,7 @@ inline fun case_15(x: Any?) { if (x !is T) { if (x is K) else { x - x.equals(10) + x.equals(10) } } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/7.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/7.fir.kt index 6d4234beba6..79e1fcb4671 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/7.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/7.fir.kt @@ -6,7 +6,7 @@ fun case_1(x: Int?) { if ((x is Int) ?: (x is Int)) { x - x.inv() + x.inv() } } @@ -14,7 +14,7 @@ fun case_1(x: Int?) { fun case_2(x: Int?) { if (x?.equals(1) ?: x is Int) { x - x.inv() + x.inv() } } @@ -22,7 +22,7 @@ fun case_2(x: Int?) { fun case_3(x: Boolean?) { if (x ?: (x != null)) { x - x.not() + x.not() } } @@ -30,7 +30,7 @@ fun case_3(x: Boolean?) { fun case_4(x: Boolean?) { if (if (x != null) x else x != null) { x - x.not() + x.not() } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/8.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/8.fir.kt index 16badd42e67..487cce29809 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/8.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/8.fir.kt @@ -7,9 +7,9 @@ fun case_1(x: Class?) { if (x?.fun_4()?.fun_4()?.fun_4()?.fun_4() != null) { x x.fun_4() - x.fun_4().fun_4() - x.fun_4().fun_4().fun_4() - x.fun_4().fun_4().fun_4().fun_4() + x.fun_4().fun_4() + x.fun_4().fun_4().fun_4() + x.fun_4().fun_4().fun_4().fun_4() } } @@ -18,7 +18,7 @@ fun case_2(x: Class?) { if (x?.fun_4()?.prop_8 != null) { x x.fun_4() - x.fun_4().prop_8 + x.fun_4().prop_8 } } @@ -27,7 +27,7 @@ fun case_3(x: Class?) { if (x?.prop_8?.fun_4() != null) { x x.prop_8 - x.prop_8.fun_4().prop_8 + x.prop_8.fun_4().prop_8 } } @@ -35,7 +35,7 @@ fun case_3(x: Class?) { fun case_4(x: Class?) { if (x?.prop_8.also { } != null) { x - x.prop_8 - x.prop_8.fun_4() + x.prop_8 + x.prop_8.fun_4() } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/9.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/9.fir.kt index 61dded58f92..1ef6103365a 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/9.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/9.fir.kt @@ -10,7 +10,7 @@ fun case_1(x: T?, y: K?) { x.equals(10) z - z.equals(10) + z.equals(10) } // TESTCASE NUMBER: 1 diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/13.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/13.fir.kt index 6907969c88f..e26b99a1e6c 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/13.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/13.fir.kt @@ -10,11 +10,11 @@ fun case_1(x: T) { x x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() x.apply { equals(null) } @@ -28,11 +28,11 @@ fun case_1(x: T) { x.apply { funNullableAny(); x.equals(null) } x.also { it.equals(null) } x.also { it.propT } - x.also { it.propAny } + x.also { it.propAny } x.also { it.propNullableT } x.also { it.propNullableAny } x.also { it.funT() } - x.also { it.funAny() } + x.also { it.funAny() } x.also { it.funNullableT() } x.also { it.funNullableAny() } } @@ -42,13 +42,13 @@ fun case_1(x: T) { fun case_2(x: T?, y: Nothing?) { if (y != x) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() x.apply { equals(null) } @@ -59,14 +59,14 @@ fun case_2(x: T?, y: Nothing?) { x.apply { funT() } x.apply { funAny() } x.apply { funNullableT() } - x.apply { funNullableAny(); x.equals(null) } - x.also { it.equals(null) } + x.apply { funNullableAny(); x.equals(null) } + x.also { it.equals(null) } x.also { it.propT } - x.also { it.propAny } + x.also { it.propAny } x.also { it.propNullableT } x.also { it.propNullableAny } x.also { it.funT() } - x.also { it.funAny() } + x.also { it.funAny() } x.also { it.funNullableT() } x.also { it.funNullableAny() } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/16.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/16.fir.kt index 447f74470d2..09d9d05c8b6 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/16.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/16.fir.kt @@ -50,13 +50,13 @@ fun case_4(x: Number?) { fun case_5(x: Char?, y: Nothing?) { if (x != y) else return x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -65,13 +65,13 @@ fun case_5(x: Char?, y: Nothing?) { fun case_6(x: Object?) { if (x !== implicitNullableNothingProperty) else { return } x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -80,13 +80,13 @@ fun case_6(x: Object?) { fun case_7(x: Class?) { if (x === implicitNullableNothingProperty || false || false || false) { return } x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -95,7 +95,7 @@ fun case_7(x: Class?) { fun case_8(x: Int?) { if (false || false || false || x == nullableNothingProperty) return x - x.inv() + x.inv() } // TESTCASE NUMBER: 9 @@ -104,11 +104,11 @@ fun case_9(x: String?) { x x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -192,13 +192,13 @@ fun case_14(x: MutableCollection?) { fun case_15(x: MutableCollection?, y: Nothing?) { if (x != y) else return ?")!>x - ?")!>x.equals(null) + ?")!>x.equals(null) ?")!>x.propT - ?")!>x.propAny + ?")!>x.propAny ?")!>x.propNullableT ?")!>x.propNullableAny ?")!>x.funT() - ?")!>x.funAny() + ?")!>x.funAny() ?")!>x.funNullableT() ?")!>x.funNullableAny() } @@ -207,13 +207,13 @@ fun case_15(x: MutableCollection?, y: Nothing?) { fun case_16(x: Collection>>>>>>?) { if (x !== implicitNullableNothingProperty) else { return } >>>>>>?")!>x - >>>>>>?")!>x.equals(null) + >>>>>>?")!>x.equals(null) >>>>>>?")!>x.propT - >>>>>>?")!>x.propAny + >>>>>>?")!>x.propAny >>>>>>?")!>x.propNullableT >>>>>>?")!>x.propNullableAny >>>>>>?")!>x.funT() - >>>>>>?")!>x.funAny() + >>>>>>?")!>x.funAny() >>>>>>?")!>x.funNullableT() >>>>>>?")!>x.funNullableAny() } @@ -222,13 +222,13 @@ fun case_16(x: Collection?) { if (x === implicitNullableNothingProperty || false) { return } ?")!>x - ?")!>x.equals(null) + ?")!>x.equals(null) ?")!>x.propT - ?")!>x.propAny + ?")!>x.propAny ?")!>x.propNullableT ?")!>x.propNullableAny ?")!>x.funT() - ?")!>x.funAny() + ?")!>x.funAny() ?")!>x.funNullableT() ?")!>x.funNullableAny() } @@ -237,13 +237,13 @@ fun case_17(x: MutableMap<*, *>?) { fun case_18(x: MutableMap?) { if (false || false || false || x == nullableNothingProperty) return ?")!>x - ?")!>x.equals(null) + ?")!>x.equals(null) ?")!>x.propT - ?")!>x.propAny + ?")!>x.propAny ?")!>x.propNullableT ?")!>x.propNullableAny ?")!>x.funT() - ?")!>x.funAny() + ?")!>x.funAny() ?")!>x.funNullableT() ?")!>x.funNullableAny() } @@ -319,13 +319,13 @@ fun case_23(x: Inv?) { fun case_24(x: Inv?, y: Nothing?) { if (x !== y && true) else return ?")!>x - ?")!>x.equals(null) + ?")!>x.equals(null) ?")!>x.propT - ?")!>x.propAny + ?")!>x.propAny ?")!>x.propNullableT ?")!>x.propNullableAny ?")!>x.funT() - ?")!>x.funAny() + ?")!>x.funAny() ?")!>x.funNullableT() ?")!>x.funNullableAny() } @@ -384,13 +384,13 @@ fun case_28(x: Number?) { fun case_29(x: Char?, y: Nothing?) = l@ { if (x != y) else return@l x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -400,13 +400,13 @@ fun case_30(x: Object?): Any { return (l@ { if (x !== implicitNullableNothingProperty) else { return@l } x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() })() @@ -417,13 +417,13 @@ fun case_31(x: Class?): Any { return l@ { if (x === implicitNullableNothingProperty || false || false || false) { return@l } x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -434,13 +434,13 @@ fun case_32(x: Any?) { case_32((l@ { if (false || false || false || x == nullableNothingProperty) return@l x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() })()) @@ -451,13 +451,13 @@ fun case_33(x: Any?) { case_33(l@ { if (x != implicitNullableNothingProperty && true && true && true) else { return@l } x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() }) @@ -567,13 +567,13 @@ fun case_39(x: MutableCollection?, y: Nothing?) { (l2@ { if (x != y) else return@l2 ?")!>x - ?")!>x.equals(null) + ?")!>x.equals(null) ?")!>x.propT - ?")!>x.propAny + ?")!>x.propAny ?")!>x.propNullableT ?")!>x.propNullableAny ?")!>x.funT() - ?")!>x.funAny() + ?")!>x.funAny() ?")!>x.funNullableT() ?")!>x.funNullableAny() })() @@ -584,13 +584,13 @@ fun case_40(x: Collection>>>>>>?")!>x - >>>>>>?")!>x.equals(null) + >>>>>>?")!>x.equals(null) >>>>>>?")!>x.propT - >>>>>>?")!>x.propAny + >>>>>>?")!>x.propAny >>>>>>?")!>x.propNullableT >>>>>>?")!>x.propNullableAny >>>>>>?")!>x.funT() - >>>>>>?")!>x.funAny() + >>>>>>?")!>x.funAny() >>>>>>?")!>x.funNullableT() >>>>>>?")!>x.funNullableAny() })() @@ -601,13 +601,13 @@ fun case_41(x: MutableMap<*, *>?) { listOf(l@ { if (x === implicitNullableNothingProperty || false) { return@l } ?")!>x - ?")!>x.equals(null) + ?")!>x.equals(null) ?")!>x.propT - ?")!>x.propAny + ?")!>x.propAny ?")!>x.propNullableT ?")!>x.propNullableAny ?")!>x.funT() - ?")!>x.funAny() + ?")!>x.funAny() ?")!>x.funNullableT() ?")!>x.funNullableAny() }) @@ -618,13 +618,13 @@ fun case_42(x: MutableMap?) { return (l@ { if (false || false || false || x == nullableNothingProperty) return@l ?")!>x - ?")!>x.equals(null) + ?")!>x.equals(null) ?")!>x.propT - ?")!>x.propAny + ?")!>x.propAny ?")!>x.propNullableT ?")!>x.propNullableAny ?")!>x.funT() - ?")!>x.funAny() + ?")!>x.funAny() ?")!>x.funNullableT() ?")!>x.funNullableAny() })() @@ -712,13 +712,13 @@ fun case_48(x: Inv?, y: Nothing?) { val y = ((((l@ { if (x !== y && true) else return@l ?")!>x - ?")!>x.equals(null) + ?")!>x.equals(null) ?")!>x.propT - ?")!>x.propAny + ?")!>x.propAny ?")!>x.propNullableT ?")!>x.propNullableAny ?")!>x.funT() - ?")!>x.funAny() + ?")!>x.funAny() ?")!>x.funNullableT() ?")!>x.funNullableAny() })))) diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/17.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/17.fir.kt index 462d5c8da62..51074a4fb91 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/17.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/17.fir.kt @@ -49,13 +49,13 @@ fun case_4(x: Number?) { fun case_5(x: Char?, y: Nothing?) { if (x != y) else throw Exception() x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -64,13 +64,13 @@ fun case_5(x: Char?, y: Nothing?) { fun case_6(x: Object?) { if (x !== implicitNullableNothingProperty) else { throw Exception() } x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -79,13 +79,13 @@ fun case_6(x: Object?) { fun case_7(x: Class?) { if (x === implicitNullableNothingProperty || false || false || false) { throw Exception() } x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -94,7 +94,7 @@ fun case_7(x: Class?) { fun case_8(x: Int?) { if (false || false || false || x == nullableNothingProperty) throw Exception() x - x.inv() + x.inv() } // TESTCASE NUMBER: 9 @@ -103,11 +103,11 @@ fun case_9(x: String?) { x x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -191,13 +191,13 @@ fun case_14(x: MutableCollection?) { fun case_15(x: MutableCollection?, y: Nothing?) { if (x != y) else throw Exception() ?")!>x - ?")!>x.equals(null) + ?")!>x.equals(null) ?")!>x.propT - ?")!>x.propAny + ?")!>x.propAny ?")!>x.propNullableT ?")!>x.propNullableAny ?")!>x.funT() - ?")!>x.funAny() + ?")!>x.funAny() ?")!>x.funNullableT() ?")!>x.funNullableAny() } @@ -206,13 +206,13 @@ fun case_15(x: MutableCollection?, y: Nothing?) { fun case_16(x: Collection>>>>>>?) { if (x !== implicitNullableNothingProperty) else { throw Exception() } >>>>>>?")!>x - >>>>>>?")!>x.equals(null) + >>>>>>?")!>x.equals(null) >>>>>>?")!>x.propT - >>>>>>?")!>x.propAny + >>>>>>?")!>x.propAny >>>>>>?")!>x.propNullableT >>>>>>?")!>x.propNullableAny >>>>>>?")!>x.funT() - >>>>>>?")!>x.funAny() + >>>>>>?")!>x.funAny() >>>>>>?")!>x.funNullableT() >>>>>>?")!>x.funNullableAny() } @@ -221,13 +221,13 @@ fun case_16(x: Collection?) { if (x === implicitNullableNothingProperty || false) { throw Exception() } ?")!>x - ?")!>x.equals(null) + ?")!>x.equals(null) ?")!>x.propT - ?")!>x.propAny + ?")!>x.propAny ?")!>x.propNullableT ?")!>x.propNullableAny ?")!>x.funT() - ?")!>x.funAny() + ?")!>x.funAny() ?")!>x.funNullableT() ?")!>x.funNullableAny() } @@ -236,13 +236,13 @@ fun case_17(x: MutableMap<*, *>?) { fun case_18(x: MutableMap?) { if (false || false || false || x == nullableNothingProperty) throw Exception() ?")!>x - ?")!>x.equals(null) + ?")!>x.equals(null) ?")!>x.propT - ?")!>x.propAny + ?")!>x.propAny ?")!>x.propNullableT ?")!>x.propNullableAny ?")!>x.funT() - ?")!>x.funAny() + ?")!>x.funAny() ?")!>x.funNullableT() ?")!>x.funNullableAny() } @@ -318,13 +318,13 @@ fun case_23(x: Inv?) { fun case_24(x: Inv?, y: Nothing?) { if (x !== y && true) else throw Exception() ?")!>x - ?")!>x.equals(null) + ?")!>x.equals(null) ?")!>x.propT - ?")!>x.propAny + ?")!>x.propAny ?")!>x.propNullableT ?")!>x.propNullableAny ?")!>x.funT() - ?")!>x.funAny() + ?")!>x.funAny() ?")!>x.funNullableT() ?")!>x.funNullableAny() } @@ -333,13 +333,13 @@ fun case_24(x: Inv?, y: Nothing?) { fun case_25(x: Inv?, y: Nothing?) { if (x !== y) else try { throw Exception() } finally { throw Exception() } ?")!>x - ?")!>x.equals(null) + ?")!>x.equals(null) ?")!>x.propT - ?")!>x.propAny + ?")!>x.propAny ?")!>x.propNullableT ?")!>x.propNullableAny ?")!>x.funT() - ?")!>x.funAny() + ?")!>x.funAny() ?")!>x.funNullableT() ?")!>x.funNullableAny() } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/18.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/18.fir.kt index 6e1c672f4d2..8a24df69d6c 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/18.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/18.fir.kt @@ -58,13 +58,13 @@ fun case_5(x: Char?, y: Nothing?, f: Boolean) { do { if (x != y) else continue x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } while (f) @@ -75,13 +75,13 @@ fun case_6(x: Object?, f: Boolean) { while (f) { if (x !== implicitNullableNothingProperty) else { continue } x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -92,13 +92,13 @@ fun case_7(x: Class?, list: List) { for (element in list) { if (x === implicitNullableNothingProperty || false || false || false) { break } x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -109,7 +109,7 @@ fun case_8(x: Int?) { for (i in 0..10) { if (false || false || false || x == nullableNothingProperty) continue x - x.inv() + x.inv() } } @@ -118,7 +118,7 @@ fun case_9(list: List) { for (element in list) { if (element != implicitNullableNothingProperty && true && true && true) else { break } element - element.inv() + element.inv() } } @@ -127,13 +127,13 @@ fun case_10(x: Float?) { while (false) { if (true && true && true && x !== null) else break x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -205,9 +205,9 @@ fun case_15(map: MutableMap, y: Nothing?) { if (k != y) else break if (v != y) else continue k - k.inv() + k.inv() v - v.inv() + v.inv() } } @@ -216,9 +216,9 @@ fun case_16(map: Map) { for ((k, v) in map) { if (k !== implicitNullableNothingProperty && v !== implicitNullableNothingProperty) else { continue } k - k.inv() + k.inv() v - v.inv() + v.inv() } } @@ -227,13 +227,13 @@ fun case_17(x: T?, f: Boolean) { while (f) { if (x === implicitNullableNothingProperty || false) { break } x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -246,11 +246,11 @@ fun case_18(x: T, f: Boolean) { x x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -263,21 +263,21 @@ fun case_19(map: MutableMap, y: Nothing?) { k k.equals(null) k.propT - k.propAny + k.propAny k.propNullableT k.propNullableAny k.funT() - k.funAny() + k.funAny() k.funNullableT() k.funNullableAny() v v.equals(null) v.propT - v.propAny + v.propAny v.propNullableT v.propNullableAny v.funT() - v.funAny() + v.funAny() v.funNullableT() v.funNullableAny() } @@ -377,13 +377,13 @@ fun case_24(x: Inv?, y: Nothing?) { do { if (x !== y && true) else continue ?")!>x - ?")!>x.equals(null) + ?")!>x.equals(null) ?")!>x.propT - ?")!>x.propAny + ?")!>x.propAny ?")!>x.propNullableT ?")!>x.propNullableAny ?")!>x.funT() - ?")!>x.funAny() + ?")!>x.funAny() ?")!>x.funNullableT() ?")!>x.funNullableAny() } while (true) @@ -398,13 +398,13 @@ fun case_25(x: Inv?, y: Nothing?, z: List) { continue } ?")!>x - ?")!>x.equals(null) + ?")!>x.equals(null) ?")!>x.propT - ?")!>x.propAny + ?")!>x.propAny ?")!>x.propNullableT ?")!>x.propNullableAny ?")!>x.funT() - ?")!>x.funAny() + ?")!>x.funAny() ?")!>x.funNullableT() ?")!>x.funNullableAny() } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/2.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/2.fir.kt index 972c726a167..fc921ac860d 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/2.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/2.fir.kt @@ -25,13 +25,13 @@ class Case8_16__2 { fun case_1(x: Any?) { if (x != null || false) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -40,14 +40,14 @@ fun case_1(x: Any?) { // TESTCASE NUMBER: 2 fun case_2(a: DeepObject.A.B.C.D.E.F.G.J?) = if (false || a != null == true == false == false == false == true == false == true == false == false == true == true || false) { - a.x - a.equals(null) + a.x + a.equals(null) a.propT - a.propAny + a.propAny a.propNullableT a.propNullableAny a.funT() - a.funAny() + a.funAny() a.funNullableT() a.funNullableAny() } else -1 @@ -68,18 +68,18 @@ fun case_3(b: Boolean) { if (false || false || false || false || y !== null) { val z = ?")!>y() - ?>?")!>y.equals(null) + ?>?")!>y.equals(null) ?>?")!>y.propT - ?>?")!>y.propAny + ?>?")!>y.propAny ?>?")!>y.propNullableT ?>?")!>y.propNullableAny ?>?")!>y.funT() - ?>?")!>y.funAny() + ?>?")!>y.funAny() ?>?")!>y.funNullableT() ?>?")!>y.funNullableAny() if (z != null || false) { - ?")!>z.a + ?")!>z.a } } } @@ -88,13 +88,13 @@ fun case_3(b: Boolean) { fun case_4(a: ((Float) -> Int?)?, b: Float?) { if (a != null == true && b != null == true || false || false || false || false || false || false || false || false || false) { val x = a(b) - ?")!>a.equals(null) + ?")!>a.equals(null) ?")!>a.propT - ?")!>a.propAny + ?")!>a.propAny ?")!>a.propNullableT ?")!>a.propNullableAny ?")!>a.funT() - ?")!>a.funAny() + ?")!>a.funAny() ?")!>a.funNullableT() ?")!>a.funNullableAny() @@ -125,16 +125,16 @@ fun case_5(b: Boolean) { } else null if (a != null && a.B5 != null && a.B5.C5 != null && a.B5.C5.D5 != null && a.B5.C5.D5.x != null && b || false) { - a.B5.C5.D5.x - a.B5.C5.D5.x.equals(null) - a.B5.C5.D5.x.propT - a.B5.C5.D5.x.propAny - a.B5.C5.D5.x.propNullableT - a.B5.C5.D5.x.propNullableAny - a.B5.C5.D5.x.funT() - a.B5.C5.D5.x.funAny() - a.B5.C5.D5.x.funNullableT() - a.B5.C5.D5.x.funNullableAny() + a.B5.C5.D5.x + a.B5.C5.D5.x.equals(null) + a.B5.C5.D5.x.propT + a.B5.C5.D5.x.propAny + a.B5.C5.D5.x.propNullableT + a.B5.C5.D5.x.propNullableAny + a.B5.C5.D5.x.funT() + a.B5.C5.D5.x.funAny() + a.B5.C5.D5.x.funNullableT() + a.B5.C5.D5.x.funNullableAny() } } @@ -142,13 +142,13 @@ fun case_5(b: Boolean) { fun case_6(z: Boolean?) { if (false || EnumClassWithNullableProperty.B.prop_1 != null && z != null && z) { EnumClassWithNullableProperty.B.prop_1 - EnumClassWithNullableProperty.B.prop_1.equals(null) + EnumClassWithNullableProperty.B.prop_1.equals(null) EnumClassWithNullableProperty.B.prop_1.propT - EnumClassWithNullableProperty.B.prop_1.propAny + EnumClassWithNullableProperty.B.prop_1.propAny EnumClassWithNullableProperty.B.prop_1.propNullableT EnumClassWithNullableProperty.B.prop_1.propNullableAny EnumClassWithNullableProperty.B.prop_1.funT() - EnumClassWithNullableProperty.B.prop_1.funAny() + EnumClassWithNullableProperty.B.prop_1.funAny() EnumClassWithNullableProperty.B.prop_1.funNullableT() EnumClassWithNullableProperty.B.prop_1.funNullableAny() } @@ -247,14 +247,14 @@ fun case_10(a: DeepObject.A.B.C.D.E.F.G.J?) = if (a == null == true == false == false == false == true == false == true == false == false == true == true && true) { -1 } else { - a.x - a.equals(null) + a.x + a.equals(null) a.propT - a.propAny + a.propAny a.propNullableT a.propNullableAny a.funT() - a.funAny() + a.funAny() a.funNullableT() a.funNullableAny() } @@ -275,13 +275,13 @@ fun case_11(b: Boolean) { if (y === null && true) else { val z = ?")!>y() - ?>?")!>y.equals(null) + ?>?")!>y.equals(null) ?>?")!>y.propT - ?>?")!>y.propAny + ?>?")!>y.propAny ?>?")!>y.propNullableT ?>?")!>y.propNullableAny ?>?")!>y.funT() - ?>?")!>y.funAny() + ?>?")!>y.funAny() ?>?")!>y.funNullableT() ?>?")!>y.funNullableAny() @@ -299,13 +299,13 @@ fun case_12(a: ((Float) -> Int?)?, b: Float?, c: Boolean?) { } else { val x = a(b) - ?")!>a.equals(null) + ?")!>a.equals(null) ?")!>a.propT - ?")!>a.propAny + ?")!>a.propAny ?")!>a.propNullableT ?")!>a.propNullableAny ?")!>a.funT() - ?")!>a.funAny() + ?")!>a.funAny() ?")!>a.funNullableT() ?")!>a.funNullableAny() b.equals(null) @@ -357,16 +357,16 @@ fun case_13(b: Boolean, c: Boolean, d: Boolean) { if ((a == null || a.B19 == null || a.B19.C19 == null || a.B19.C19.D19 == null || a.B19.C19.D19.x == null || b || c || !d) && true) { } else { - a.B19.C19.D19.x - a.B19.C19.D19.x.equals(null) - a.B19.C19.D19.x.propT - a.B19.C19.D19.x.propAny - a.B19.C19.D19.x.propNullableT - a.B19.C19.D19.x.propNullableAny - a.B19.C19.D19.x.funT() - a.B19.C19.D19.x.funAny() - a.B19.C19.D19.x.funNullableT() - a.B19.C19.D19.x.funNullableAny() + a.B19.C19.D19.x + a.B19.C19.D19.x.equals(null) + a.B19.C19.D19.x.propT + a.B19.C19.D19.x.propAny + a.B19.C19.D19.x.propNullableT + a.B19.C19.D19.x.propNullableAny + a.B19.C19.D19.x.funT() + a.B19.C19.D19.x.funAny() + a.B19.C19.D19.x.funNullableT() + a.B19.C19.D19.x.funNullableAny() } } @@ -380,13 +380,13 @@ fun case_14(z: Boolean?) { } else { EnumClassWithNullableProperty.B.prop_1 - EnumClassWithNullableProperty.B.prop_1.equals(null) + EnumClassWithNullableProperty.B.prop_1.equals(null) EnumClassWithNullableProperty.B.prop_1.propT - EnumClassWithNullableProperty.B.prop_1.propAny + EnumClassWithNullableProperty.B.prop_1.propAny EnumClassWithNullableProperty.B.prop_1.propNullableT EnumClassWithNullableProperty.B.prop_1.propNullableAny EnumClassWithNullableProperty.B.prop_1.funT() - EnumClassWithNullableProperty.B.prop_1.funAny() + EnumClassWithNullableProperty.B.prop_1.funAny() EnumClassWithNullableProperty.B.prop_1.funNullableT() EnumClassWithNullableProperty.B.prop_1.funNullableAny() } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/25.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/25.fir.kt index 2fddb835ba8..22bca72ead5 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/25.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/25.fir.kt @@ -52,8 +52,8 @@ inline fun case_4(x: Any?) { (x as? T)!! if (x is T?) { x - x.length - x.get(0) + x.length + x.get(0) } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/26.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/26.fir.kt index 2fddb835ba8..22bca72ead5 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/26.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/26.fir.kt @@ -52,8 +52,8 @@ inline fun case_4(x: Any?) { (x as? T)!! if (x is T?) { x - x.length - x.get(0) + x.length + x.get(0) } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/27.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/27.fir.kt index 2fddb835ba8..22bca72ead5 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/27.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/27.fir.kt @@ -52,8 +52,8 @@ inline fun case_4(x: Any?) { (x as? T)!! if (x is T?) { x - x.length - x.get(0) + x.length + x.get(0) } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/30.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/30.fir.kt index 61de817a017..a2070fc7221 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/30.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/30.fir.kt @@ -11,9 +11,9 @@ fun case_1(x: Class?) { if (x!!.prop_8?.prop_8?.prop_8?.prop_8 != null) { x x.prop_8 - x.prop_8.prop_8 - x.prop_8.prop_8.prop_8 - x.prop_8.prop_8.prop_8.prop_8 + x.prop_8.prop_8 + x.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8.prop_8 } } @@ -27,8 +27,8 @@ fun case_2(x: Class?) { x x.prop_8 x.prop_8.prop_8 - x.prop_8.prop_8.prop_8 - x.prop_8.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8.prop_8 } } @@ -43,7 +43,7 @@ fun case_3(x: Class?) { x.prop_8 x.prop_8.prop_8 x.prop_8.prop_8.prop_8 - x.prop_8.prop_8.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8.prop_8.prop_8 } } @@ -56,9 +56,9 @@ fun case_4(x: Class?) { if (x!!?.prop_8?.prop_8?.prop_8?.prop_8 == null == true) else { x x.prop_8 - x.prop_8.prop_8 - x.prop_8.prop_8.prop_8 - x.prop_8.prop_8.prop_8.prop_8 + x.prop_8.prop_8 + x.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8.prop_8 } } @@ -72,8 +72,8 @@ fun case_5(x: Class?) { x x.prop_8 x.prop_8.prop_8 - x.prop_8.prop_8.prop_8 - x.prop_8.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8.prop_8 } } @@ -88,7 +88,7 @@ fun case_6(x: Class?) { x.prop_8 x.prop_8.prop_8 x.prop_8.prop_8.prop_8 - x.prop_8.prop_8.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8.prop_8.prop_8 } } @@ -101,9 +101,9 @@ fun case_7(x: Class) { if (x!!.prop_8?.prop_8?.prop_8?.prop_8 != null) { x x.prop_8 - x.prop_8.prop_8 - x.prop_8.prop_8.prop_8 - x.prop_8.prop_8.prop_8.prop_8 + x.prop_8.prop_8 + x.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8.prop_8 } } @@ -116,9 +116,9 @@ fun case_8(x: Class) { if (x!!.prop_8?.prop_8?.prop_8?.prop_8 != null) { x x.prop_8 - x.prop_8.prop_8 - x.prop_8.prop_8.prop_8 - x.prop_8.prop_8.prop_8.prop_8 + x.prop_8.prop_8 + x.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8.prop_8 } } // TESTCASE NUMBER: 9 @@ -136,8 +136,8 @@ fun case_9(x: T) { */ fun case_10(x: Inv?) { if (x!!.prop_1?.prop_1?.prop_1?.prop_2 != null) { - x.prop_1.prop_1.prop_1.prop_2 - x.prop_1.prop_1.prop_1.prop_2.equals(10) + x.prop_1.prop_1.prop_1.prop_2 + x.prop_1.prop_1.prop_1.prop_2.equals(10) } } @@ -148,8 +148,8 @@ fun case_10(x: Inv?) { */ inline fun case_11(x: Inv?) { if (x?.prop_1!!.prop_1?.prop_1?.prop_2 == null) else { - x.prop_1.prop_1.prop_1.prop_2 - x.prop_1.prop_1.prop_1.prop_2.equals(10) + x.prop_1.prop_1.prop_1.prop_2 + x.prop_1.prop_1.prop_1.prop_2.equals(10) } } @@ -161,7 +161,7 @@ inline fun case_11(x: Inv?) { fun case_12(x: Inv?) { if (x?.prop_1?.prop_1?.prop_1!!.prop_1 == null) else { x.prop_1.prop_1.prop_1.prop_1 - x.prop_1.prop_1.prop_1.prop_1.equals(10) + x.prop_1.prop_1.prop_1.prop_1.equals(10) } } @@ -172,7 +172,7 @@ fun case_12(x: Inv?) { */ inline fun case_13(x: Out?) { if (x?.prop_1?.prop_1!!.prop_1?.prop_1 != null) { - x.prop_1.prop_1.prop_1.prop_1 - x.prop_1.prop_1.prop_1.prop_1.equals(10) + x.prop_1.prop_1.prop_1.prop_1 + x.prop_1.prop_1.prop_1.prop_1.equals(10) } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/31.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/31.fir.kt index 0e315921960..f27996473ae 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/31.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/31.fir.kt @@ -11,9 +11,9 @@ fun case_1(x: Any?) { if ((x as Class).prop_8?.prop_8?.prop_8?.prop_8 != null) { x x.prop_8 - x.prop_8.prop_8 - x.prop_8.prop_8.prop_8 - x.prop_8.prop_8.prop_8.prop_8 + x.prop_8.prop_8 + x.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8.prop_8 } } @@ -26,9 +26,9 @@ fun case_2(x: Class?) { if ((x as Class).prop_8?.prop_8?.prop_8?.prop_8 !== null) { x x.prop_8 - x.prop_8.prop_8 - x.prop_8.prop_8.prop_8 - x.prop_8.prop_8.prop_8.prop_8 + x.prop_8.prop_8 + x.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8.prop_8 } } @@ -40,10 +40,10 @@ fun case_2(x: Class?) { fun case_3(x: Any?) { if ((x as Class?)?.prop_8?.prop_8?.prop_8?.prop_8 == null) else { x - x.prop_8 - x.prop_8.prop_8 - x.prop_8.prop_8.prop_8 - x.prop_8.prop_8.prop_8.prop_8.prop_8 + x.prop_8 + x.prop_8.prop_8 + x.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8.prop_8.prop_8 } } @@ -55,10 +55,10 @@ fun case_3(x: Any?) { fun case_4(x: Any?) { if ((x as Class?)!!.prop_8?.prop_8?.prop_8?.prop_8 == null) else { x - x.prop_8 - x.prop_8.prop_8 - x.prop_8.prop_8.prop_8 - x.prop_8.prop_8.prop_8.prop_8.prop_8 + x.prop_8 + x.prop_8.prop_8 + x.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8.prop_8.prop_8 } } @@ -72,8 +72,8 @@ fun case_5(x: Class?) { x x.prop_8 x.prop_8.prop_8 - x.prop_8.prop_8.prop_8 - x.prop_8.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8.prop_8 } } @@ -88,7 +88,7 @@ fun case_6(x: Class?) { x.prop_8 x.prop_8.prop_8 x.prop_8.prop_8.prop_8 - x.prop_8.prop_8.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8.prop_8.prop_8 } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/35.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/35.fir.kt index 31947eda671..45d1ac8ac5d 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/35.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/35.fir.kt @@ -13,7 +13,7 @@ fun case_1(x: Any?) { } x - x.equals(10) + x.equals(10) } // TESTCASE NUMBER: 2 @@ -24,7 +24,7 @@ fun case_2(x: Any?) { } x - x.equals(10) + x.equals(10) } /* @@ -38,7 +38,7 @@ fun case_3(x: Any?) { } x - x.equals(10) + x.equals(10) } // TESTCASE NUMBER: 4 diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/37.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/37.fir.kt index 68193e742cb..532eb88281a 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/37.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/37.fir.kt @@ -13,7 +13,7 @@ fun case_1(x: Any?) { } x - x.equals(10) + x.equals(10) } // TESTCASE NUMBER: 2 @@ -24,7 +24,7 @@ fun case_2(a: Any?) { } a - a.equals(10) + a.equals(10) } /* @@ -38,7 +38,7 @@ fun case_3(x: Int?) { } x - x.equals(10) + x.equals(10) } // TESTCASE NUMBER: 4 @@ -48,7 +48,7 @@ fun case_4(x: Boolean?) { } x - x.equals(10) + x.equals(10) } /* @@ -62,7 +62,7 @@ fun case_5(x: Boolean?) { } x - x.equals(10) + x.equals(10) } // TESTCASE NUMBER: 6 @@ -72,7 +72,7 @@ fun case_6(x: Boolean?) { } x - x.equals(10) + x.equals(10) } // TESTCASE NUMBER: 7 @@ -82,7 +82,7 @@ fun case_7(x: Boolean?) { } x - x.equals(10) + x.equals(10) } // TESTCASE NUMBER: 8 @@ -110,7 +110,7 @@ fun case_10(x: Boolean?) { } x - x.equals(10) + x.equals(10) } // TESTCASE NUMBER: 11 @@ -147,7 +147,7 @@ fun case_13(x: Boolean?) { } x - x.equals(10) + x.equals(10) } /* diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/40.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/40.fir.kt index 76fd6697ca9..e94d4d0792b 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/40.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/40.fir.kt @@ -97,8 +97,8 @@ fun case_10(x: Any?) { */ fun case_11(x: Any?) { if ((x as Boolean?)!!) { - x.not() - select(x).not() + x.not() + select(x).not() } } @@ -121,8 +121,8 @@ fun case_12(x: Any?) { */ fun case_13(x: Any?) { if (x as Boolean? ?: x!!) { - x.not() - select(x).not() + x.not() + select(x).not() } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/46.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/46.fir.kt index b36b084f65c..002be3a9d40 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/46.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/46.fir.kt @@ -13,7 +13,7 @@ import kotlin.reflect.* fun case_1(x: Int?) { if (x != funNothingQuest() == true) { x - x.inv() + x.inv() } } @@ -26,7 +26,7 @@ fun case_2(x: Int?) { operator fun Nothing?.not() = null if (x != !null != false) { x - x.inv() + x.inv() } } @@ -50,7 +50,7 @@ fun case_3(x: Int?) { fun case_4(x: Int?, y: List) { if (x == y[0] == true) { x - x.inv() + x.inv() } } @@ -66,7 +66,7 @@ fun case_5(x: Int?) { if (x == y.z == true) { x - x.inv() + x.inv() } } @@ -80,7 +80,7 @@ fun case_6(x: Int?) { if (x == y == true) { x - x.inv() + x.inv() } } @@ -97,7 +97,7 @@ fun case_7(x: Int?) { if (x == y.z == true) { x - x.inv() + x.inv() } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/59.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/59.fir.kt index beab8636a9b..d33a0d0e271 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/59.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/59.fir.kt @@ -142,7 +142,7 @@ fun case_11() { x as? Any ?: null!! do { x - x = x.equals(10) + x = x.equals(10) } while (x != null) } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/6.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/6.fir.kt index 19514767c5f..7a2c794098a 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/6.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/6.fir.kt @@ -19,13 +19,13 @@ fun case_1(x: Any?) { val y = null if (x != y) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -51,13 +51,13 @@ fun case_3() { if (Object.prop_1 == y) else { Object.prop_1 - Object.prop_1.equals(null) + Object.prop_1.equals(null) Object.prop_1.propT - Object.prop_1.propAny + Object.prop_1.propAny Object.prop_1.propNullableT Object.prop_1.propNullableAny Object.prop_1.funT() - Object.prop_1.funAny() + Object.prop_1.funAny() Object.prop_1.funNullableT() Object.prop_1.funNullableAny() } @@ -67,13 +67,13 @@ fun case_3() { fun case_4(x: Char?, y: Nothing?) { if (x != y && true) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -86,13 +86,13 @@ fun case_5() { if (x !== y) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -104,13 +104,13 @@ fun case_6(x: EmptyClass?, z: Nothing?) { if (x != z && !y) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -122,13 +122,13 @@ fun case_7(x: EmptyObject?) { if (x != y || x != y) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -160,11 +160,11 @@ fun case_9(x: TypealiasNullableString?, y: Nothing?) { x x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -206,11 +206,11 @@ fun case_11(x: TypealiasNullableString?, y: TypealiasNullableString) { x x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -240,13 +240,13 @@ fun case_13(x: EmptyClass12_48?, z: Nothing?) = throw Exception() } else { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -268,11 +268,11 @@ fun case_14() { a.x a.x.equals(null) a.x.propT - a.x.propAny + a.x.propAny a.x.propNullableT a.x.propNullableAny a.x.funT() - a.x.funAny() + a.x.funAny() a.x.funNullableT() a.x.funNullableAny() } @@ -309,13 +309,13 @@ fun case_16() { // TESTCASE NUMBER: 17 val case_17 = if (nullableIntProperty === implicitNullableNothingProperty) 0 else { nullableIntProperty - nullableIntProperty.equals(null) + nullableIntProperty.equals(null) nullableIntProperty.propT - nullableIntProperty.propAny + nullableIntProperty.propAny nullableIntProperty.propNullableT nullableIntProperty.propNullableAny nullableIntProperty.funT() - nullableIntProperty.funAny() + nullableIntProperty.funAny() nullableIntProperty.funNullableT() nullableIntProperty.funNullableAny() } @@ -330,13 +330,13 @@ fun case_18(a: DeepObject.A.B.C.D.E.F.G.J?, b: Boolean) { if (a != (if (b) x else y) || x !== a) { a - a.equals(null) + a.equals(null) a.propT - a.propAny + a.propAny a.propNullableT a.propNullableAny a.funT() - a.funAny() + a.funAny() a.funNullableT() a.funNullableAny() } @@ -363,17 +363,17 @@ fun case_19(b: Boolean) { } } else z - if (a != z && a.B19 !== z && a.B19.C19 != z && a.B19.C19.D19 != z && a.B19.C19.D19.x !== z) { - a.B19.C19.D19.x - a.B19.C19.D19.x.equals(null) - a.B19.C19.D19.x.propT - a.B19.C19.D19.x.propAny - a.B19.C19.D19.x.propNullableT - a.B19.C19.D19.x.propNullableAny - a.B19.C19.D19.x.funT() - a.B19.C19.D19.x.funAny() - a.B19.C19.D19.x.funNullableT() - a.B19.C19.D19.x.funNullableAny() + if (a != z && a.B19 !== z && a.B19.C19 != z && a.B19.C19.D19 != z && a.B19.C19.D19.x !== z) { + a.B19.C19.D19.x + a.B19.C19.D19.x.equals(null) + a.B19.C19.D19.x.propT + a.B19.C19.D19.x.propAny + a.B19.C19.D19.x.propNullableT + a.B19.C19.D19.x.propNullableAny + a.B19.C19.D19.x.funT() + a.B19.C19.D19.x.funAny() + a.B19.C19.D19.x.funNullableT() + a.B19.C19.D19.x.funNullableAny() } } @@ -391,13 +391,13 @@ fun case_20(x: Boolean, y: Nothing?) { if (z.B19.C19.D19 !== y) { z.B19.C19.D19 - z.B19.C19.D19.equals(null) + z.B19.C19.D19.equals(null) z.B19.C19.D19.propT - z.B19.C19.D19.propAny + z.B19.C19.D19.propAny z.B19.C19.D19.propNullableT z.B19.C19.D19.propNullableAny z.B19.C19.D19.funT() - z.B19.C19.D19.funAny() + z.B19.C19.D19.funAny() z.B19.C19.D19.funNullableT() z.B19.C19.D19.funNullableAny() } @@ -407,13 +407,13 @@ fun case_20(x: Boolean, y: Nothing?) { fun case_21() { if (EnumClassWithNullableProperty.A.prop_1 !== implicitNullableNothingProperty) { EnumClassWithNullableProperty.A.prop_1 - EnumClassWithNullableProperty.A.prop_1.equals(null) + EnumClassWithNullableProperty.A.prop_1.equals(null) EnumClassWithNullableProperty.A.prop_1.propT - EnumClassWithNullableProperty.A.prop_1.propAny + EnumClassWithNullableProperty.A.prop_1.propAny EnumClassWithNullableProperty.A.prop_1.propNullableT EnumClassWithNullableProperty.A.prop_1.propNullableAny EnumClassWithNullableProperty.A.prop_1.funT() - EnumClassWithNullableProperty.A.prop_1.funAny() + EnumClassWithNullableProperty.A.prop_1.funAny() EnumClassWithNullableProperty.A.prop_1.funNullableT() EnumClassWithNullableProperty.A.prop_1.funNullableAny() } @@ -423,13 +423,13 @@ fun case_21() { fun case_22(a: (() -> Unit)?) { if (a != implicitNullableNothingProperty) { a() - ?")!>a.equals(null) + ?")!>a.equals(null) ?")!>a.propT - ?")!>a.propAny + ?")!>a.propAny ?")!>a.propNullableT ?")!>a.propNullableAny ?")!>a.funT() - ?")!>a.funAny() + ?")!>a.funAny() ?")!>a.funNullableT() ?")!>a.funNullableAny() } @@ -441,13 +441,13 @@ fun case_23(a: ((Float) -> Int?)?, b: Float?, z: Nothing?) { val x = a(b) if (x != z || x !== implicitNullableNothingProperty) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -458,22 +458,22 @@ fun case_23(a: ((Float) -> Int?)?, b: Float?, z: Nothing?) { fun case_24(a: ((() -> Unit) -> Unit)?, b: (() -> Unit)?, z: Nothing?) = if (a !== z && b !== z) { a(?")!>b) - , kotlin.Unit>?")!>a.equals(null) + , kotlin.Unit>?")!>a.equals(null) , kotlin.Unit>?")!>a.propT - , kotlin.Unit>?")!>a.propAny + , kotlin.Unit>?")!>a.propAny , kotlin.Unit>?")!>a.propNullableT , kotlin.Unit>?")!>a.propNullableAny , kotlin.Unit>?")!>a.funT() - , kotlin.Unit>?")!>a.funAny() + , kotlin.Unit>?")!>a.funAny() , kotlin.Unit>?")!>a.funNullableT() , kotlin.Unit>?")!>a.funNullableAny() - ?")!>b.equals(null) + ?")!>b.equals(null) ?")!>b.propT - ?")!>b.propAny + ?")!>b.propAny ?")!>b.propNullableT ?")!>b.propNullableAny ?")!>b.funT() - ?")!>b.funAny() + ?")!>b.funAny() ?")!>b.funNullableT() ?")!>b.funNullableAny() } else z @@ -492,14 +492,14 @@ fun case_25(b: Boolean, z: Nothing?) { val z1 = ?")!>y() if (z1 != z && implicitNullableNothingProperty !== z1) { - ?")!>z1.a - ?")!>z1.equals(null) + ?")!>z1.a + ?")!>z1.equals(null) ?")!>z1.propT - ?")!>z1.propAny + ?")!>z1.propAny ?")!>z1.propNullableT ?")!>z1.propNullableAny ?")!>z1.funT() - ?")!>z1.funAny() + ?")!>z1.funAny() ?")!>z1.funNullableT() ?")!>z1.funNullableAny() } @@ -514,13 +514,13 @@ fun case_26(a: ((Float) -> Int?)?, b: Float?) { val x = a(b) if (x != implicitNullableNothingProperty == true || z !== x) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -532,13 +532,13 @@ fun case_27(z: Nothing?) { if (Object.prop_1 == z == true == true == true == true == true == true == true == true == true == true == true == true == true == true) else { Object.prop_1 - Object.prop_1.equals(null) + Object.prop_1.equals(null) Object.prop_1.propT - Object.prop_1.propAny + Object.prop_1.propAny Object.prop_1.propNullableT Object.prop_1.propNullableAny Object.prop_1.funT() - Object.prop_1.funAny() + Object.prop_1.funAny() Object.prop_1.funNullableT() Object.prop_1.funNullableAny() } @@ -547,14 +547,14 @@ fun case_27(z: Nothing?) { // TESTCASE NUMBER: 28 fun case_28(a: DeepObject.A.B.C.D.E.F.G.J?) = if (a != implicitNullableNothingProperty == true == false == false == false == true == false == true == false == false == true == true) { - a.x - a.equals(null) + a.x + a.equals(null) a.propT - a.propAny + a.propAny a.propNullableT a.propNullableAny a.funT() - a.funAny() + a.funAny() a.funNullableT() a.funNullableAny() } else -1 @@ -578,14 +578,14 @@ fun case_29(x: Boolean) { val t = ?")!>y() if (z !== t || false) { - ?")!>t.a - ?")!>t.equals(null) + ?")!>t.a + ?")!>t.equals(null) ?")!>t.propT - ?")!>t.propAny + ?")!>t.propAny ?")!>t.propNullableT ?")!>t.propNullableAny ?")!>t.funT() - ?")!>t.funAny() + ?")!>t.funAny() ?")!>t.funNullableT() ?")!>t.funNullableAny() } @@ -598,13 +598,13 @@ fun case_30(a: ((Float) -> Int?)?, b: Float?) { val x = a(b) if (false || implicitNullableNothingProperty != x == true) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -615,13 +615,13 @@ fun case_30(a: ((Float) -> Int?)?, b: Float?) { fun case_31(z1: Boolean?, z: Nothing?) { if (false || EnumClassWithNullableProperty.A.prop_1 != z && z1 !== z && z1) { EnumClassWithNullableProperty.A.prop_1 - EnumClassWithNullableProperty.A.prop_1.equals(null) + EnumClassWithNullableProperty.A.prop_1.equals(null) EnumClassWithNullableProperty.A.prop_1.propT - EnumClassWithNullableProperty.A.prop_1.propAny + EnumClassWithNullableProperty.A.prop_1.propAny EnumClassWithNullableProperty.A.prop_1.propNullableT EnumClassWithNullableProperty.A.prop_1.propNullableAny EnumClassWithNullableProperty.A.prop_1.funT() - EnumClassWithNullableProperty.A.prop_1.funAny() + EnumClassWithNullableProperty.A.prop_1.funAny() EnumClassWithNullableProperty.A.prop_1.funNullableT() EnumClassWithNullableProperty.A.prop_1.funNullableAny() } @@ -632,14 +632,14 @@ fun case_32(a: DeepObject.A.B.C.D.E.F.G.J?) = if (a == implicitNullableNothingProperty == true == false == false == false == true == false == true == false == false == true == true && true) { -1 } else { - a.x - a.equals(null) + a.x + a.equals(null) a.propT - a.propAny + a.propAny a.propNullableT a.propNullableAny a.funT() - a.funAny() + a.funAny() a.funNullableT() a.funNullableAny() } @@ -656,13 +656,13 @@ fun case_33(a: ((Float) -> Int?)?, b: Float?, c: Boolean?) { } else { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -681,13 +681,13 @@ fun case_34(z1: Boolean?) { } else { EnumClassWithNullableProperty.A.prop_1 - EnumClassWithNullableProperty.A.prop_1.equals(null) + EnumClassWithNullableProperty.A.prop_1.equals(null) EnumClassWithNullableProperty.A.prop_1.propT - EnumClassWithNullableProperty.A.prop_1.propAny + EnumClassWithNullableProperty.A.prop_1.propAny EnumClassWithNullableProperty.A.prop_1.propNullableT EnumClassWithNullableProperty.A.prop_1.propNullableAny EnumClassWithNullableProperty.A.prop_1.funT() - EnumClassWithNullableProperty.A.prop_1.funAny() + EnumClassWithNullableProperty.A.prop_1.funAny() EnumClassWithNullableProperty.A.prop_1.funNullableT() EnumClassWithNullableProperty.A.prop_1.funNullableAny() } @@ -807,11 +807,11 @@ fun case_44(x: TypealiasNullableString?, z1: Nothing?) { x x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -953,9 +953,9 @@ fun case_54(b: Boolean) { val z = null - if (a != z && a.B54 !== a.z && a.B54.C54 != a.z && a.B54.C54.D54 != a.z && a.B54.C54.D54.x === a.z) { - a.B54.C54.D54.x - a.B54.C54.D54.x.hashCode() + if (a != z && a.B54 !== a.z && a.B54.C54 != a.z && a.B54.C54.D54 != a.z && a.B54.C54.D54.x === a.z) { + a.B54.C54.D54.x + a.B54.C54.D54.x.hashCode() } } @@ -1022,22 +1022,22 @@ fun case_59(a: ((() -> Unit) -> Unit)?, b: (() -> Unit)?, z: Nothing?) { if (false || false || a == z && b === z) { , kotlin.Unit>?")!>a ?")!>b - , kotlin.Unit>?")!>a.equals(null) + , kotlin.Unit>?")!>a.equals(null) , kotlin.Unit>?")!>a.propT - , kotlin.Unit>?")!>a.propAny + , kotlin.Unit>?")!>a.propAny , kotlin.Unit>?")!>a.propNullableT , kotlin.Unit>?")!>a.propNullableAny , kotlin.Unit>?")!>a.funT() - , kotlin.Unit>?")!>a.funAny() + , kotlin.Unit>?")!>a.funAny() , kotlin.Unit>?")!>a.funNullableT() , kotlin.Unit>?")!>a.funNullableAny() - ?")!>b.equals(null) + ?")!>b.equals(null) ?")!>b.propT - ?")!>b.propAny + ?")!>b.propAny ?")!>b.propNullableT ?")!>b.propNullableAny ?")!>b.funT() - ?")!>b.funAny() + ?")!>b.funAny() ?")!>b.funNullableT() ?")!>b.funNullableAny() } @@ -1067,13 +1067,13 @@ fun case_61(x: Any?) { if (x is Number?) { if (x !== implicitNullableNothingProperty) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -1085,13 +1085,13 @@ fun case_62(x: Any?) { var z = null if (x is Number? && x is Int? && x != z) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -1107,13 +1107,13 @@ fun case_63(x: Any?, b: Boolean) { if (x !== when (b) { true -> z1; false -> z2; else -> z3 }) { if (x is Int?) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -1150,13 +1150,13 @@ fun case_65(x: Any?, z: Nothing?) { if (x is ClassLevel5?) { if (x != z) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -1178,13 +1178,13 @@ fun case_66(x: Any?, z1: Nothing?, z2: Nothing?, b: Boolean) { if (x != if (b) { z1 } else { z2 } && x is ClassLevel4?) { if (x is ClassLevel5?) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -1201,13 +1201,13 @@ fun case_67(x: Any?) { if (x is ClassLevel1? && x is ClassLevel2? && x is ClassLevel3?) { if (x is ClassLevel4? && x != (fun (): Nothing? { return z })() && x is ClassLevel5?) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -1219,13 +1219,13 @@ fun case_68(x: Any?, z: Nothing?) { if (x is ClassLevel1? && x is ClassLevel2? && x is ClassLevel3?) { if (x is ClassLevel4? && x != (fun (): Nothing? { return z })() && x is ClassLevel5?) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -1239,13 +1239,13 @@ fun case_68(x: Any?, z: Nothing?) { fun case_69(x: Any?, z: Nothing?) { if (x is ClassLevel1? && x is ClassLevel2? && x is ClassLevel3? && x is ClassLevel4? && x != try { z } catch (e: Exception) { z } && x is ClassLevel5?) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -1258,25 +1258,25 @@ fun case_70(x: Any?) { } else if (x is ClassLevel5? && x != nullableNothingProperty || x != implicitNullableNothingProperty) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } } else if (x is ClassLevel4? && x !== nullableNothingProperty && x is ClassLevel5?) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/61.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/61.fir.kt index f973a6f5b29..005379fe2c6 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/61.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/61.fir.kt @@ -158,7 +158,7 @@ class Case11 { if (y == case_12) throw Exception() y - y.length + y.length } constructor() } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/66.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/66.fir.kt index a47421beaf7..1b28a337f52 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/66.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/66.fir.kt @@ -22,7 +22,7 @@ fun case_1(x: Any?) { fun case_2(x: Pair<*, *>?) { if (x is Nothing?) return ?")!>x - ?")!>x.equals(10) + ?")!>x.equals(10) } /* @@ -33,7 +33,7 @@ fun case_2(x: Pair<*, *>?) { fun case_3(x: Any?) { if (x is Nothing?) throw Exception() x - x.equals(10) + x.equals(10) } /* @@ -46,11 +46,11 @@ fun case_4(x: Pair<*, *>?) { is Nothing? -> return else -> { ?")!>x - ?")!>x.equals(10) + ?")!>x.equals(10) } } ?")!>x - ?")!>x.equals(10) + ?")!>x.equals(10) } /* @@ -80,9 +80,9 @@ fun case_6(x: Any?) { is Nothing? -> return is Any? -> { x - x.equals(10) + x.equals(10) } } x - x.equals(10) + x.equals(10) } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/68.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/68.fir.kt index 3aee4686e01..a56cc5ccb1d 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/68.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/68.fir.kt @@ -14,7 +14,7 @@ fun case_1(x: Any?) { fun case_2(x: Any?) { (x as Nothing?)!! x - x.inv() + x.inv() } // TESTCASE NUMBER: 3 @@ -29,7 +29,7 @@ fun case_3(x: Any?) { fun case_4(x: Any?) { if (x as Class? is Class) { x - x.prop_1 + x.prop_1 } } @@ -37,7 +37,7 @@ fun case_4(x: Any?) { fun case_5(x: Any?) { if (x as Nothing? is Nothing) { x - x.inv() + x.inv() } } @@ -45,14 +45,14 @@ fun case_5(x: Any?) { fun case_6(x: Any?) { (x as String?)!! x - x.length + x.length } // TESTCASE NUMBER: 7 fun case_7(x: Any?) { if (x as String? != null) { x - x.length + x.length } } @@ -60,6 +60,6 @@ fun case_7(x: Any?) { fun case_8(x: Any?) { if (x as String? == null) { x - x.length + x.length } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/69.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/69.fir.kt index b4ad1ffb4be..491a877b8cd 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/69.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/69.fir.kt @@ -14,14 +14,14 @@ fun test1(x: ClassLevel1?) { fun case_2(x: Any?) { (x as ClassLevel1?)!! x - x.test1() + x.test1() } // TESTCASE NUMBER: 3 fun case_3(x: Any?) { if (x as ClassLevel1? is ClassLevel1) { x - x.test1() + x.test1() } } @@ -29,7 +29,7 @@ fun case_3(x: Any?) { fun case_4(x: Any?) { if ((x as Class).prop_8 != null) { x - x.prop_8.prop_8 + x.prop_8.prop_8 } } @@ -37,6 +37,6 @@ fun case_4(x: Any?) { fun case_5(x: Class) { if (x!!.prop_8 != null) { x - x.prop_8.prop_8 + x.prop_8.prop_8 } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/7.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/7.fir.kt index 516e0537601..7b7ff033335 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/7.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/7.fir.kt @@ -100,13 +100,13 @@ fun case_6(x: Class?) { if (((false || x != null || false) && !y) || x != null) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -311,13 +311,13 @@ val case_17 = if (nullableIntPropert fun case_18(a: DeepObject.A.B.C.D.E.F.G.J?, b: Nothing?) { if (a != null || b !== a || false) { a - a.equals(null) + a.equals(null) a.propT - a.propAny + a.propAny a.propNullableT a.propNullableAny a.funT() - a.funAny() + a.funAny() a.funNullableT() a.funNullableAny() } @@ -344,17 +344,17 @@ fun case_19(b: Boolean) { } } else null - if (a != null && a.B19 != a.y && a.B19.C19 != a.y && a.B19.C19.D19 != a.y && a.B19.C19.D19.x != a.y) { - a.B19.C19.D19.x - a.B19.C19.D19.x.equals(null) - a.B19.C19.D19.x.propT - a.B19.C19.D19.x.propAny - a.B19.C19.D19.x.propNullableT - a.B19.C19.D19.x.propNullableAny - a.B19.C19.D19.x.funT() - a.B19.C19.D19.x.funAny() - a.B19.C19.D19.x.funNullableT() - a.B19.C19.D19.x.funNullableAny() + if (a != null && a.B19 != a.y && a.B19.C19 != a.y && a.B19.C19.D19 != a.y && a.B19.C19.D19.x != a.y) { + a.B19.C19.D19.x + a.B19.C19.D19.x.equals(null) + a.B19.C19.D19.x.propT + a.B19.C19.D19.x.propAny + a.B19.C19.D19.x.propNullableT + a.B19.C19.D19.x.propNullableAny + a.B19.C19.D19.x.funT() + a.B19.C19.D19.x.funAny() + a.B19.C19.D19.x.funNullableT() + a.B19.C19.D19.x.funNullableAny() } } @@ -373,13 +373,13 @@ fun case_20(b: Boolean) { if (a.B19.C19.D19 !== null || a.y != a.B19.C19.D19) { a.B19.C19.D19 - a.B19.C19.D19.equals(null) + a.B19.C19.D19.equals(null) a.B19.C19.D19.propT - a.B19.C19.D19.propAny + a.B19.C19.D19.propAny a.B19.C19.D19.propNullableT a.B19.C19.D19.propNullableAny a.B19.C19.D19.funT() - a.B19.C19.D19.funAny() + a.B19.C19.D19.funAny() a.B19.C19.D19.funNullableT() a.B19.C19.D19.funNullableAny() } @@ -407,13 +407,13 @@ fun case_22(a: (() -> Unit)?) { var y = null if (a != null || y != a) { a() - ?")!>a.equals(null) + ?")!>a.equals(null) ?")!>a.propT - ?")!>a.propAny + ?")!>a.propAny ?")!>a.propNullableT ?")!>a.propNullableAny ?")!>a.funT() - ?")!>a.funAny() + ?")!>a.funAny() ?")!>a.funNullableT() ?")!>a.funNullableAny() } @@ -425,13 +425,13 @@ fun case_23(a: ((Float) -> Int?)?, b: Float?, c: Nothing?) { val x = a(b) if (x != null || c !== x) { x - x.equals(null) + x.equals(null) x.propT - x.propAny + x.propAny x.propNullableT x.propNullableAny x.funT() - x.funAny() + x.funAny() x.funNullableT() x.funNullableAny() } @@ -442,22 +442,22 @@ fun case_23(a: ((Float) -> Int?)?, b: Float?, c: Nothing?) { fun case_24(a: ((() -> Unit) -> Unit)?, b: (() -> Unit)?) = if (a !== null && b !== null || implicitNullableNothingProperty != a && nullableNothingProperty !== b) { a(?")!>b) - , kotlin.Unit>?")!>a.equals(null) + , kotlin.Unit>?")!>a.equals(null) , kotlin.Unit>?")!>a.propT - , kotlin.Unit>?")!>a.propAny + , kotlin.Unit>?")!>a.propAny , kotlin.Unit>?")!>a.propNullableT , kotlin.Unit>?")!>a.propNullableAny , kotlin.Unit>?")!>a.funT() - , kotlin.Unit>?")!>a.funAny() + , kotlin.Unit>?")!>a.funAny() , kotlin.Unit>?")!>a.funNullableT() , kotlin.Unit>?")!>a.funNullableAny() - ?")!>b.equals(null) + ?")!>b.equals(null) ?")!>b.propT - ?")!>b.propAny + ?")!>b.propAny ?")!>b.propNullableT ?")!>b.propNullableAny ?")!>b.funT() - ?")!>b.funAny() + ?")!>b.funAny() ?")!>b.funNullableT() ?")!>b.funNullableAny() } else null From 338aad98eb827db2c3cb80c5151fc26a9ff12de6 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Fri, 29 Jan 2021 11:35:33 +0300 Subject: [PATCH 186/212] FIR: run diagnostic "with stdlib" tests also in light tree mode --- .../callableReferences/beyoundCalls.kt | 4 +- .../callableReferences/companions.kt | 6 +- ...llableReferencesAfterAllSimpleArguments.kt | 4 +- .../callableReferences/implicitTypes.kt | 2 +- .../callableReferences/javaStatic.kt | 2 +- .../manyInnermanyOuterCandidatesAmbiguity.kt | 2 +- .../good/returnsImplies/booleanOperators.kt | 4 +- .../resolveWithStdlib/j+k/JavaVisibility2.kt | 6 +- .../j+k/KJKComplexHierarchyWithNested.kt | 4 +- .../j+k/KotlinClassParameter.kt | 2 +- .../j+k/KotlinClassParameterGeneric.kt | 4 +- .../resolveWithStdlib/listPlusAssign.kt | 4 +- .../lowPriorityInResolution.kt | 6 +- .../problems/KJKComplexHierarchyNestedLoop.kt | 8 +- ...DiagnosticsWithLightTreeTestGenerated.java | 7795 ++++++++++------- .../generators/GenerateJUnit5CompilerTests.kt | 1 + 16 files changed, 4647 insertions(+), 3207 deletions(-) diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/beyoundCalls.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/beyoundCalls.kt index 93336ccf18e..7a07fc0a08a 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/beyoundCalls.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/beyoundCalls.kt @@ -1,5 +1,5 @@ -fun bar(x: String): Int = 1 -fun bar(x: String): Double = 1 +fun bar(x: String): Int = 1 +fun bar(x: String): Double = 1 fun baz(x: String): Int = 1 fun foobaz(x: T): R = TODO() diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/companions.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/companions.kt index 17ef4ed5510..bb474ca35cb 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/companions.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/companions.kt @@ -31,16 +31,16 @@ fun main() { foo1(KotlinClass::baz) foo2(KotlinClass::baz) // Ambiguity (companion/class) - foo3(KotlinClass::baz) + foo3(KotlinClass::baz) // Type mismatch - foo1(KotlinClass::bar) + foo1(KotlinClass::bar) foo2(KotlinClass::bar) foo3(KotlinClass::bar) foo1(KotlinClass2::bar) // Type mismatch - foo2(KotlinClass2::bar) + foo2(KotlinClass2::bar) foo3(KotlinClass2::bar) } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/resolveCallableReferencesAfterAllSimpleArguments.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/resolveCallableReferencesAfterAllSimpleArguments.kt index b2332695285..4c5cb7ea24d 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/resolveCallableReferencesAfterAllSimpleArguments.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/resolveCallableReferencesAfterAllSimpleArguments.kt @@ -7,6 +7,6 @@ fun bar(f: (T) -> Unit, e: T) {} fun baz(e: T, f: (T) -> Unit) {} fun test(a: A, b: B) { - baz(a, ::fooB) - bar(::fooB, a) + baz(a, ::fooB) + bar(::fooB, a) } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/implicitTypes.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/implicitTypes.kt index 189e45d3611..3d563c207fd 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/implicitTypes.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/implicitTypes.kt @@ -3,5 +3,5 @@ fun use(x: (T) -> R): (T) -> R = x fun foo() = use(::bar) fun bar(x: String) = 1 -fun loop1() = use(::loop2) +fun loop1() = use(::loop2) fun loop2() = loop1() diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/javaStatic.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/javaStatic.kt index b3057626abe..04a617ff483 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/javaStatic.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/javaStatic.kt @@ -16,5 +16,5 @@ fun foo3(x: (String) -> Int) {} fun main() { foo1(JavaClass::bar) foo2(JavaClass::bar) - foo3(JavaClass::bar) + foo3(JavaClass::bar) } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/manyInnermanyOuterCandidatesAmbiguity.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/manyInnermanyOuterCandidatesAmbiguity.kt index 10944f406ca..3ba452fd246 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/manyInnermanyOuterCandidatesAmbiguity.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/manyInnermanyOuterCandidatesAmbiguity.kt @@ -6,5 +6,5 @@ fun bar(): Int = 1 fun bar(x: String): Int = 1 fun main() { - foo(::bar) + foo(::bar) } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/booleanOperators.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/booleanOperators.kt index e310196c7fe..3029d26ca7b 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/booleanOperators.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/booleanOperators.kt @@ -59,8 +59,8 @@ fun test_2(x: Any) { fun test_3(x: Any) { myRequireOr(x is B, x is C) x.foo() // OK - x.bar() // Error - x.baz() // Error + x.bar() // Error + x.baz() // Error } fun test_4(x: Any) { diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/JavaVisibility2.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/JavaVisibility2.kt index 46bc2d36099..32b967e2377 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/JavaVisibility2.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/JavaVisibility2.kt @@ -27,8 +27,8 @@ class A { val p3 = JavaProtected().javaPProtectedPackage fun test() { - JavaProtected.javaMProtectedStatic() - JavaPackageLocal.javaMPackage() + JavaProtected.javaMProtectedStatic() + JavaPackageLocal.javaMPackage() } } @@ -39,7 +39,7 @@ class B : JavaProtected() { fun test() { JavaProtected.javaMProtectedStatic() - JavaPackageLocal.javaMPackage() + JavaPackageLocal.javaMPackage() } } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/KJKComplexHierarchyWithNested.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/KJKComplexHierarchyWithNested.kt index e8c12d5cbf3..99df059cf1c 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/KJKComplexHierarchyWithNested.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/KJKComplexHierarchyWithNested.kt @@ -5,9 +5,9 @@ fun main(k: KSub, vString: SuperClass.NestedInSuperClass, vInt: SuperCla k.getImpl().nestedI(vString) // TODO: Support parametrisized inner classes - k.getImpl().nestedI(vInt) + k.getImpl().nestedI(vInt) k.getNestedSubClass().nested("") - k.getNestedSubClass().nested(1) + k.getNestedSubClass().nested(1) } // FILE: J1.java diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/KotlinClassParameter.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/KotlinClassParameter.kt index c2256f265e2..c9c89e70850 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/KotlinClassParameter.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/KotlinClassParameter.kt @@ -9,5 +9,5 @@ public class JavaClass { // FILE: K2.kt fun main() { JavaClass.baz(KotlinClass()) - JavaClass.baz("") + JavaClass.baz("") } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/KotlinClassParameterGeneric.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/KotlinClassParameterGeneric.kt index 970b06ffc7e..972831a8220 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/KotlinClassParameterGeneric.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/KotlinClassParameterGeneric.kt @@ -10,6 +10,6 @@ public class JavaClass { fun main() { JavaClass.baz(KotlinClass()) JavaClass.baz(KotlinClass()) - JavaClass.baz(KotlinClass()) - JavaClass.baz("") + JavaClass.baz(KotlinClass()) + JavaClass.baz("") } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/listPlusAssign.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/listPlusAssign.kt index 12a9b9ba7a4..1222881d8fb 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/listPlusAssign.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/listPlusAssign.kt @@ -1,6 +1,6 @@ fun List.modify() { - this += "Alpha" - this += "Omega" + this += "Alpha" + this += "Omega" } fun Any.modify() { diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/lowPriorityInResolution.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/lowPriorityInResolution.kt index bfda7fa1285..7e7ce0cabdf 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/lowPriorityInResolution.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/lowPriorityInResolution.kt @@ -1,8 +1,8 @@ -@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") +@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") @kotlin.internal.LowPriorityInOverloadResolution -fun foo(): Int = 1 +fun foo(): Int = 1 -fun foo(): String = "" +fun foo(): String = "" fun test() { val s = foo() diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/KJKComplexHierarchyNestedLoop.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/KJKComplexHierarchyNestedLoop.kt index 151031d03c9..a28bf427821 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/KJKComplexHierarchyNestedLoop.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/KJKComplexHierarchyNestedLoop.kt @@ -2,11 +2,11 @@ class K2: J1() { class Q : Nested() fun bar() { - foo() - baz() + foo() + baz() - superClass() - superI() + superClass() + superI() } } diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticsWithLightTreeTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticsWithLightTreeTestGenerated.java index 2f11cbd2a33..5715994f8f3 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticsWithLightTreeTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirDiagnosticsWithLightTreeTestGenerated.java @@ -18,3597 +18,5036 @@ import java.util.regex.Pattern; /** This class is generated by {@link GenerateNewCompilerTests.kt}. DO NOT MODIFY MANUALLY */ @SuppressWarnings("all") -@TestMetadata("compiler/fir/analysis-tests/testData/resolve") -@TestDataPath("$PROJECT_ROOT") -@Execution(ExecutionMode.SAME_THREAD) public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnosticsWithLightTreeTest { - @Test - public void testAllFilesPresentInResolve() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve"), Pattern.compile("^([^.]+)\\.kt$"), null, true); - } - - @Test - @TestMetadata("asImports.kt") - public void testAsImports() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/asImports.kt"); - } - - @Test - @TestMetadata("bareTypes.kt") - public void testBareTypes() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/bareTypes.kt"); - } - - @Test - @TestMetadata("bareTypes2.kt") - public void testBareTypes2() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/bareTypes2.kt"); - } - - @Test - @TestMetadata("bareTypesWithFlexibleArguments.kt") - public void testBareTypesWithFlexibleArguments() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/bareTypesWithFlexibleArguments.kt"); - } - - @Test - @TestMetadata("cast.kt") - public void testCast() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/cast.kt"); - } - - @Test - @TestMetadata("companion.kt") - public void testCompanion() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/companion.kt"); - } - - @Test - @TestMetadata("companionAccessInEnum.kt") - public void testCompanionAccessInEnum() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/companionAccessInEnum.kt"); - } - - @Test - @TestMetadata("companionObjectCall.kt") - public void testCompanionObjectCall() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/companionObjectCall.kt"); - } - - @Test - @TestMetadata("companionUsesNested.kt") - public void testCompanionUsesNested() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/companionUsesNested.kt"); - } - - @Test - @TestMetadata("constantValues.kt") - public void testConstantValues() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/constantValues.kt"); - } - - @Test - @TestMetadata("copy.kt") - public void testCopy() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/copy.kt"); - } - - @Test - @TestMetadata("covariantArrayAsReceiver.kt") - public void testCovariantArrayAsReceiver() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/covariantArrayAsReceiver.kt"); - } - - @Test - @TestMetadata("defaultJavaImportHiding.kt") - public void testDefaultJavaImportHiding() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/defaultJavaImportHiding.kt"); - } - - @Test - @TestMetadata("defaultParametersInheritedToJava.kt") - public void testDefaultParametersInheritedToJava() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/defaultParametersInheritedToJava.kt"); - } - - @Test - @TestMetadata("definitelyNotNullAmbiguity.kt") - public void testDefinitelyNotNullAmbiguity() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/definitelyNotNullAmbiguity.kt"); - } - - @Test - @TestMetadata("delegatedSuperType.kt") - public void testDelegatedSuperType() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/delegatedSuperType.kt"); - } - - @Test - @TestMetadata("delegatingConstructorCall.kt") - public void testDelegatingConstructorCall() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/delegatingConstructorCall.kt"); - } - - @Test - @TestMetadata("delegatingConstructorsAndTypeAliases.kt") - public void testDelegatingConstructorsAndTypeAliases() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/delegatingConstructorsAndTypeAliases.kt"); - } - - @Test - @TestMetadata("derivedClass.kt") - public void testDerivedClass() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/derivedClass.kt"); - } - - @Test - @TestMetadata("enum.kt") - public void testEnum() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/enum.kt"); - } - - @Test - @TestMetadata("enumWithCompanion.kt") - public void testEnumWithCompanion() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/enumWithCompanion.kt"); - } - - @Test - @TestMetadata("exhaustiveWhenAndDNNType.kt") - public void testExhaustiveWhenAndDNNType() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/exhaustiveWhenAndDNNType.kt"); - } - - @Test - @TestMetadata("exhaustiveWhenAndFlexibleType.kt") - public void testExhaustiveWhenAndFlexibleType() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/exhaustiveWhenAndFlexibleType.kt"); - } - - @Test - @TestMetadata("exhaustiveness_boolean.kt") - public void testExhaustiveness_boolean() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/exhaustiveness_boolean.kt"); - } - - @Test - @TestMetadata("exhaustiveness_enum.kt") - public void testExhaustiveness_enum() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/exhaustiveness_enum.kt"); - } - - @Test - @TestMetadata("exhaustiveness_enumJava.kt") - public void testExhaustiveness_enumJava() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/exhaustiveness_enumJava.kt"); - } - - @Test - @TestMetadata("exhaustiveness_sealedClass.kt") - public void testExhaustiveness_sealedClass() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/exhaustiveness_sealedClass.kt"); - } - - @Test - @TestMetadata("exhaustiveness_sealedObject.kt") - public void testExhaustiveness_sealedObject() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/exhaustiveness_sealedObject.kt"); - } - - @Test - @TestMetadata("exhaustiveness_sealedSubClass.kt") - public void testExhaustiveness_sealedSubClass() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/exhaustiveness_sealedSubClass.kt"); - } - - @Test - @TestMetadata("extension.kt") - public void testExtension() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extension.kt"); - } - - @Test - @TestMetadata("F.kt") - public void testF() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/F.kt"); - } - - @Test - @TestMetadata("fakeRecursiveSupertype.kt") - public void testFakeRecursiveSupertype() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/fakeRecursiveSupertype.kt"); - } - - @Test - @TestMetadata("fakeRecursiveTypealias.kt") - public void testFakeRecursiveTypealias() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/fakeRecursiveTypealias.kt"); - } - - @Test - @TestMetadata("fib.kt") - public void testFib() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/fib.kt"); - } - - @Test - @TestMetadata("flexibleCapturedType.kt") - public void testFlexibleCapturedType() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/flexibleCapturedType.kt"); - } - - @Test - @TestMetadata("ft.kt") - public void testFt() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/ft.kt"); - } - - @Test - @TestMetadata("functionTypeAlias.kt") - public void testFunctionTypeAlias() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/functionTypeAlias.kt"); - } - - @Test - @TestMetadata("functionTypes.kt") - public void testFunctionTypes() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/functionTypes.kt"); - } - - @Test - @TestMetadata("genericConstructors.kt") - public void testGenericConstructors() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/genericConstructors.kt"); - } - - @Test - @TestMetadata("genericFunctions.kt") - public void testGenericFunctions() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/genericFunctions.kt"); - } - - @Test - @TestMetadata("genericReceiverPropertyOverride.kt") - public void testGenericReceiverPropertyOverride() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/genericReceiverPropertyOverride.kt"); - } - - @Test - @TestMetadata("implicitTypeInFakeOverride.kt") - public void testImplicitTypeInFakeOverride() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/implicitTypeInFakeOverride.kt"); - } - - @Test - @TestMetadata("incorrectSuperCall.kt") - public void testIncorrectSuperCall() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/incorrectSuperCall.kt"); - } - - @Test - @TestMetadata("intersectionScope.kt") - public void testIntersectionScope() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/intersectionScope.kt"); - } - - @Test - @TestMetadata("intersectionTypes.kt") - public void testIntersectionTypes() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/intersectionTypes.kt"); - } - - @Test - @TestMetadata("invokeInWhenSubjectVariableInitializer.kt") - public void testInvokeInWhenSubjectVariableInitializer() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/invokeInWhenSubjectVariableInitializer.kt"); - } - - @Test - @TestMetadata("invokeOfLambdaWithReceiver.kt") - public void testInvokeOfLambdaWithReceiver() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/invokeOfLambdaWithReceiver.kt"); - } - - @Test - @TestMetadata("javaFieldVsAccessor.kt") - public void testJavaFieldVsAccessor() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/javaFieldVsAccessor.kt"); - } - - @Test - @TestMetadata("javaStaticScopeInheritance.kt") - public void testJavaStaticScopeInheritance() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/javaStaticScopeInheritance.kt"); - } - - @Test - @TestMetadata("kt41984.kt") - public void testKt41984() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/kt41984.kt"); - } - - @Test - @TestMetadata("kt41990.kt") - public void testKt41990() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/kt41990.kt"); - } - - @Test - @TestMetadata("labelAndReceiverForInfix.kt") - public void testLabelAndReceiverForInfix() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/labelAndReceiverForInfix.kt"); - } - - @Test - @TestMetadata("lambdaArgInScopeFunction.kt") - public void testLambdaArgInScopeFunction() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/lambdaArgInScopeFunction.kt"); - } - - @Test - @TestMetadata("lambdaInLhsOfTypeOperatorCall.kt") - public void testLambdaInLhsOfTypeOperatorCall() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/lambdaInLhsOfTypeOperatorCall.kt"); - } - - @Test - @TestMetadata("lambdaPropertyTypeInference.kt") - public void testLambdaPropertyTypeInference() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/lambdaPropertyTypeInference.kt"); - } - - @Test - @TestMetadata("localFunctionsHiding.kt") - public void testLocalFunctionsHiding() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/localFunctionsHiding.kt"); - } - - @Test - @TestMetadata("localObject.kt") - public void testLocalObject() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/localObject.kt"); - } - - @Test - @TestMetadata("nestedClass.kt") - public void testNestedClass() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/nestedClass.kt"); - } - - @Test - @TestMetadata("nestedClassContructor.kt") - public void testNestedClassContructor() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/nestedClassContructor.kt"); - } - - @Test - @TestMetadata("nestedClassNameClash.kt") - public void testNestedClassNameClash() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/nestedClassNameClash.kt"); - } - - @Test - @TestMetadata("NestedOfAliasedType.kt") - public void testNestedOfAliasedType() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/NestedOfAliasedType.kt"); - } - - @Test - @TestMetadata("nestedReturnType.kt") - public void testNestedReturnType() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/nestedReturnType.kt"); - } - - @Test - @TestMetadata("NestedSuperType.kt") - public void testNestedSuperType() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/NestedSuperType.kt"); - } - - @Test - @TestMetadata("objectInnerClass.kt") - public void testObjectInnerClass() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/objectInnerClass.kt"); - } - - @Test - @TestMetadata("offOrderMultiBoundGenericOverride.kt") - public void testOffOrderMultiBoundGenericOverride() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/offOrderMultiBoundGenericOverride.kt"); - } - - @Test - @TestMetadata("openInInterface.kt") - public void testOpenInInterface() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/openInInterface.kt"); - } - - @Test - @TestMetadata("problems2.kt") - public void testProblems2() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/problems2.kt"); - } - - @Test - @TestMetadata("propertyFromJavaPlusAssign.kt") - public void testPropertyFromJavaPlusAssign() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/propertyFromJavaPlusAssign.kt"); - } - - @Test - @TestMetadata("qualifierWithCompanion.kt") - public void testQualifierWithCompanion() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/qualifierWithCompanion.kt"); - } - - @Test - @TestMetadata("rawTypeSam.kt") - public void testRawTypeSam() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/rawTypeSam.kt"); - } - - @Test - @TestMetadata("recursiveCallOnWhenWithSealedClass.kt") - public void testRecursiveCallOnWhenWithSealedClass() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/recursiveCallOnWhenWithSealedClass.kt"); - } - - @Test - @TestMetadata("sealedClass.kt") - public void testSealedClass() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/sealedClass.kt"); - } - - @Test - @TestMetadata("simpleClass.kt") - public void testSimpleClass() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/simpleClass.kt"); - } - - @Test - @TestMetadata("simpleTypeAlias.kt") - public void testSimpleTypeAlias() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/simpleTypeAlias.kt"); - } - - @Test - @TestMetadata("spreadOperator.kt") - public void testSpreadOperator() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/spreadOperator.kt"); - } - - @Test - @TestMetadata("statusResolveForTypealiasAsSuperClass.kt") - public void testStatusResolveForTypealiasAsSuperClass() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/statusResolveForTypealiasAsSuperClass.kt"); - } - - @Test - @TestMetadata("syntheticsVsNormalProperties.kt") - public void testSyntheticsVsNormalProperties() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/syntheticsVsNormalProperties.kt"); - } - - @Test - @TestMetadata("treeSet.kt") - public void testTreeSet() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/treeSet.kt"); - } - - @Test - @TestMetadata("tryInference.kt") - public void testTryInference() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/tryInference.kt"); - } - - @Test - @TestMetadata("TwoDeclarationsInSameFile.kt") - public void testTwoDeclarationsInSameFile() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/TwoDeclarationsInSameFile.kt"); - } - - @Test - @TestMetadata("typeAliasWithGeneric.kt") - public void testTypeAliasWithGeneric() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/typeAliasWithGeneric.kt"); - } - - @Test - @TestMetadata("typeAliasWithTypeArguments.kt") - public void testTypeAliasWithTypeArguments() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/typeAliasWithTypeArguments.kt"); - } - - @Test - @TestMetadata("typeFromGetter.kt") - public void testTypeFromGetter() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/typeFromGetter.kt"); - } - - @Test - @TestMetadata("typeParameterInPropertyReceiver.kt") - public void testTypeParameterInPropertyReceiver() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/typeParameterInPropertyReceiver.kt"); - } - - @Test - @TestMetadata("typeParameterVsNested.kt") - public void testTypeParameterVsNested() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/typeParameterVsNested.kt"); - } - - @Test - @TestMetadata("typesInLocalFunctions.kt") - public void testTypesInLocalFunctions() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/typesInLocalFunctions.kt"); - } - - @Test - @TestMetadata("varargInPrimaryConstructor.kt") - public void testVarargInPrimaryConstructor() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/varargInPrimaryConstructor.kt"); - } - - @Test - @TestMetadata("whenAsReceiver.kt") - public void testWhenAsReceiver() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/whenAsReceiver.kt"); - } - - @Test - @TestMetadata("whenElse.kt") - public void testWhenElse() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/whenElse.kt"); - } - - @Test - @TestMetadata("whenExpressionType.kt") - public void testWhenExpressionType() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/whenExpressionType.kt"); - } - - @Test - @TestMetadata("whenInference.kt") - public void testWhenInference() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/whenInference.kt"); - } - @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/arguments") + @TestMetadata("compiler/fir/analysis-tests/testData/resolve") @TestDataPath("$PROJECT_ROOT") @Execution(ExecutionMode.SAME_THREAD) - public class Arguments extends AbstractFirDiagnosticsWithLightTreeTest { + public class Resolve extends AbstractFirDiagnosticsWithLightTreeTest { @Test - public void testAllFilesPresentInArguments() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/arguments"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + public void testAllFilesPresentInResolve() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } @Test - @TestMetadata("ambiguityOnJavaOverride.kt") - public void testAmbiguityOnJavaOverride() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/arguments/ambiguityOnJavaOverride.kt"); + @TestMetadata("asImports.kt") + public void testAsImports() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/asImports.kt"); } @Test - @TestMetadata("argumentsOfAnnotations.kt") - public void testArgumentsOfAnnotations() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/arguments/argumentsOfAnnotations.kt"); + @TestMetadata("bareTypes.kt") + public void testBareTypes() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/bareTypes.kt"); } @Test - @TestMetadata("argumentsOfJavaAnnotation.kt") - public void testArgumentsOfJavaAnnotation() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/arguments/argumentsOfJavaAnnotation.kt"); + @TestMetadata("bareTypes2.kt") + public void testBareTypes2() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/bareTypes2.kt"); } @Test - @TestMetadata("default.kt") - public void testDefault() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/arguments/default.kt"); + @TestMetadata("bareTypesWithFlexibleArguments.kt") + public void testBareTypesWithFlexibleArguments() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/bareTypesWithFlexibleArguments.kt"); } @Test - @TestMetadata("defaultFromOverrides.kt") - public void testDefaultFromOverrides() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/arguments/defaultFromOverrides.kt"); - } - - @Test - @TestMetadata("definetelyNotNullForTypeParameter.kt") - public void testDefinetelyNotNullForTypeParameter() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/arguments/definetelyNotNullForTypeParameter.kt"); - } - - @Test - @TestMetadata("extensionLambdaInDefaultArgument.kt") - public void testExtensionLambdaInDefaultArgument() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/arguments/extensionLambdaInDefaultArgument.kt"); - } - - @Test - @TestMetadata("fieldPlusAssign.kt") - public void testFieldPlusAssign() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/arguments/fieldPlusAssign.kt"); - } - - @Test - @TestMetadata("incorrectFunctionalType.kt") - public void testIncorrectFunctionalType() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/arguments/incorrectFunctionalType.kt"); - } - - @Test - @TestMetadata("integerLiteralTypes.kt") - public void testIntegerLiteralTypes() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/arguments/integerLiteralTypes.kt"); - } - - @Test - @TestMetadata("invoke.kt") - public void testInvoke() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/arguments/invoke.kt"); - } - - @Test - @TestMetadata("javaAnnotationsWithArrayValue.kt") - public void testJavaAnnotationsWithArrayValue() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/arguments/javaAnnotationsWithArrayValue.kt"); - } - - @Test - @TestMetadata("javaArrayVariance.kt") - public void testJavaArrayVariance() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/arguments/javaArrayVariance.kt"); - } - - @Test - @TestMetadata("kt41940.kt") - public void testKt41940() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/arguments/kt41940.kt"); - } - - @Test - @TestMetadata("lambda.kt") - public void testLambda() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/arguments/lambda.kt"); - } - - @Test - @TestMetadata("lambdaInLambda.kt") - public void testLambdaInLambda() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/arguments/lambdaInLambda.kt"); - } - - @Test - @TestMetadata("lambdaInLambda2.kt") - public void testLambdaInLambda2() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/arguments/lambdaInLambda2.kt"); - } - - @Test - @TestMetadata("lambdaInUnresolvedCall.kt") - public void testLambdaInUnresolvedCall() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/arguments/lambdaInUnresolvedCall.kt"); - } - - @Test - @TestMetadata("namedArrayInAnnotation.kt") - public void testNamedArrayInAnnotation() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/arguments/namedArrayInAnnotation.kt"); - } - - @Test - @TestMetadata("operatorsOverLiterals.kt") - public void testOperatorsOverLiterals() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/arguments/operatorsOverLiterals.kt"); - } - - @Test - @TestMetadata("overloadByReceiver.kt") - public void testOverloadByReceiver() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/arguments/overloadByReceiver.kt"); - } - - @Test - @TestMetadata("overloadWithDefault.kt") - public void testOverloadWithDefault() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/arguments/overloadWithDefault.kt"); - } - - @Test - @TestMetadata("simple.kt") - public void testSimple() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/arguments/simple.kt"); - } - - @Test - @TestMetadata("stringTemplates.kt") - public void testStringTemplates() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/arguments/stringTemplates.kt"); - } - - @Test - @TestMetadata("tryInLambda.kt") - public void testTryInLambda() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/arguments/tryInLambda.kt"); - } - - @Test - @TestMetadata("untouchedReturnInIf.kt") - public void testUntouchedReturnInIf() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/arguments/untouchedReturnInIf.kt"); - } - - @Test - @TestMetadata("vararg.kt") - public void testVararg() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/arguments/vararg.kt"); - } - - @Test - @TestMetadata("varargOfLambdasWithReceiver.kt") - public void testVarargOfLambdasWithReceiver() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/arguments/varargOfLambdasWithReceiver.kt"); - } - - @Test - @TestMetadata("varargProjection.kt") - public void testVarargProjection() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/arguments/varargProjection.kt"); - } - } - - @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/arrays") - @TestDataPath("$PROJECT_ROOT") - @Execution(ExecutionMode.SAME_THREAD) - public class Arrays extends AbstractFirDiagnosticsWithLightTreeTest { - @Test - public void testAllFilesPresentInArrays() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/arrays"), Pattern.compile("^([^.]+)\\.kt$"), null, true); - } - - @Test - @TestMetadata("arraySet.kt") - public void testArraySet() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/arrays/arraySet.kt"); - } - - @Test - @TestMetadata("arraySetWithOperation.kt") - public void testArraySetWithOperation() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/arrays/arraySetWithOperation.kt"); - } - } - - @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/builtins") - @TestDataPath("$PROJECT_ROOT") - @Execution(ExecutionMode.SAME_THREAD) - public class Builtins extends AbstractFirDiagnosticsWithLightTreeTest { - @Test - public void testAllFilesPresentInBuiltins() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/builtins"), Pattern.compile("^([^.]+)\\.kt$"), null, true); - } - - @Test - @TestMetadata("lists.kt") - public void testLists() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/builtins/lists.kt"); - } - } - - @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/callResolution") - @TestDataPath("$PROJECT_ROOT") - @Execution(ExecutionMode.SAME_THREAD) - public class CallResolution extends AbstractFirDiagnosticsWithLightTreeTest { - @Test - public void testAllFilesPresentInCallResolution() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/callResolution"), Pattern.compile("^([^.]+)\\.kt$"), null, true); - } - - @Test - @TestMetadata("companionInvoke.kt") - public void testCompanionInvoke() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/companionInvoke.kt"); - } - - @Test - @TestMetadata("companionVsSuperStatic.kt") - public void testCompanionVsSuperStatic() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/companionVsSuperStatic.kt"); - } - - @Test - @TestMetadata("debugExpressionType.kt") - public void testDebugExpressionType() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/debugExpressionType.kt"); - } - - @Test - @TestMetadata("debugInfoCall.kt") - public void testDebugInfoCall() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/debugInfoCall.kt"); - } - - @Test - @TestMetadata("errorCandidates.kt") - public void testErrorCandidates() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/errorCandidates.kt"); - } - - @Test - @TestMetadata("extensionInvokeAfterSafeCall.kt") - public void testExtensionInvokeAfterSafeCall() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/extensionInvokeAfterSafeCall.kt"); - } - - @Test - @TestMetadata("invokeAmbiguity.kt") - public void testInvokeAmbiguity() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/invokeAmbiguity.kt"); - } - - @Test - @TestMetadata("invokeWithReceiverAndArgument.kt") - public void testInvokeWithReceiverAndArgument() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/invokeWithReceiverAndArgument.kt"); - } - - @Test - @TestMetadata("lambdaAsReceiver.kt") - public void testLambdaAsReceiver() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/lambdaAsReceiver.kt"); - } - - @Test - @TestMetadata("objectInvoke.kt") - public void testObjectInvoke() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/objectInvoke.kt"); - } - - @Test - @TestMetadata("safeCallOnTypeAlias.kt") - public void testSafeCallOnTypeAlias() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/safeCallOnTypeAlias.kt"); - } - - @Test - @TestMetadata("superAny.kt") - public void testSuperAny() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/superAny.kt"); - } - - @Test - @TestMetadata("syntheticPropertiesWrongImplicitReceiver.kt") - public void testSyntheticPropertiesWrongImplicitReceiver() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/syntheticPropertiesWrongImplicitReceiver.kt"); - } - - @Test - @TestMetadata("typeAliasWithNotNullBound.kt") - public void testTypeAliasWithNotNullBound() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/typeAliasWithNotNullBound.kt"); - } - - @Test - @TestMetadata("uselessMultipleBounds.kt") - public void testUselessMultipleBounds() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/uselessMultipleBounds.kt"); - } - } - - @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/cfg") - @TestDataPath("$PROJECT_ROOT") - @Execution(ExecutionMode.SAME_THREAD) - public class Cfg extends AbstractFirDiagnosticsWithLightTreeTest { - @Test - public void testAllFilesPresentInCfg() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/cfg"), Pattern.compile("^([^.]+)\\.kt$"), null, true); - } - - @Test - @TestMetadata("annotatedLocalClass.kt") - public void testAnnotatedLocalClass() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/cfg/annotatedLocalClass.kt"); - } - - @Test - @TestMetadata("binaryOperations.kt") - public void testBinaryOperations() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/cfg/binaryOperations.kt"); - } - - @Test - @TestMetadata("booleanOperatorsWithConsts.kt") - public void testBooleanOperatorsWithConsts() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/cfg/booleanOperatorsWithConsts.kt"); - } - - @Test - @TestMetadata("complex.kt") - public void testComplex() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/cfg/complex.kt"); - } - - @Test - @TestMetadata("defaultArguments.kt") - public void testDefaultArguments() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/cfg/defaultArguments.kt"); - } - - @Test - @TestMetadata("emptyWhen.kt") - public void testEmptyWhen() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/cfg/emptyWhen.kt"); - } - - @Test - @TestMetadata("flowFromInplaceLambda.kt") - public void testFlowFromInplaceLambda() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/cfg/flowFromInplaceLambda.kt"); - } - - @Test - @TestMetadata("initBlock.kt") - public void testInitBlock() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/cfg/initBlock.kt"); - } - - @Test - @TestMetadata("initBlockAndInPlaceLambda.kt") - public void testInitBlockAndInPlaceLambda() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/cfg/initBlockAndInPlaceLambda.kt"); - } - - @Test - @TestMetadata("innerClassInAnonymousObject.kt") - public void testInnerClassInAnonymousObject() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/cfg/innerClassInAnonymousObject.kt"); - } - - @Test - @TestMetadata("inplaceLambdaInControlFlowExpressions.kt") - public void testInplaceLambdaInControlFlowExpressions() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/cfg/inplaceLambdaInControlFlowExpressions.kt"); - } - - @Test - @TestMetadata("jumps.kt") - public void testJumps() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/cfg/jumps.kt"); - } - - @Test - @TestMetadata("lambdaAsReturnOfLambda.kt") - public void testLambdaAsReturnOfLambda() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/cfg/lambdaAsReturnOfLambda.kt"); - } - - @Test - @TestMetadata("lambdaReturningObject.kt") - public void testLambdaReturningObject() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/cfg/lambdaReturningObject.kt"); - } - - @Test - @TestMetadata("lambdas.kt") - public void testLambdas() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/cfg/lambdas.kt"); - } - - @Test - @TestMetadata("localClassesWithImplicit.kt") - public void testLocalClassesWithImplicit() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/cfg/localClassesWithImplicit.kt"); - } - - @Test - @TestMetadata("loops.kt") - public void testLoops() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/cfg/loops.kt"); - } - - @Test - @TestMetadata("postponedLambdaInConstructor.kt") - public void testPostponedLambdaInConstructor() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/cfg/postponedLambdaInConstructor.kt"); - } - - @Test - @TestMetadata("postponedLambdas.kt") - public void testPostponedLambdas() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/cfg/postponedLambdas.kt"); - } - - @Test - @TestMetadata("propertiesAndInitBlocks.kt") - public void testPropertiesAndInitBlocks() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/cfg/propertiesAndInitBlocks.kt"); - } - - @Test - @TestMetadata("returnValuesFromLambda.kt") - public void testReturnValuesFromLambda() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/cfg/returnValuesFromLambda.kt"); - } - - @Test - @TestMetadata("safeCalls.kt") - public void testSafeCalls() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/cfg/safeCalls.kt"); - } - - @Test - @TestMetadata("simple.kt") - public void testSimple() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/cfg/simple.kt"); - } - - @Test - @TestMetadata("tryCatch.kt") - public void testTryCatch() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/cfg/tryCatch.kt"); - } - - @Test - @TestMetadata("when.kt") - public void testWhen() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/cfg/when.kt"); - } - } - - @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/constructors") - @TestDataPath("$PROJECT_ROOT") - @Execution(ExecutionMode.SAME_THREAD) - public class Constructors extends AbstractFirDiagnosticsWithLightTreeTest { - @Test - public void testAllFilesPresentInConstructors() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/constructors"), Pattern.compile("^([^.]+)\\.kt$"), null, true); - } - - @Test - @TestMetadata("noSuperCallInSupertypes.kt") - public void testNoSuperCallInSupertypes() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/constructors/noSuperCallInSupertypes.kt"); - } - } - - @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/delegates") - @TestDataPath("$PROJECT_ROOT") - @Execution(ExecutionMode.SAME_THREAD) - public class Delegates extends AbstractFirDiagnosticsWithLightTreeTest { - @Test - public void testAllFilesPresentInDelegates() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/delegates"), Pattern.compile("^([^.]+)\\.kt$"), null, true); - } - - @Test - @TestMetadata("delegateInference.kt") - public void testDelegateInference() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/delegates/delegateInference.kt"); - } - - @Test - @TestMetadata("delegateWithLambda.kt") - public void testDelegateWithLambda() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/delegates/delegateWithLambda.kt"); - } - - @Test - @TestMetadata("extensionGenericGetValue.kt") - public void testExtensionGenericGetValue() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/delegates/extensionGenericGetValue.kt"); - } - - @Test - @TestMetadata("extensionGetValueWithTypeVariableAsReceiver.kt") - public void testExtensionGetValueWithTypeVariableAsReceiver() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/delegates/extensionGetValueWithTypeVariableAsReceiver.kt"); - } - - @Test - @TestMetadata("kt41982.kt") - public void testKt41982() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/delegates/kt41982.kt"); - } - - @Test - @TestMetadata("provideDelegate.kt") - public void testProvideDelegate() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/delegates/provideDelegate.kt"); - } - } - - @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/diagnostics") - @TestDataPath("$PROJECT_ROOT") - @Execution(ExecutionMode.SAME_THREAD) - public class Diagnostics extends AbstractFirDiagnosticsWithLightTreeTest { - @Test - @TestMetadata("abstractSuperCall.kt") - public void testAbstractSuperCall() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/abstractSuperCall.kt"); - } - - @Test - @TestMetadata("abstractSuperCallInPresenseOfNonAbstractMethodInParent.kt") - public void testAbstractSuperCallInPresenseOfNonAbstractMethodInParent() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/abstractSuperCallInPresenseOfNonAbstractMethodInParent.kt"); - } - - @Test - public void testAllFilesPresentInDiagnostics() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/diagnostics"), Pattern.compile("^([^.]+)\\.kt$"), null, true); - } - - @Test - @TestMetadata("annotationArgumentKClassLiteralTypeError.kt") - public void testAnnotationArgumentKClassLiteralTypeError() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/annotationArgumentKClassLiteralTypeError.kt"); - } - - @Test - @TestMetadata("annotationArgumentMustBeConst.kt") - public void testAnnotationArgumentMustBeConst() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/annotationArgumentMustBeConst.kt"); - } - - @Test - @TestMetadata("annotationArgumentMustBeEnumConst.kt") - public void testAnnotationArgumentMustBeEnumConst() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/annotationArgumentMustBeEnumConst.kt"); - } - - @Test - @TestMetadata("annotationArgumentMustBeKClassLiteral.kt") - public void testAnnotationArgumentMustBeKClassLiteral() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/annotationArgumentMustBeKClassLiteral.kt"); - } - - @Test - @TestMetadata("annotationClassMember.kt") - public void testAnnotationClassMember() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/annotationClassMember.kt"); - } - - @Test - @TestMetadata("anonymousObjectByDelegate.kt") - public void testAnonymousObjectByDelegate() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/anonymousObjectByDelegate.kt"); - } - - @Test - @TestMetadata("classInSupertypeForEnum.kt") - public void testClassInSupertypeForEnum() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/classInSupertypeForEnum.kt"); - } - - @Test - @TestMetadata("conflictingOverloads.kt") - public void testConflictingOverloads() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/conflictingOverloads.kt"); - } - - @Test - @TestMetadata("conflictingProjection.kt") - public void testConflictingProjection() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/conflictingProjection.kt"); - } - - @Test - @TestMetadata("constructorInInterface.kt") - public void testConstructorInInterface() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/constructorInInterface.kt"); - } - - @Test - @TestMetadata("cyclicConstructorDelegationCall.kt") - public void testCyclicConstructorDelegationCall() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/cyclicConstructorDelegationCall.kt"); - } - - @Test - @TestMetadata("delegationInInterface.kt") - public void testDelegationInInterface() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/delegationInInterface.kt"); - } - - @Test - @TestMetadata("delegationSuperCallInEnumConstructor.kt") - public void testDelegationSuperCallInEnumConstructor() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/delegationSuperCallInEnumConstructor.kt"); - } - - @Test - @TestMetadata("explicitDelegationCallRequired.kt") - public void testExplicitDelegationCallRequired() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/explicitDelegationCallRequired.kt"); - } - - @Test - @TestMetadata("inapplicableLateinitModifier.kt") - public void testInapplicableLateinitModifier() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/inapplicableLateinitModifier.kt"); - } - - @Test - @TestMetadata("incompatibleModifiers.kt") - public void testIncompatibleModifiers() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/incompatibleModifiers.kt"); - } - - @Test - @TestMetadata("infixFunctions.kt") - public void testInfixFunctions() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/infixFunctions.kt"); - } - - @Test - @TestMetadata("instanceAccessBeforeSuperCall.kt") - public void testInstanceAccessBeforeSuperCall() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/instanceAccessBeforeSuperCall.kt"); - } - - @Test - @TestMetadata("interfaceWithSuperclass.kt") - public void testInterfaceWithSuperclass() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/interfaceWithSuperclass.kt"); - } - - @Test - @TestMetadata("localAnnotationClass.kt") - public void testLocalAnnotationClass() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/localAnnotationClass.kt"); - } - - @Test - @TestMetadata("localEntitytNotAllowed.kt") - public void testLocalEntitytNotAllowed() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/localEntitytNotAllowed.kt"); - } - - @Test - @TestMetadata("manyCompanionObjects.kt") - public void testManyCompanionObjects() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/manyCompanionObjects.kt"); - } - - @Test - @TestMetadata("methodOfAnyImplementedInInterface.kt") - public void testMethodOfAnyImplementedInInterface() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/methodOfAnyImplementedInInterface.kt"); - } - - @Test - @TestMetadata("nonConstValInAnnotationArgument.kt") - public void testNonConstValInAnnotationArgument() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/nonConstValInAnnotationArgument.kt"); - } - - @Test - @TestMetadata("notASupertype.kt") - public void testNotASupertype() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/notASupertype.kt"); - } - - @Test - @TestMetadata("primaryConstructorRequiredForDataClass.kt") - public void testPrimaryConstructorRequiredForDataClass() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/primaryConstructorRequiredForDataClass.kt"); - } - - @Test - @TestMetadata("projectionsOnNonClassTypeArguments.kt") - public void testProjectionsOnNonClassTypeArguments() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/projectionsOnNonClassTypeArguments.kt"); - } - - @Test - @TestMetadata("propertyTypeMismatchOnOverride.kt") - public void testPropertyTypeMismatchOnOverride() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/propertyTypeMismatchOnOverride.kt"); - } - - @Test - @TestMetadata("qualifiedSupertypeExtendedByOtherSupertype.kt") - public void testQualifiedSupertypeExtendedByOtherSupertype() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/qualifiedSupertypeExtendedByOtherSupertype.kt"); - } - - @Test - @TestMetadata("redundantModifier.kt") - public void testRedundantModifier() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/redundantModifier.kt"); - } - - @Test - @TestMetadata("repeatedModifier.kt") - public void testRepeatedModifier() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/repeatedModifier.kt"); - } - - @Test - @TestMetadata("returnTypeMismatchOnOverride.kt") - public void testReturnTypeMismatchOnOverride() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/returnTypeMismatchOnOverride.kt"); - } - - @Test - @TestMetadata("sealedClassConstructorCall.kt") - public void testSealedClassConstructorCall() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/sealedClassConstructorCall.kt"); - } - - @Test - @TestMetadata("sealedSupertype.kt") - public void testSealedSupertype() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/sealedSupertype.kt"); - } - - @Test - @TestMetadata("someOverridesTest.kt") - public void testSomeOverridesTest() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/someOverridesTest.kt"); - } - - @Test - @TestMetadata("superCallWithDelegation.kt") - public void testSuperCallWithDelegation() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/superCallWithDelegation.kt"); - } - - @Test - @TestMetadata("superIsNotAnExpression.kt") - public void testSuperIsNotAnExpression() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/superIsNotAnExpression.kt"); - } - - @Test - @TestMetadata("superNotAvailable.kt") - public void testSuperNotAvailable() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/superNotAvailable.kt"); - } - - @Test - @TestMetadata("superclassNotAccessibleFromInterface.kt") - public void testSuperclassNotAccessibleFromInterface() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/superclassNotAccessibleFromInterface.kt"); - } - - @Test - @TestMetadata("supertypeInitializedInInterface.kt") - public void testSupertypeInitializedInInterface() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/supertypeInitializedInInterface.kt"); - } - - @Test - @TestMetadata("supertypeInitializedWithoutPrimaryConstructor.kt") - public void testSupertypeInitializedWithoutPrimaryConstructor() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/supertypeInitializedWithoutPrimaryConstructor.kt"); - } - - @Test - @TestMetadata("testIllegalAnnotationClass.kt") - public void testTestIllegalAnnotationClass() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/testIllegalAnnotationClass.kt"); - } - - @Test - @TestMetadata("typeArgumentsNotAllowed.kt") - public void testTypeArgumentsNotAllowed() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/typeArgumentsNotAllowed.kt"); - } - - @Test - @TestMetadata("typeOfAnnotationMember.kt") - public void testTypeOfAnnotationMember() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/typeOfAnnotationMember.kt"); - } - - @Test - @TestMetadata("typeParametersInEnum.kt") - public void testTypeParametersInEnum() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/typeParametersInEnum.kt"); - } - - @Test - @TestMetadata("typeParametersInObject.kt") - public void testTypeParametersInObject() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/typeParametersInObject.kt"); - } - - @Test - @TestMetadata("upperBoundViolated.kt") - public void testUpperBoundViolated() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/upperBoundViolated.kt"); - } - - @Test - @TestMetadata("valOnAnnotationParameter.kt") - public void testValOnAnnotationParameter() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/valOnAnnotationParameter.kt"); - } - - @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/diagnostics/functionAsExpression") - @TestDataPath("$PROJECT_ROOT") - @Execution(ExecutionMode.SAME_THREAD) - public class FunctionAsExpression extends AbstractFirDiagnosticsWithLightTreeTest { - @Test - public void testAllFilesPresentInFunctionAsExpression() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/diagnostics/functionAsExpression"), Pattern.compile("^([^.]+)\\.kt$"), null, true); - } - - @Test - @TestMetadata("Parameters.kt") - public void testParameters() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/functionAsExpression/Parameters.kt"); - } - } - } - - @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/expresssions") - @TestDataPath("$PROJECT_ROOT") - @Execution(ExecutionMode.SAME_THREAD) - public class Expresssions extends AbstractFirDiagnosticsWithLightTreeTest { - @Test - @TestMetadata("access.kt") - public void testAccess() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/access.kt"); - } - - @Test - public void testAllFilesPresentInExpresssions() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/expresssions"), Pattern.compile("^([^.]+)\\.kt$"), null, true); - } - - @Test - @TestMetadata("annotationWithReturn.kt") - public void testAnnotationWithReturn() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/annotationWithReturn.kt"); - } - - @Test - @TestMetadata("annotations.kt") - public void testAnnotations() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/annotations.kt"); - } - - @Test - @TestMetadata("baseQualifier.kt") - public void testBaseQualifier() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/baseQualifier.kt"); - } - - @Test - @TestMetadata("blockLocalScopes.kt") - public void testBlockLocalScopes() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/blockLocalScopes.kt"); - } - - @Test - @TestMetadata("CallBasedInExpressionGenerator.kt") - public void testCallBasedInExpressionGenerator() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/CallBasedInExpressionGenerator.kt"); - } - - @Test - @TestMetadata("checkArguments.kt") - public void testCheckArguments() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/checkArguments.kt"); - } - - @Test - @TestMetadata("classifierAccessFromCompanion.kt") - public void testClassifierAccessFromCompanion() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/classifierAccessFromCompanion.kt"); + @TestMetadata("cast.kt") + public void testCast() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/cast.kt"); } @Test @TestMetadata("companion.kt") public void testCompanion() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/companion.kt"); + runTest("compiler/fir/analysis-tests/testData/resolve/companion.kt"); } @Test - @TestMetadata("companionExtension.kt") - public void testCompanionExtension() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/companionExtension.kt"); + @TestMetadata("companionAccessInEnum.kt") + public void testCompanionAccessInEnum() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/companionAccessInEnum.kt"); } @Test - @TestMetadata("constructor.kt") - public void testConstructor() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/constructor.kt"); + @TestMetadata("companionObjectCall.kt") + public void testCompanionObjectCall() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/companionObjectCall.kt"); } @Test - @TestMetadata("dispatchReceiver.kt") - public void testDispatchReceiver() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/dispatchReceiver.kt"); + @TestMetadata("companionUsesNested.kt") + public void testCompanionUsesNested() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/companionUsesNested.kt"); } @Test - @TestMetadata("enumEntryUse.kt") - public void testEnumEntryUse() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/enumEntryUse.kt"); + @TestMetadata("constantValues.kt") + public void testConstantValues() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/constantValues.kt"); } @Test - @TestMetadata("enumValues.kt") - public void testEnumValues() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/enumValues.kt"); + @TestMetadata("copy.kt") + public void testCopy() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/copy.kt"); } @Test - @TestMetadata("errCallable.kt") - public void testErrCallable() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/errCallable.kt"); + @TestMetadata("covariantArrayAsReceiver.kt") + public void testCovariantArrayAsReceiver() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/covariantArrayAsReceiver.kt"); } @Test - @TestMetadata("extensionPropertyInLambda.kt") - public void testExtensionPropertyInLambda() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/extensionPropertyInLambda.kt"); + @TestMetadata("defaultJavaImportHiding.kt") + public void testDefaultJavaImportHiding() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/defaultJavaImportHiding.kt"); } @Test - @TestMetadata("genericDecorator.kt") - public void testGenericDecorator() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/genericDecorator.kt"); + @TestMetadata("defaultParametersInheritedToJava.kt") + public void testDefaultParametersInheritedToJava() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/defaultParametersInheritedToJava.kt"); } @Test - @TestMetadata("genericDescriptor.kt") - public void testGenericDescriptor() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/genericDescriptor.kt"); + @TestMetadata("definitelyNotNullAmbiguity.kt") + public void testDefinitelyNotNullAmbiguity() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/definitelyNotNullAmbiguity.kt"); } @Test - @TestMetadata("genericDiagnostic.kt") - public void testGenericDiagnostic() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/genericDiagnostic.kt"); + @TestMetadata("delegatedSuperType.kt") + public void testDelegatedSuperType() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/delegatedSuperType.kt"); } @Test - @TestMetadata("genericPropertyAccess.kt") - public void testGenericPropertyAccess() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/genericPropertyAccess.kt"); + @TestMetadata("delegatingConstructorCall.kt") + public void testDelegatingConstructorCall() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/delegatingConstructorCall.kt"); } @Test - @TestMetadata("genericUsedInFunction.kt") - public void testGenericUsedInFunction() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/genericUsedInFunction.kt"); + @TestMetadata("delegatingConstructorsAndTypeAliases.kt") + public void testDelegatingConstructorsAndTypeAliases() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/delegatingConstructorsAndTypeAliases.kt"); } @Test - @TestMetadata("importedReceiver.kt") - public void testImportedReceiver() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/importedReceiver.kt"); + @TestMetadata("derivedClass.kt") + public void testDerivedClass() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/derivedClass.kt"); } @Test - @TestMetadata("innerQualifier.kt") - public void testInnerQualifier() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/innerQualifier.kt"); + @TestMetadata("enum.kt") + public void testEnum() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/enum.kt"); } @Test - @TestMetadata("innerWithSuperCompanion.kt") - public void testInnerWithSuperCompanion() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/innerWithSuperCompanion.kt"); + @TestMetadata("enumWithCompanion.kt") + public void testEnumWithCompanion() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/enumWithCompanion.kt"); } @Test - @TestMetadata("javaFieldCallable.kt") - public void testJavaFieldCallable() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/javaFieldCallable.kt"); + @TestMetadata("exhaustiveWhenAndDNNType.kt") + public void testExhaustiveWhenAndDNNType() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/exhaustiveWhenAndDNNType.kt"); } @Test - @TestMetadata("lambda.kt") - public void testLambda() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/lambda.kt"); + @TestMetadata("exhaustiveWhenAndFlexibleType.kt") + public void testExhaustiveWhenAndFlexibleType() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/exhaustiveWhenAndFlexibleType.kt"); } @Test - @TestMetadata("lambdaWithReceiver.kt") - public void testLambdaWithReceiver() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/lambdaWithReceiver.kt"); + @TestMetadata("exhaustiveness_boolean.kt") + public void testExhaustiveness_boolean() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/exhaustiveness_boolean.kt"); } @Test - @TestMetadata("localClassAccessesContainingClass.kt") - public void testLocalClassAccessesContainingClass() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/localClassAccessesContainingClass.kt"); + @TestMetadata("exhaustiveness_enum.kt") + public void testExhaustiveness_enum() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/exhaustiveness_enum.kt"); } @Test - @TestMetadata("localConstructor.kt") - public void testLocalConstructor() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/localConstructor.kt"); + @TestMetadata("exhaustiveness_enumJava.kt") + public void testExhaustiveness_enumJava() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/exhaustiveness_enumJava.kt"); } @Test - @TestMetadata("localExtension.kt") - public void testLocalExtension() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/localExtension.kt"); + @TestMetadata("exhaustiveness_sealedClass.kt") + public void testExhaustiveness_sealedClass() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/exhaustiveness_sealedClass.kt"); } @Test - @TestMetadata("localImplicitBodies.kt") - public void testLocalImplicitBodies() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/localImplicitBodies.kt"); + @TestMetadata("exhaustiveness_sealedObject.kt") + public void testExhaustiveness_sealedObject() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/exhaustiveness_sealedObject.kt"); } @Test - @TestMetadata("localInnerClass.kt") - public void testLocalInnerClass() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/localInnerClass.kt"); + @TestMetadata("exhaustiveness_sealedSubClass.kt") + public void testExhaustiveness_sealedSubClass() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/exhaustiveness_sealedSubClass.kt"); } @Test - @TestMetadata("localObjects.kt") - public void testLocalObjects() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/localObjects.kt"); + @TestMetadata("extension.kt") + public void testExtension() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extension.kt"); } @Test - @TestMetadata("localScopes.kt") - public void testLocalScopes() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/localScopes.kt"); + @TestMetadata("F.kt") + public void testF() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/F.kt"); } @Test - @TestMetadata("localTypes.kt") - public void testLocalTypes() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/localTypes.kt"); + @TestMetadata("fakeRecursiveSupertype.kt") + public void testFakeRecursiveSupertype() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/fakeRecursiveSupertype.kt"); } @Test - @TestMetadata("localWithBooleanNot.kt") - public void testLocalWithBooleanNot() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/localWithBooleanNot.kt"); + @TestMetadata("fakeRecursiveTypealias.kt") + public void testFakeRecursiveTypealias() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/fakeRecursiveTypealias.kt"); } @Test - @TestMetadata("memberExtension.kt") - public void testMemberExtension() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/memberExtension.kt"); + @TestMetadata("fib.kt") + public void testFib() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/fib.kt"); } @Test - @TestMetadata("nestedConstructorCallable.kt") - public void testNestedConstructorCallable() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/nestedConstructorCallable.kt"); + @TestMetadata("flexibleCapturedType.kt") + public void testFlexibleCapturedType() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/flexibleCapturedType.kt"); } @Test - @TestMetadata("nestedObjects.kt") - public void testNestedObjects() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/nestedObjects.kt"); + @TestMetadata("ft.kt") + public void testFt() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/ft.kt"); } @Test - @TestMetadata("nestedVisibility.kt") - public void testNestedVisibility() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/nestedVisibility.kt"); + @TestMetadata("functionTypeAlias.kt") + public void testFunctionTypeAlias() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/functionTypeAlias.kt"); } @Test - @TestMetadata("objectOverrideCallViaImport.kt") - public void testObjectOverrideCallViaImport() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/objectOverrideCallViaImport.kt"); + @TestMetadata("functionTypes.kt") + public void testFunctionTypes() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/functionTypes.kt"); } @Test - @TestMetadata("objectVsProperty.kt") - public void testObjectVsProperty() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/objectVsProperty.kt"); + @TestMetadata("genericConstructors.kt") + public void testGenericConstructors() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/genericConstructors.kt"); } @Test - @TestMetadata("objects.kt") - public void testObjects() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/objects.kt"); + @TestMetadata("genericFunctions.kt") + public void testGenericFunctions() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/genericFunctions.kt"); } @Test - @TestMetadata("outerMemberAccesses.kt") - public void testOuterMemberAccesses() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/outerMemberAccesses.kt"); + @TestMetadata("genericReceiverPropertyOverride.kt") + public void testGenericReceiverPropertyOverride() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/genericReceiverPropertyOverride.kt"); } @Test - @TestMetadata("outerObject.kt") - public void testOuterObject() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/outerObject.kt"); + @TestMetadata("implicitTypeInFakeOverride.kt") + public void testImplicitTypeInFakeOverride() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/implicitTypeInFakeOverride.kt"); } @Test - @TestMetadata("overriddenJavaGetter.kt") - public void testOverriddenJavaGetter() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/overriddenJavaGetter.kt"); + @TestMetadata("incorrectSuperCall.kt") + public void testIncorrectSuperCall() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/incorrectSuperCall.kt"); } @Test - @TestMetadata("privateObjectLiteral.kt") - public void testPrivateObjectLiteral() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/privateObjectLiteral.kt"); + @TestMetadata("intersectionScope.kt") + public void testIntersectionScope() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/intersectionScope.kt"); } @Test - @TestMetadata("privateVisibility.kt") - public void testPrivateVisibility() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/privateVisibility.kt"); + @TestMetadata("intersectionTypes.kt") + public void testIntersectionTypes() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/intersectionTypes.kt"); } @Test - @TestMetadata("protectedVisibility.kt") - public void testProtectedVisibility() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/protectedVisibility.kt"); + @TestMetadata("invokeInWhenSubjectVariableInitializer.kt") + public void testInvokeInWhenSubjectVariableInitializer() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/invokeInWhenSubjectVariableInitializer.kt"); } @Test - @TestMetadata("qualifiedExpressions.kt") - public void testQualifiedExpressions() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/qualifiedExpressions.kt"); + @TestMetadata("invokeOfLambdaWithReceiver.kt") + public void testInvokeOfLambdaWithReceiver() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/invokeOfLambdaWithReceiver.kt"); } @Test - @TestMetadata("qualifierPriority.kt") - public void testQualifierPriority() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/qualifierPriority.kt"); + @TestMetadata("javaFieldVsAccessor.kt") + public void testJavaFieldVsAccessor() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/javaFieldVsAccessor.kt"); } @Test - @TestMetadata("receiverConsistency.kt") - public void testReceiverConsistency() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/receiverConsistency.kt"); + @TestMetadata("javaStaticScopeInheritance.kt") + public void testJavaStaticScopeInheritance() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/javaStaticScopeInheritance.kt"); } @Test - @TestMetadata("sameReceiver.kt") - public void testSameReceiver() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/sameReceiver.kt"); + @TestMetadata("kt41984.kt") + public void testKt41984() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/kt41984.kt"); } @Test - @TestMetadata("simple.kt") - public void testSimple() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/simple.kt"); + @TestMetadata("kt41990.kt") + public void testKt41990() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/kt41990.kt"); } @Test - @TestMetadata("syntheticInImplicitBody.kt") - public void testSyntheticInImplicitBody() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/syntheticInImplicitBody.kt"); + @TestMetadata("labelAndReceiverForInfix.kt") + public void testLabelAndReceiverForInfix() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/labelAndReceiverForInfix.kt"); } @Test - @TestMetadata("syntheticSmartCast.kt") - public void testSyntheticSmartCast() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/syntheticSmartCast.kt"); + @TestMetadata("lambdaArgInScopeFunction.kt") + public void testLambdaArgInScopeFunction() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/lambdaArgInScopeFunction.kt"); } @Test - @TestMetadata("this.kt") - public void testThis() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/this.kt"); + @TestMetadata("lambdaInLhsOfTypeOperatorCall.kt") + public void testLambdaInLhsOfTypeOperatorCall() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/lambdaInLhsOfTypeOperatorCall.kt"); } @Test - @TestMetadata("topExtensionVsOuterMember.kt") - public void testTopExtensionVsOuterMember() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/topExtensionVsOuterMember.kt"); + @TestMetadata("lambdaPropertyTypeInference.kt") + public void testLambdaPropertyTypeInference() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/lambdaPropertyTypeInference.kt"); } @Test - @TestMetadata("typeAliasConstructor.kt") - public void testTypeAliasConstructor() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/typeAliasConstructor.kt"); + @TestMetadata("localFunctionsHiding.kt") + public void testLocalFunctionsHiding() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/localFunctionsHiding.kt"); } @Test - @TestMetadata("vararg.kt") - public void testVararg() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/vararg.kt"); + @TestMetadata("localObject.kt") + public void testLocalObject() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/localObject.kt"); } @Test - @TestMetadata("when.kt") - public void testWhen() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/when.kt"); + @TestMetadata("nestedClass.kt") + public void testNestedClass() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/nestedClass.kt"); } - @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/expresssions/inference") - @TestDataPath("$PROJECT_ROOT") - @Execution(ExecutionMode.SAME_THREAD) - public class Inference extends AbstractFirDiagnosticsWithLightTreeTest { - @Test - public void testAllFilesPresentInInference() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/expresssions/inference"), Pattern.compile("^([^.]+)\\.kt$"), null, true); - } - - @Test - @TestMetadata("id.kt") - public void testId() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/inference/id.kt"); - } - - @Test - @TestMetadata("typeParameters.kt") - public void testTypeParameters() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/inference/typeParameters.kt"); - } - - @Test - @TestMetadata("typeParameters2.kt") - public void testTypeParameters2() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/inference/typeParameters2.kt"); - } - } - - @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke") - @TestDataPath("$PROJECT_ROOT") - @Execution(ExecutionMode.SAME_THREAD) - public class Invoke extends AbstractFirDiagnosticsWithLightTreeTest { - @Test - public void testAllFilesPresentInInvoke() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke"), Pattern.compile("^([^.]+)\\.kt$"), null, true); - } - - @Test - @TestMetadata("doubleBrackets.kt") - public void testDoubleBrackets() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/doubleBrackets.kt"); - } - - @Test - @TestMetadata("explicitReceiver.kt") - public void testExplicitReceiver() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/explicitReceiver.kt"); - } - - @Test - @TestMetadata("explicitReceiver2.kt") - public void testExplicitReceiver2() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/explicitReceiver2.kt"); - } - - @Test - @TestMetadata("extension.kt") - public void testExtension() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/extension.kt"); - } - - @Test - @TestMetadata("extensionOnObject.kt") - public void testExtensionOnObject() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/extensionOnObject.kt"); - } - - @Test - @TestMetadata("extensionSafeCall.kt") - public void testExtensionSafeCall() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/extensionSafeCall.kt"); - } - - @Test - @TestMetadata("farInvokeExtension.kt") - public void testFarInvokeExtension() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/farInvokeExtension.kt"); - } - - @Test - @TestMetadata("implicitTypeOrder.kt") - public void testImplicitTypeOrder() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/implicitTypeOrder.kt"); - } - - @Test - @TestMetadata("inBrackets.kt") - public void testInBrackets() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/inBrackets.kt"); - } - - @Test - @TestMetadata("incorrectInvokeReceiver.kt") - public void testIncorrectInvokeReceiver() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/incorrectInvokeReceiver.kt"); - } - - @Test - @TestMetadata("propertyFromParameter.kt") - public void testPropertyFromParameter() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/propertyFromParameter.kt"); - } - - @Test - @TestMetadata("propertyWithExtensionType.kt") - public void testPropertyWithExtensionType() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/propertyWithExtensionType.kt"); - } - - @Test - @TestMetadata("simple.kt") - public void testSimple() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/simple.kt"); - } - - @Test - @TestMetadata("threeReceivers.kt") - public void testThreeReceivers() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/threeReceivers.kt"); - } - - @Test - @TestMetadata("threeReceiversCorrect.kt") - public void testThreeReceiversCorrect() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/threeReceiversCorrect.kt"); - } - } - - @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/expresssions/operators") - @TestDataPath("$PROJECT_ROOT") - @Execution(ExecutionMode.SAME_THREAD) - public class Operators extends AbstractFirDiagnosticsWithLightTreeTest { - @Test - public void testAllFilesPresentInOperators() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/expresssions/operators"), Pattern.compile("^([^.]+)\\.kt$"), null, true); - } - - @Test - @TestMetadata("plus.kt") - public void testPlus() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/operators/plus.kt"); - } - - @Test - @TestMetadata("plusAndPlusAssign.kt") - public void testPlusAndPlusAssign() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/operators/plusAndPlusAssign.kt"); - } - - @Test - @TestMetadata("plusAssign.kt") - public void testPlusAssign() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/operators/plusAssign.kt"); - } - } - } - - @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/extendedCheckers") - @TestDataPath("$PROJECT_ROOT") - @Execution(ExecutionMode.SAME_THREAD) - public class ExtendedCheckers extends AbstractFirDiagnosticsWithLightTreeTest { - @Test - public void testAllFilesPresentInExtendedCheckers() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/extendedCheckers"), Pattern.compile("^([^.]+)\\.kt$"), null, true); - } - - @Test - @TestMetadata("ArrayEqualityCanBeReplacedWithEquals.kt") - public void testArrayEqualityCanBeReplacedWithEquals() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/ArrayEqualityCanBeReplacedWithEquals.kt"); - } - - @Test - @TestMetadata("CanBeValChecker.kt") - public void testCanBeValChecker() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/CanBeValChecker.kt"); - } - - @Test - @TestMetadata("RedundantExplicitTypeChecker.kt") - public void testRedundantExplicitTypeChecker() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantExplicitTypeChecker.kt"); - } - - @Test - @TestMetadata("RedundantModalityModifierChecker.kt") - public void testRedundantModalityModifierChecker() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantModalityModifierChecker.kt"); - } - - @Test - @TestMetadata("RedundantReturnUnitTypeChecker.kt") - public void testRedundantReturnUnitTypeChecker() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantReturnUnitTypeChecker.kt"); - } - - @Test - @TestMetadata("RedundantSetterParameterTypeChecker.kt") - public void testRedundantSetterParameterTypeChecker() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantSetterParameterTypeChecker.kt"); - } - - @Test - @TestMetadata("RedundantSingleExpressionStringTemplateChecker.kt") - public void testRedundantSingleExpressionStringTemplateChecker() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantSingleExpressionStringTemplateChecker.kt"); - } - - @Test - @TestMetadata("RedundantVisibilityModifierChecker.kt") - public void testRedundantVisibilityModifierChecker() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantVisibilityModifierChecker.kt"); - } - - @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/canBeReplacedWithOperatorAssignment") - @TestDataPath("$PROJECT_ROOT") - @Execution(ExecutionMode.SAME_THREAD) - public class CanBeReplacedWithOperatorAssignment extends AbstractFirDiagnosticsWithLightTreeTest { - @Test - public void testAllFilesPresentInCanBeReplacedWithOperatorAssignment() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/canBeReplacedWithOperatorAssignment"), Pattern.compile("^([^.]+)\\.kt$"), null, true); - } - - @Test - @TestMetadata("BasicTest.kt") - public void testBasicTest() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/canBeReplacedWithOperatorAssignment/BasicTest.kt"); - } - - @Test - @TestMetadata("ComplexExpression.kt") - public void testComplexExpression() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/canBeReplacedWithOperatorAssignment/ComplexExpression.kt"); - } - - @Test - @TestMetadata("flexibleTypeBug.kt") - public void testFlexibleTypeBug() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/canBeReplacedWithOperatorAssignment/flexibleTypeBug.kt"); - } - - @Test - @TestMetadata("illegalMultipleOperators.kt") - public void testIllegalMultipleOperators() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/canBeReplacedWithOperatorAssignment/illegalMultipleOperators.kt"); - } - - @Test - @TestMetadata("illegalMultipleOperatorsMiddle.kt") - public void testIllegalMultipleOperatorsMiddle() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/canBeReplacedWithOperatorAssignment/illegalMultipleOperatorsMiddle.kt"); - } - - @Test - @TestMetadata("invalidSubtraction.kt") - public void testInvalidSubtraction() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/canBeReplacedWithOperatorAssignment/invalidSubtraction.kt"); - } - - @Test - @TestMetadata("list.kt") - public void testList() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/canBeReplacedWithOperatorAssignment/list.kt"); - } - - @Test - @TestMetadata("logicOperators.kt") - public void testLogicOperators() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/canBeReplacedWithOperatorAssignment/logicOperators.kt"); - } - - @Test - @TestMetadata("multipleOperators.kt") - public void testMultipleOperators() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/canBeReplacedWithOperatorAssignment/multipleOperators.kt"); - } - - @Test - @TestMetadata("multipleOperatorsRightSideRepeat.kt") - public void testMultipleOperatorsRightSideRepeat() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/canBeReplacedWithOperatorAssignment/multipleOperatorsRightSideRepeat.kt"); - } - - @Test - @TestMetadata("mutableList.kt") - public void testMutableList() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/canBeReplacedWithOperatorAssignment/mutableList.kt"); - } - - @Test - @TestMetadata("nonCommutativeRepeat.kt") - public void testNonCommutativeRepeat() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/canBeReplacedWithOperatorAssignment/nonCommutativeRepeat.kt"); - } - - @Test - @TestMetadata("nonRepeatingAssignment.kt") - public void testNonRepeatingAssignment() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/canBeReplacedWithOperatorAssignment/nonRepeatingAssignment.kt"); - } - - @Test - @TestMetadata("OperatorAssignment.kt") - public void testOperatorAssignment() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/canBeReplacedWithOperatorAssignment/OperatorAssignment.kt"); - } - - @Test - @TestMetadata("plusAssignConflict.kt") - public void testPlusAssignConflict() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/canBeReplacedWithOperatorAssignment/plusAssignConflict.kt"); - } - - @Test - @TestMetadata("rightSideRepeat.kt") - public void testRightSideRepeat() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/canBeReplacedWithOperatorAssignment/rightSideRepeat.kt"); - } - - @Test - @TestMetadata("simpleAssign.kt") - public void testSimpleAssign() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/canBeReplacedWithOperatorAssignment/simpleAssign.kt"); - } - - @Test - @TestMetadata("validAddition.kt") - public void testValidAddition() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/canBeReplacedWithOperatorAssignment/validAddition.kt"); - } - - @Test - @TestMetadata("validSubtraction.kt") - public void testValidSubtraction() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/canBeReplacedWithOperatorAssignment/validSubtraction.kt"); - } - } - - @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/emptyRangeChecker") - @TestDataPath("$PROJECT_ROOT") - @Execution(ExecutionMode.SAME_THREAD) - public class EmptyRangeChecker extends AbstractFirDiagnosticsWithLightTreeTest { - @Test - public void testAllFilesPresentInEmptyRangeChecker() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/emptyRangeChecker"), Pattern.compile("^([^.]+)\\.kt$"), null, true); - } - - @Test - @TestMetadata("NoWarning.kt") - public void testNoWarning() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/emptyRangeChecker/NoWarning.kt"); - } - - @Test - @TestMetadata("Warning.kt") - public void testWarning() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/emptyRangeChecker/Warning.kt"); - } - } - - @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod") - @TestDataPath("$PROJECT_ROOT") - @Execution(ExecutionMode.SAME_THREAD) - public class RedundantCallOfConversionMethod extends AbstractFirDiagnosticsWithLightTreeTest { - @Test - public void testAllFilesPresentInRedundantCallOfConversionMethod() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod"), Pattern.compile("^([^.]+)\\.kt$"), null, true); - } - - @Test - @TestMetadata("booleanToInt.kt") - public void testBooleanToInt() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod/booleanToInt.kt"); - } - - @Test - @TestMetadata("byte.kt") - public void testByte() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod/byte.kt"); - } - - @Test - @TestMetadata("char.kt") - public void testChar() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod/char.kt"); - } - - @Test - @TestMetadata("double.kt") - public void testDouble() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod/double.kt"); - } - - @Test - @TestMetadata("float.kt") - public void testFloat() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod/float.kt"); - } - - @Test - @TestMetadata("int.kt") - public void testInt() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod/int.kt"); - } - - @Test - @TestMetadata("long.kt") - public void testLong() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod/long.kt"); - } - - @Test - @TestMetadata("nullable.kt") - public void testNullable() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod/nullable.kt"); - } - - @Test - @TestMetadata("nullable2.kt") - public void testNullable2() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod/nullable2.kt"); - } - - @Test - @TestMetadata("safeString.kt") - public void testSafeString() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod/safeString.kt"); - } - - @Test - @TestMetadata("safeString2.kt") - public void testSafeString2() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod/safeString2.kt"); - } - - @Test - @TestMetadata("short.kt") - public void testShort() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod/short.kt"); - } - - @Test - @TestMetadata("string.kt") - public void testString() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod/string.kt"); - } - - @Test - @TestMetadata("StringTemplate.kt") - public void testStringTemplate() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod/StringTemplate.kt"); - } - - @Test - @TestMetadata("toOtherType.kt") - public void testToOtherType() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod/toOtherType.kt"); - } - - @Test - @TestMetadata("uByte.kt") - public void testUByte() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod/uByte.kt"); - } - - @Test - @TestMetadata("uInt.kt") - public void testUInt() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod/uInt.kt"); - } - - @Test - @TestMetadata("uLong.kt") - public void testULong() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod/uLong.kt"); - } - - @Test - @TestMetadata("uShort.kt") - public void testUShort() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod/uShort.kt"); - } - - @Test - @TestMetadata("variable.kt") - public void testVariable() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod/variable.kt"); - } - } - - @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused") - @TestDataPath("$PROJECT_ROOT") - @Execution(ExecutionMode.SAME_THREAD) - public class Unused extends AbstractFirDiagnosticsWithLightTreeTest { - @Test - public void testAllFilesPresentInUnused() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused"), Pattern.compile("^([^.]+)\\.kt$"), null, true); - } - - @Test - @TestMetadata("classProperty.kt") - public void testClassProperty() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/classProperty.kt"); - } - - @Test - @TestMetadata("invoke.kt") - public void testInvoke() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/invoke.kt"); - } - - @Test - @TestMetadata("lambda.kt") - public void testLambda() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/lambda.kt"); - } - - @Test - @TestMetadata("localVariable.kt") - public void testLocalVariable() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/localVariable.kt"); - } - - @Test - @TestMetadata("manyLocalVariables.kt") - public void testManyLocalVariables() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/manyLocalVariables.kt"); - } - - @Test - @TestMetadata("usedInAnnotationArguments.kt") - public void testUsedInAnnotationArguments() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/usedInAnnotationArguments.kt"); - } - - @Test - @TestMetadata("valueIsNeverRead.kt") - public void testValueIsNeverRead() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/valueIsNeverRead.kt"); - } - } - - @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/UselessCallOnNotNullChecker") - @TestDataPath("$PROJECT_ROOT") - @Execution(ExecutionMode.SAME_THREAD) - public class UselessCallOnNotNullChecker extends AbstractFirDiagnosticsWithLightTreeTest { - @Test - public void testAllFilesPresentInUselessCallOnNotNullChecker() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/UselessCallOnNotNullChecker"), Pattern.compile("^([^.]+)\\.kt$"), null, true); - } - - @Test - @TestMetadata("Basic.kt") - public void testBasic() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/UselessCallOnNotNullChecker/Basic.kt"); - } - - @Test - @TestMetadata("NotNullType.kt") - public void testNotNullType() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/UselessCallOnNotNullChecker/NotNullType.kt"); - } - - @Test - @TestMetadata("NotNullTypeChain.kt") - public void testNotNullTypeChain() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/UselessCallOnNotNullChecker/NotNullTypeChain.kt"); - } - - @Test - @TestMetadata("NullOrBlankSafe.kt") - public void testNullOrBlankSafe() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/UselessCallOnNotNullChecker/NullOrBlankSafe.kt"); - } - - @Test - @TestMetadata("NullOrEmpty.kt") - public void testNullOrEmpty() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/UselessCallOnNotNullChecker/NullOrEmpty.kt"); - } - - @Test - @TestMetadata("NullOrEmptyFake.kt") - public void testNullOrEmptyFake() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/UselessCallOnNotNullChecker/NullOrEmptyFake.kt"); - } - - @Test - @TestMetadata("NullOrEmptySafe.kt") - public void testNullOrEmptySafe() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/UselessCallOnNotNullChecker/NullOrEmptySafe.kt"); - } - - @Test - @TestMetadata("OrEmptyFake.kt") - public void testOrEmptyFake() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/UselessCallOnNotNullChecker/OrEmptyFake.kt"); - } - - @Test - @TestMetadata("SafeCall.kt") - public void testSafeCall() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/UselessCallOnNotNullChecker/SafeCall.kt"); - } - - @Test - @TestMetadata("Sequence.kt") - public void testSequence() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/UselessCallOnNotNullChecker/Sequence.kt"); - } - - @Test - @TestMetadata("String.kt") - public void testString() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/UselessCallOnNotNullChecker/String.kt"); - } - } - } - - @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/fromBuilder") - @TestDataPath("$PROJECT_ROOT") - @Execution(ExecutionMode.SAME_THREAD) - public class FromBuilder extends AbstractFirDiagnosticsWithLightTreeTest { - @Test - public void testAllFilesPresentInFromBuilder() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/fromBuilder"), Pattern.compile("^([^.]+)\\.kt$"), null, true); - } - - @Test - @TestMetadata("complexTypes.kt") - public void testComplexTypes() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/fromBuilder/complexTypes.kt"); - } - - @Test - @TestMetadata("enums.kt") - public void testEnums() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/fromBuilder/enums.kt"); - } - - @Test - @TestMetadata("noPrimaryConstructor.kt") - public void testNoPrimaryConstructor() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/fromBuilder/noPrimaryConstructor.kt"); - } - - @Test - @TestMetadata("simpleClass.kt") - public void testSimpleClass() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/fromBuilder/simpleClass.kt"); - } - - @Test - @TestMetadata("typeParameters.kt") - public void testTypeParameters() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/fromBuilder/typeParameters.kt"); - } - } - - @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/inference") - @TestDataPath("$PROJECT_ROOT") - @Execution(ExecutionMode.SAME_THREAD) - public class Inference extends AbstractFirDiagnosticsWithLightTreeTest { - @Test - public void testAllFilesPresentInInference() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/inference"), Pattern.compile("^([^.]+)\\.kt$"), null, true); - } - - @Test - @TestMetadata("callableReferenceOnInstance.kt") - public void testCallableReferenceOnInstance() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/inference/callableReferenceOnInstance.kt"); - } - - @Test - @TestMetadata("callableReferenceToLocalClass.kt") - public void testCallableReferenceToLocalClass() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/inference/callableReferenceToLocalClass.kt"); - } - - @Test - @TestMetadata("callableReferencesAndDefaultParameters.kt") - public void testCallableReferencesAndDefaultParameters() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/inference/callableReferencesAndDefaultParameters.kt"); - } - - @Test - @TestMetadata("capturedTypeForJavaTypeParameter.kt") - public void testCapturedTypeForJavaTypeParameter() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/inference/capturedTypeForJavaTypeParameter.kt"); - } - - @Test - @TestMetadata("coercionToUnitWithEarlyReturn.kt") - public void testCoercionToUnitWithEarlyReturn() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/inference/coercionToUnitWithEarlyReturn.kt"); - } - - @Test - @TestMetadata("definitelyNotNullIntersectionType.kt") - public void testDefinitelyNotNullIntersectionType() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/inference/definitelyNotNullIntersectionType.kt"); - } - - @Test - @TestMetadata("extensionCallableReferences.kt") - public void testExtensionCallableReferences() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/inference/extensionCallableReferences.kt"); - } - - @Test - @TestMetadata("integerLiteralAsComparable.kt") - public void testIntegerLiteralAsComparable() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/inference/integerLiteralAsComparable.kt"); - } - - @Test - @TestMetadata("intersectionTypesInConstraints.kt") - public void testIntersectionTypesInConstraints() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/inference/intersectionTypesInConstraints.kt"); - } - - @Test - @TestMetadata("kt40131.kt") - public void testKt40131() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/inference/kt40131.kt"); - } - - @Test - @TestMetadata("kt41989.kt") - public void testKt41989() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/inference/kt41989.kt"); - } - - @Test - @TestMetadata("lambdaAsReturnStatementOfLambda.kt") - public void testLambdaAsReturnStatementOfLambda() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/inference/lambdaAsReturnStatementOfLambda.kt"); - } - - @Test - @TestMetadata("lambdaInElvis.kt") - public void testLambdaInElvis() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/inference/lambdaInElvis.kt"); - } - - @Test - @TestMetadata("lambdasReturns.kt") - public void testLambdasReturns() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/inference/lambdasReturns.kt"); - } - - @Test - @TestMetadata("nestedExtensionFunctionType.kt") - public void testNestedExtensionFunctionType() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/inference/nestedExtensionFunctionType.kt"); - } - - @Test - @TestMetadata("nestedLambdas.kt") - public void testNestedLambdas() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/inference/nestedLambdas.kt"); - } - - @Test - @TestMetadata("nullableIntegerLiteralType.kt") - public void testNullableIntegerLiteralType() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/inference/nullableIntegerLiteralType.kt"); - } - - @Test - @TestMetadata("receiverWithCapturedType.kt") - public void testReceiverWithCapturedType() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/inference/receiverWithCapturedType.kt"); - } - - @Test - @TestMetadata("simpleCapturedTypes.kt") - public void testSimpleCapturedTypes() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/inference/simpleCapturedTypes.kt"); - } - - @Test - @TestMetadata("typeDepthForTypeAlias.kt") - public void testTypeDepthForTypeAlias() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/inference/typeDepthForTypeAlias.kt"); - } - } - - @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/innerClasses") - @TestDataPath("$PROJECT_ROOT") - @Execution(ExecutionMode.SAME_THREAD) - public class InnerClasses extends AbstractFirDiagnosticsWithLightTreeTest { - @Test - public void testAllFilesPresentInInnerClasses() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/innerClasses"), Pattern.compile("^([^.]+)\\.kt$"), null, true); - } - - @Test - @TestMetadata("inner.kt") - public void testInner() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/innerClasses/inner.kt"); - } - - @Test - @TestMetadata("innerTypeFromSuperClassInBody.kt") - public void testInnerTypeFromSuperClassInBody() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/innerClasses/innerTypeFromSuperClassInBody.kt"); - } - - @Test - @TestMetadata("innerTypes.kt") - public void testInnerTypes() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/innerClasses/innerTypes.kt"); - } - - @Test - @TestMetadata("simple.kt") - public void testSimple() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/innerClasses/simple.kt"); - } - } - - @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/localClasses") - @TestDataPath("$PROJECT_ROOT") - @Execution(ExecutionMode.SAME_THREAD) - public class LocalClasses extends AbstractFirDiagnosticsWithLightTreeTest { - @Test - public void testAllFilesPresentInLocalClasses() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/localClasses"), Pattern.compile("^([^.]+)\\.kt$"), null, true); - } - - @Test - @TestMetadata("implicitInAnonymous.kt") - public void testImplicitInAnonymous() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/localClasses/implicitInAnonymous.kt"); - } - - @Test - @TestMetadata("implicitInLocalClasses.kt") - public void testImplicitInLocalClasses() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/localClasses/implicitInLocalClasses.kt"); - } - - @Test - @TestMetadata("typesFromSuperClasses.kt") - public void testTypesFromSuperClasses() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/localClasses/typesFromSuperClasses.kt"); - } - } - - @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/multifile") - @TestDataPath("$PROJECT_ROOT") - @Execution(ExecutionMode.SAME_THREAD) - public class Multifile extends AbstractFirDiagnosticsWithLightTreeTest { @Test - public void testAllFilesPresentInMultifile() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/multifile"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + @TestMetadata("nestedClassContructor.kt") + public void testNestedClassContructor() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/nestedClassContructor.kt"); } @Test - @TestMetadata("Annotations.kt") - public void testAnnotations() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/multifile/Annotations.kt"); + @TestMetadata("nestedClassNameClash.kt") + public void testNestedClassNameClash() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/nestedClassNameClash.kt"); } @Test - @TestMetadata("ByteArray.kt") - public void testByteArray() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/multifile/ByteArray.kt"); + @TestMetadata("NestedOfAliasedType.kt") + public void testNestedOfAliasedType() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/NestedOfAliasedType.kt"); } @Test - @TestMetadata("importFromObject.kt") - public void testImportFromObject() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/multifile/importFromObject.kt"); + @TestMetadata("nestedReturnType.kt") + public void testNestedReturnType() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/nestedReturnType.kt"); } @Test @TestMetadata("NestedSuperType.kt") public void testNestedSuperType() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/multifile/NestedSuperType.kt"); + runTest("compiler/fir/analysis-tests/testData/resolve/NestedSuperType.kt"); } @Test - @TestMetadata("sealedStarImport.kt") - public void testSealedStarImport() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/multifile/sealedStarImport.kt"); + @TestMetadata("objectInnerClass.kt") + public void testObjectInnerClass() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/objectInnerClass.kt"); } @Test - @TestMetadata("simpleAliasedImport.kt") - public void testSimpleAliasedImport() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/multifile/simpleAliasedImport.kt"); + @TestMetadata("offOrderMultiBoundGenericOverride.kt") + public void testOffOrderMultiBoundGenericOverride() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/offOrderMultiBoundGenericOverride.kt"); } @Test - @TestMetadata("simpleImport.kt") - public void testSimpleImport() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/multifile/simpleImport.kt"); + @TestMetadata("openInInterface.kt") + public void testOpenInInterface() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/openInInterface.kt"); } @Test - @TestMetadata("simpleImportNested.kt") - public void testSimpleImportNested() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/multifile/simpleImportNested.kt"); + @TestMetadata("problems2.kt") + public void testProblems2() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/problems2.kt"); } @Test - @TestMetadata("simpleImportOuter.kt") - public void testSimpleImportOuter() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/multifile/simpleImportOuter.kt"); + @TestMetadata("propertyFromJavaPlusAssign.kt") + public void testPropertyFromJavaPlusAssign() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/propertyFromJavaPlusAssign.kt"); } @Test - @TestMetadata("simpleStarImport.kt") - public void testSimpleStarImport() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/multifile/simpleStarImport.kt"); + @TestMetadata("qualifierWithCompanion.kt") + public void testQualifierWithCompanion() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/qualifierWithCompanion.kt"); } @Test - @TestMetadata("TypeAliasExpansion.kt") - public void testTypeAliasExpansion() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/multifile/TypeAliasExpansion.kt"); + @TestMetadata("rawTypeSam.kt") + public void testRawTypeSam() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/rawTypeSam.kt"); } - } - @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/overrides") - @TestDataPath("$PROJECT_ROOT") - @Execution(ExecutionMode.SAME_THREAD) - public class Overrides extends AbstractFirDiagnosticsWithLightTreeTest { @Test - public void testAllFilesPresentInOverrides() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/overrides"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + @TestMetadata("recursiveCallOnWhenWithSealedClass.kt") + public void testRecursiveCallOnWhenWithSealedClass() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/recursiveCallOnWhenWithSealedClass.kt"); } @Test - @TestMetadata("generics.kt") - public void testGenerics() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/overrides/generics.kt"); + @TestMetadata("sealedClass.kt") + public void testSealedClass() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/sealedClass.kt"); } @Test - @TestMetadata("protobufExt.kt") - public void testProtobufExt() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/overrides/protobufExt.kt"); + @TestMetadata("simpleClass.kt") + public void testSimpleClass() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/simpleClass.kt"); } @Test - @TestMetadata("simple.kt") - public void testSimple() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/overrides/simple.kt"); + @TestMetadata("simpleTypeAlias.kt") + public void testSimpleTypeAlias() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/simpleTypeAlias.kt"); } @Test - @TestMetadata("simpleFakeOverride.kt") - public void testSimpleFakeOverride() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/overrides/simpleFakeOverride.kt"); + @TestMetadata("spreadOperator.kt") + public void testSpreadOperator() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/spreadOperator.kt"); } @Test - @TestMetadata("simpleMostSpecific.kt") - public void testSimpleMostSpecific() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/overrides/simpleMostSpecific.kt"); + @TestMetadata("statusResolveForTypealiasAsSuperClass.kt") + public void testStatusResolveForTypealiasAsSuperClass() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/statusResolveForTypealiasAsSuperClass.kt"); } @Test - @TestMetadata("supertypeGenerics.kt") - public void testSupertypeGenerics() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/overrides/supertypeGenerics.kt"); + @TestMetadata("syntheticsVsNormalProperties.kt") + public void testSyntheticsVsNormalProperties() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/syntheticsVsNormalProperties.kt"); } @Test - @TestMetadata("supertypeGenericsComplex.kt") - public void testSupertypeGenericsComplex() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/overrides/supertypeGenericsComplex.kt"); + @TestMetadata("treeSet.kt") + public void testTreeSet() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/treeSet.kt"); } @Test - @TestMetadata("three.kt") - public void testThree() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/overrides/three.kt"); + @TestMetadata("tryInference.kt") + public void testTryInference() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/tryInference.kt"); } - } - @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/problems") - @TestDataPath("$PROJECT_ROOT") - @Execution(ExecutionMode.SAME_THREAD) - public class Problems extends AbstractFirDiagnosticsWithLightTreeTest { @Test - public void testAllFilesPresentInProblems() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/problems"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + @TestMetadata("TwoDeclarationsInSameFile.kt") + public void testTwoDeclarationsInSameFile() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/TwoDeclarationsInSameFile.kt"); } @Test - @TestMetadata("compilerPhase.kt") - public void testCompilerPhase() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/problems/compilerPhase.kt"); + @TestMetadata("typeAliasWithGeneric.kt") + public void testTypeAliasWithGeneric() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/typeAliasWithGeneric.kt"); } @Test - @TestMetadata("complexLambdaWithTypeVariableAsExpectedType.kt") - public void testComplexLambdaWithTypeVariableAsExpectedType() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/problems/complexLambdaWithTypeVariableAsExpectedType.kt"); + @TestMetadata("typeAliasWithTypeArguments.kt") + public void testTypeAliasWithTypeArguments() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/typeAliasWithTypeArguments.kt"); } @Test - @TestMetadata("defaultParametersFromDifferentScopes.kt") - public void testDefaultParametersFromDifferentScopes() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/problems/defaultParametersFromDifferentScopes.kt"); + @TestMetadata("typeFromGetter.kt") + public void testTypeFromGetter() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/typeFromGetter.kt"); } @Test - @TestMetadata("definitelyNotNullAndOriginalType.kt") - public void testDefinitelyNotNullAndOriginalType() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/problems/definitelyNotNullAndOriginalType.kt"); + @TestMetadata("typeParameterInPropertyReceiver.kt") + public void testTypeParameterInPropertyReceiver() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/typeParameterInPropertyReceiver.kt"); } @Test - @TestMetadata("flexibleTypeVarAgainstNull.kt") - public void testFlexibleTypeVarAgainstNull() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/problems/flexibleTypeVarAgainstNull.kt"); + @TestMetadata("typeParameterVsNested.kt") + public void testTypeParameterVsNested() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/typeParameterVsNested.kt"); } @Test - @TestMetadata("inaccessibleJavaGetter.kt") - public void testInaccessibleJavaGetter() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/problems/inaccessibleJavaGetter.kt"); + @TestMetadata("typesInLocalFunctions.kt") + public void testTypesInLocalFunctions() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/typesInLocalFunctions.kt"); } @Test - @TestMetadata("innerClassHierarchy.kt") - public void testInnerClassHierarchy() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/problems/innerClassHierarchy.kt"); + @TestMetadata("varargInPrimaryConstructor.kt") + public void testVarargInPrimaryConstructor() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/varargInPrimaryConstructor.kt"); } @Test - @TestMetadata("javaQualifier.kt") - public void testJavaQualifier() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/problems/javaQualifier.kt"); + @TestMetadata("whenAsReceiver.kt") + public void testWhenAsReceiver() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/whenAsReceiver.kt"); } @Test - @TestMetadata("kt42346.kt") - public void testKt42346() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/problems/kt42346.kt"); + @TestMetadata("whenElse.kt") + public void testWhenElse() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/whenElse.kt"); } @Test - @TestMetadata("multipleJavaClassesInOneFile.kt") - public void testMultipleJavaClassesInOneFile() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/problems/multipleJavaClassesInOneFile.kt"); + @TestMetadata("whenExpressionType.kt") + public void testWhenExpressionType() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/whenExpressionType.kt"); } @Test - @TestMetadata("objectDerivedFromInnerClass.kt") - public void testObjectDerivedFromInnerClass() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/problems/objectDerivedFromInnerClass.kt"); - } - - @Test - @TestMetadata("questionableSmartCast.kt") - public void testQuestionableSmartCast() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/problems/questionableSmartCast.kt"); - } - - @Test - @TestMetadata("recursiveNamedAnnotation.kt") - public void testRecursiveNamedAnnotation() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/problems/recursiveNamedAnnotation.kt"); - } - - @Test - @TestMetadata("safeCallInvoke.kt") - public void testSafeCallInvoke() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/problems/safeCallInvoke.kt"); - } - - @Test - @TestMetadata("secondaryConstructorCfg.kt") - public void testSecondaryConstructorCfg() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/problems/secondaryConstructorCfg.kt"); - } - } - - @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/properties") - @TestDataPath("$PROJECT_ROOT") - @Execution(ExecutionMode.SAME_THREAD) - public class Properties extends AbstractFirDiagnosticsWithLightTreeTest { - @Test - public void testAllFilesPresentInProperties() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/properties"), Pattern.compile("^([^.]+)\\.kt$"), null, true); - } - - @Test - @TestMetadata("javaAccessorConversion.kt") - public void testJavaAccessorConversion() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/properties/javaAccessorConversion.kt"); - } - - @Test - @TestMetadata("javaAccessorsComplex.kt") - public void testJavaAccessorsComplex() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/properties/javaAccessorsComplex.kt"); - } - - @Test - @TestMetadata("kotlinOverridesJavaComplex.kt") - public void testKotlinOverridesJavaComplex() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/properties/kotlinOverridesJavaComplex.kt"); - } - - @Test - @TestMetadata("noBackingFieldForExtension.kt") - public void testNoBackingFieldForExtension() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/properties/noBackingFieldForExtension.kt"); - } - - @Test - @TestMetadata("noBackingFieldInProperty.kt") - public void testNoBackingFieldInProperty() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/properties/noBackingFieldInProperty.kt"); - } - - @Test - @TestMetadata("syntheticPropertiesForJavaAnnotations.kt") - public void testSyntheticPropertiesForJavaAnnotations() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/properties/syntheticPropertiesForJavaAnnotations.kt"); - } - } - - @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/references") - @TestDataPath("$PROJECT_ROOT") - @Execution(ExecutionMode.SAME_THREAD) - public class References extends AbstractFirDiagnosticsWithLightTreeTest { - @Test - public void testAllFilesPresentInReferences() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/references"), Pattern.compile("^([^.]+)\\.kt$"), null, true); - } - - @Test - @TestMetadata("integerLiteralInLhs.kt") - public void testIntegerLiteralInLhs() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/references/integerLiteralInLhs.kt"); - } - - @Test - @TestMetadata("referenceToExtension.kt") - public void testReferenceToExtension() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/references/referenceToExtension.kt"); - } - - @Test - @TestMetadata("simple.kt") - public void testSimple() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/references/simple.kt"); - } - - @Test - @TestMetadata("superMember.kt") - public void testSuperMember() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/references/superMember.kt"); - } - } - - @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/samConstructors") - @TestDataPath("$PROJECT_ROOT") - @Execution(ExecutionMode.SAME_THREAD) - public class SamConstructors extends AbstractFirDiagnosticsWithLightTreeTest { - @Test - public void testAllFilesPresentInSamConstructors() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/samConstructors"), Pattern.compile("^([^.]+)\\.kt$"), null, true); - } - - @Test - @TestMetadata("genericSam.kt") - public void testGenericSam() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/samConstructors/genericSam.kt"); - } - - @Test - @TestMetadata("genericSamInferenceFromExpectType.kt") - public void testGenericSamInferenceFromExpectType() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/samConstructors/genericSamInferenceFromExpectType.kt"); - } - - @Test - @TestMetadata("kotlinSam.kt") - public void testKotlinSam() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/samConstructors/kotlinSam.kt"); - } - - @Test - @TestMetadata("realConstructorFunction.kt") - public void testRealConstructorFunction() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/samConstructors/realConstructorFunction.kt"); - } - - @Test - @TestMetadata("runnable.kt") - public void testRunnable() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/samConstructors/runnable.kt"); - } - - @Test - @TestMetadata("simple.kt") - public void testSimple() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/samConstructors/simple.kt"); - } - } - - @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/samConversions") - @TestDataPath("$PROJECT_ROOT") - @Execution(ExecutionMode.SAME_THREAD) - public class SamConversions extends AbstractFirDiagnosticsWithLightTreeTest { - @Test - public void testAllFilesPresentInSamConversions() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/samConversions"), Pattern.compile("^([^.]+)\\.kt$"), null, true); - } - - @Test - @TestMetadata("genericSam.kt") - public void testGenericSam() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/samConversions/genericSam.kt"); - } - - @Test - @TestMetadata("kotlinSam.kt") - public void testKotlinSam() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/samConversions/kotlinSam.kt"); - } - - @Test - @TestMetadata("notSamBecauseOfSupertype.kt") - public void testNotSamBecauseOfSupertype() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/samConversions/notSamBecauseOfSupertype.kt"); - } - - @Test - @TestMetadata("runnable.kt") - public void testRunnable() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/samConversions/runnable.kt"); - } - - @Test - @TestMetadata("samConversionInConstructorCall.kt") - public void testSamConversionInConstructorCall() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/samConversions/samConversionInConstructorCall.kt"); - } - - @Test - @TestMetadata("samSupertype.kt") - public void testSamSupertype() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/samConversions/samSupertype.kt"); - } - - @Test - @TestMetadata("samSupertypeWithOverride.kt") - public void testSamSupertypeWithOverride() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/samConversions/samSupertypeWithOverride.kt"); - } - - @Test - @TestMetadata("samWithEquals.kt") - public void testSamWithEquals() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/samConversions/samWithEquals.kt"); - } - - @Test - @TestMetadata("simple.kt") - public void testSimple() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/samConversions/simple.kt"); - } - } - - @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/smartcasts") - @TestDataPath("$PROJECT_ROOT") - @Execution(ExecutionMode.SAME_THREAD) - public class Smartcasts extends AbstractFirDiagnosticsWithLightTreeTest { - @Test - public void testAllFilesPresentInSmartcasts() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/smartcasts"), Pattern.compile("^([^.]+)\\.kt$"), null, true); - } - - @Test - @TestMetadata("bangbang.kt") - public void testBangbang() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/bangbang.kt"); - } - - @Test - @TestMetadata("casts.kt") - public void testCasts() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/casts.kt"); - } - - @Test - @TestMetadata("equalsAndIdentity.kt") - public void testEqualsAndIdentity() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/equalsAndIdentity.kt"); - } - - @Test - @TestMetadata("kt10240.kt") - public void testKt10240() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/kt10240.kt"); - } - - @Test - @TestMetadata("kt37327.kt") - public void testKt37327() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/kt37327.kt"); - } - - @Test - @TestMetadata("kt39000.kt") - public void testKt39000() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/kt39000.kt"); - } - - @Test - @TestMetadata("multipleCasts.kt") - public void testMultipleCasts() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/multipleCasts.kt"); - } - - @Test - @TestMetadata("nullability.kt") - public void testNullability() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/nullability.kt"); - } - - @Test - @TestMetadata("orInWhenBranch.kt") - public void testOrInWhenBranch() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/orInWhenBranch.kt"); - } - - @Test - @TestMetadata("smartCastInInit.kt") - public void testSmartCastInInit() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/smartCastInInit.kt"); - } - - @Test - @TestMetadata("smartcastToNothing.kt") - public void testSmartcastToNothing() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastToNothing.kt"); + @TestMetadata("whenInference.kt") + public void testWhenInference() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/whenInference.kt"); } @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans") + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/arguments") @TestDataPath("$PROJECT_ROOT") @Execution(ExecutionMode.SAME_THREAD) - public class Booleans extends AbstractFirDiagnosticsWithLightTreeTest { + public class Arguments extends AbstractFirDiagnosticsWithLightTreeTest { @Test - public void testAllFilesPresentInBooleans() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + public void testAllFilesPresentInArguments() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/arguments"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } @Test - @TestMetadata("booleanOperators.kt") - public void testBooleanOperators() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/booleanOperators.kt"); + @TestMetadata("ambiguityOnJavaOverride.kt") + public void testAmbiguityOnJavaOverride() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/arguments/ambiguityOnJavaOverride.kt"); } @Test - @TestMetadata("equalsToBoolean.kt") - public void testEqualsToBoolean() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/equalsToBoolean.kt"); + @TestMetadata("argumentsOfAnnotations.kt") + public void testArgumentsOfAnnotations() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/arguments/argumentsOfAnnotations.kt"); } @Test - @TestMetadata("jumpFromRhsOfOperator.kt") - public void testJumpFromRhsOfOperator() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/jumpFromRhsOfOperator.kt"); - } - } - - @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts") - @TestDataPath("$PROJECT_ROOT") - @Execution(ExecutionMode.SAME_THREAD) - public class BoundSmartcasts extends AbstractFirDiagnosticsWithLightTreeTest { - @Test - public void testAllFilesPresentInBoundSmartcasts() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + @TestMetadata("argumentsOfJavaAnnotation.kt") + public void testArgumentsOfJavaAnnotation() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/arguments/argumentsOfJavaAnnotation.kt"); } @Test - @TestMetadata("boundSmartcasts.kt") - public void testBoundSmartcasts() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcasts.kt"); + @TestMetadata("default.kt") + public void testDefault() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/arguments/default.kt"); } @Test - @TestMetadata("boundSmartcastsInBranches.kt") - public void testBoundSmartcastsInBranches() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.kt"); + @TestMetadata("defaultFromOverrides.kt") + public void testDefaultFromOverrides() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/arguments/defaultFromOverrides.kt"); } @Test - @TestMetadata("functionCallBound.kt") - public void testFunctionCallBound() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/functionCallBound.kt"); - } - } - - @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures") - @TestDataPath("$PROJECT_ROOT") - @Execution(ExecutionMode.SAME_THREAD) - public class ControlStructures extends AbstractFirDiagnosticsWithLightTreeTest { - @Test - public void testAllFilesPresentInControlStructures() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + @TestMetadata("definetelyNotNullForTypeParameter.kt") + public void testDefinetelyNotNullForTypeParameter() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/arguments/definetelyNotNullForTypeParameter.kt"); } @Test - @TestMetadata("elvis.kt") - public void testElvis() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/elvis.kt"); + @TestMetadata("extensionLambdaInDefaultArgument.kt") + public void testExtensionLambdaInDefaultArgument() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/arguments/extensionLambdaInDefaultArgument.kt"); } @Test - @TestMetadata("returns.kt") - public void testReturns() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/returns.kt"); + @TestMetadata("fieldPlusAssign.kt") + public void testFieldPlusAssign() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/arguments/fieldPlusAssign.kt"); } @Test - @TestMetadata("simpleIf.kt") - public void testSimpleIf() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/simpleIf.kt"); + @TestMetadata("incorrectFunctionalType.kt") + public void testIncorrectFunctionalType() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/arguments/incorrectFunctionalType.kt"); } @Test - @TestMetadata("smartcastFromArgument.kt") - public void testSmartcastFromArgument() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/smartcastFromArgument.kt"); - } - - @Test - @TestMetadata("when.kt") - public void testWhen() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/when.kt"); - } - } - - @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/smartcasts/lambdas") - @TestDataPath("$PROJECT_ROOT") - @Execution(ExecutionMode.SAME_THREAD) - public class Lambdas extends AbstractFirDiagnosticsWithLightTreeTest { - @Test - public void testAllFilesPresentInLambdas() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/smartcasts/lambdas"), Pattern.compile("^([^.]+)\\.kt$"), null, true); - } - - @Test - @TestMetadata("inPlaceLambdas.kt") - public void testInPlaceLambdas() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/lambdas/inPlaceLambdas.kt"); - } - - @Test - @TestMetadata("lambdaInWhenBranch.kt") - public void testLambdaInWhenBranch() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/lambdas/lambdaInWhenBranch.kt"); - } - - @Test - @TestMetadata("smartcastOnLambda.kt") - public void testSmartcastOnLambda() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/lambdas/smartcastOnLambda.kt"); - } - } - - @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/smartcasts/loops") - @TestDataPath("$PROJECT_ROOT") - @Execution(ExecutionMode.SAME_THREAD) - public class Loops extends AbstractFirDiagnosticsWithLightTreeTest { - @Test - public void testAllFilesPresentInLoops() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/smartcasts/loops"), Pattern.compile("^([^.]+)\\.kt$"), null, true); - } - - @Test - @TestMetadata("dataFlowInfoFromWhileCondition.kt") - public void testDataFlowInfoFromWhileCondition() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/loops/dataFlowInfoFromWhileCondition.kt"); - } - - @Test - @TestMetadata("endlessLoops.kt") - public void testEndlessLoops() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/loops/endlessLoops.kt"); - } - } - - @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/smartcasts/problems") - @TestDataPath("$PROJECT_ROOT") - @Execution(ExecutionMode.SAME_THREAD) - public class Problems extends AbstractFirDiagnosticsWithLightTreeTest { - @Test - public void testAllFilesPresentInProblems() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/smartcasts/problems"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + @TestMetadata("integerLiteralTypes.kt") + public void testIntegerLiteralTypes() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/arguments/integerLiteralTypes.kt"); } @Test @TestMetadata("invoke.kt") public void testInvoke() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/problems/invoke.kt"); + runTest("compiler/fir/analysis-tests/testData/resolve/arguments/invoke.kt"); + } + + @Test + @TestMetadata("javaAnnotationsWithArrayValue.kt") + public void testJavaAnnotationsWithArrayValue() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/arguments/javaAnnotationsWithArrayValue.kt"); + } + + @Test + @TestMetadata("javaArrayVariance.kt") + public void testJavaArrayVariance() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/arguments/javaArrayVariance.kt"); + } + + @Test + @TestMetadata("kt41940.kt") + public void testKt41940() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/arguments/kt41940.kt"); + } + + @Test + @TestMetadata("lambda.kt") + public void testLambda() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/arguments/lambda.kt"); + } + + @Test + @TestMetadata("lambdaInLambda.kt") + public void testLambdaInLambda() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/arguments/lambdaInLambda.kt"); + } + + @Test + @TestMetadata("lambdaInLambda2.kt") + public void testLambdaInLambda2() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/arguments/lambdaInLambda2.kt"); + } + + @Test + @TestMetadata("lambdaInUnresolvedCall.kt") + public void testLambdaInUnresolvedCall() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/arguments/lambdaInUnresolvedCall.kt"); + } + + @Test + @TestMetadata("namedArrayInAnnotation.kt") + public void testNamedArrayInAnnotation() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/arguments/namedArrayInAnnotation.kt"); + } + + @Test + @TestMetadata("operatorsOverLiterals.kt") + public void testOperatorsOverLiterals() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/arguments/operatorsOverLiterals.kt"); + } + + @Test + @TestMetadata("overloadByReceiver.kt") + public void testOverloadByReceiver() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/arguments/overloadByReceiver.kt"); + } + + @Test + @TestMetadata("overloadWithDefault.kt") + public void testOverloadWithDefault() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/arguments/overloadWithDefault.kt"); + } + + @Test + @TestMetadata("simple.kt") + public void testSimple() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/arguments/simple.kt"); + } + + @Test + @TestMetadata("stringTemplates.kt") + public void testStringTemplates() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/arguments/stringTemplates.kt"); + } + + @Test + @TestMetadata("tryInLambda.kt") + public void testTryInLambda() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/arguments/tryInLambda.kt"); + } + + @Test + @TestMetadata("untouchedReturnInIf.kt") + public void testUntouchedReturnInIf() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/arguments/untouchedReturnInIf.kt"); + } + + @Test + @TestMetadata("vararg.kt") + public void testVararg() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/arguments/vararg.kt"); + } + + @Test + @TestMetadata("varargOfLambdasWithReceiver.kt") + public void testVarargOfLambdasWithReceiver() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/arguments/varargOfLambdasWithReceiver.kt"); + } + + @Test + @TestMetadata("varargProjection.kt") + public void testVarargProjection() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/arguments/varargProjection.kt"); } } @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers") + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/arrays") @TestDataPath("$PROJECT_ROOT") @Execution(ExecutionMode.SAME_THREAD) - public class Receivers extends AbstractFirDiagnosticsWithLightTreeTest { + public class Arrays extends AbstractFirDiagnosticsWithLightTreeTest { @Test - public void testAllFilesPresentInReceivers() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + public void testAllFilesPresentInArrays() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/arrays"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } @Test - @TestMetadata("implicitReceiverAsWhenSubject.kt") - public void testImplicitReceiverAsWhenSubject() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/implicitReceiverAsWhenSubject.kt"); + @TestMetadata("arraySet.kt") + public void testArraySet() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/arrays/arraySet.kt"); } @Test - @TestMetadata("implicitReceivers.kt") - public void testImplicitReceivers() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/implicitReceivers.kt"); - } - - @Test - @TestMetadata("mixingImplicitAndExplicitReceivers.kt") - public void testMixingImplicitAndExplicitReceivers() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/mixingImplicitAndExplicitReceivers.kt"); - } - - @Test - @TestMetadata("thisOfExtensionProperty.kt") - public void testThisOfExtensionProperty() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/thisOfExtensionProperty.kt"); + @TestMetadata("arraySetWithOperation.kt") + public void testArraySetWithOperation() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/arrays/arraySetWithOperation.kt"); } } @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls") + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/builtins") @TestDataPath("$PROJECT_ROOT") @Execution(ExecutionMode.SAME_THREAD) - public class SafeCalls extends AbstractFirDiagnosticsWithLightTreeTest { + public class Builtins extends AbstractFirDiagnosticsWithLightTreeTest { @Test - public void testAllFilesPresentInSafeCalls() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + public void testAllFilesPresentInBuiltins() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/builtins"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } @Test - @TestMetadata("assignSafeCall.kt") - public void testAssignSafeCall() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/assignSafeCall.kt"); + @TestMetadata("lists.kt") + public void testLists() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/builtins/lists.kt"); + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/callResolution") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class CallResolution extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInCallResolution() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/callResolution"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } @Test - @TestMetadata("boundSafeCallAndIsCheck.kt") - public void testBoundSafeCallAndIsCheck() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/boundSafeCallAndIsCheck.kt"); + @TestMetadata("companionInvoke.kt") + public void testCompanionInvoke() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/companionInvoke.kt"); } @Test - @TestMetadata("safeCallAndEqualityToBool.kt") - public void testSafeCallAndEqualityToBool() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCallAndEqualityToBool.kt"); + @TestMetadata("companionVsSuperStatic.kt") + public void testCompanionVsSuperStatic() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/companionVsSuperStatic.kt"); + } + + @Test + @TestMetadata("debugExpressionType.kt") + public void testDebugExpressionType() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/debugExpressionType.kt"); + } + + @Test + @TestMetadata("debugInfoCall.kt") + public void testDebugInfoCall() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/debugInfoCall.kt"); + } + + @Test + @TestMetadata("errorCandidates.kt") + public void testErrorCandidates() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/errorCandidates.kt"); + } + + @Test + @TestMetadata("extensionInvokeAfterSafeCall.kt") + public void testExtensionInvokeAfterSafeCall() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/extensionInvokeAfterSafeCall.kt"); + } + + @Test + @TestMetadata("invokeAmbiguity.kt") + public void testInvokeAmbiguity() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/invokeAmbiguity.kt"); + } + + @Test + @TestMetadata("invokeWithReceiverAndArgument.kt") + public void testInvokeWithReceiverAndArgument() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/invokeWithReceiverAndArgument.kt"); + } + + @Test + @TestMetadata("lambdaAsReceiver.kt") + public void testLambdaAsReceiver() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/lambdaAsReceiver.kt"); + } + + @Test + @TestMetadata("objectInvoke.kt") + public void testObjectInvoke() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/objectInvoke.kt"); + } + + @Test + @TestMetadata("safeCallOnTypeAlias.kt") + public void testSafeCallOnTypeAlias() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/safeCallOnTypeAlias.kt"); + } + + @Test + @TestMetadata("superAny.kt") + public void testSuperAny() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/superAny.kt"); + } + + @Test + @TestMetadata("syntheticPropertiesWrongImplicitReceiver.kt") + public void testSyntheticPropertiesWrongImplicitReceiver() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/syntheticPropertiesWrongImplicitReceiver.kt"); + } + + @Test + @TestMetadata("typeAliasWithNotNullBound.kt") + public void testTypeAliasWithNotNullBound() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/typeAliasWithNotNullBound.kt"); + } + + @Test + @TestMetadata("uselessMultipleBounds.kt") + public void testUselessMultipleBounds() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/callResolution/uselessMultipleBounds.kt"); + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/cfg") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class Cfg extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInCfg() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/cfg"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("annotatedLocalClass.kt") + public void testAnnotatedLocalClass() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/cfg/annotatedLocalClass.kt"); + } + + @Test + @TestMetadata("binaryOperations.kt") + public void testBinaryOperations() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/cfg/binaryOperations.kt"); + } + + @Test + @TestMetadata("booleanOperatorsWithConsts.kt") + public void testBooleanOperatorsWithConsts() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/cfg/booleanOperatorsWithConsts.kt"); + } + + @Test + @TestMetadata("complex.kt") + public void testComplex() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/cfg/complex.kt"); + } + + @Test + @TestMetadata("defaultArguments.kt") + public void testDefaultArguments() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/cfg/defaultArguments.kt"); + } + + @Test + @TestMetadata("emptyWhen.kt") + public void testEmptyWhen() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/cfg/emptyWhen.kt"); + } + + @Test + @TestMetadata("flowFromInplaceLambda.kt") + public void testFlowFromInplaceLambda() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/cfg/flowFromInplaceLambda.kt"); + } + + @Test + @TestMetadata("initBlock.kt") + public void testInitBlock() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/cfg/initBlock.kt"); + } + + @Test + @TestMetadata("initBlockAndInPlaceLambda.kt") + public void testInitBlockAndInPlaceLambda() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/cfg/initBlockAndInPlaceLambda.kt"); + } + + @Test + @TestMetadata("innerClassInAnonymousObject.kt") + public void testInnerClassInAnonymousObject() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/cfg/innerClassInAnonymousObject.kt"); + } + + @Test + @TestMetadata("inplaceLambdaInControlFlowExpressions.kt") + public void testInplaceLambdaInControlFlowExpressions() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/cfg/inplaceLambdaInControlFlowExpressions.kt"); + } + + @Test + @TestMetadata("jumps.kt") + public void testJumps() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/cfg/jumps.kt"); + } + + @Test + @TestMetadata("lambdaAsReturnOfLambda.kt") + public void testLambdaAsReturnOfLambda() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/cfg/lambdaAsReturnOfLambda.kt"); + } + + @Test + @TestMetadata("lambdaReturningObject.kt") + public void testLambdaReturningObject() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/cfg/lambdaReturningObject.kt"); + } + + @Test + @TestMetadata("lambdas.kt") + public void testLambdas() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/cfg/lambdas.kt"); + } + + @Test + @TestMetadata("localClassesWithImplicit.kt") + public void testLocalClassesWithImplicit() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/cfg/localClassesWithImplicit.kt"); + } + + @Test + @TestMetadata("loops.kt") + public void testLoops() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/cfg/loops.kt"); + } + + @Test + @TestMetadata("postponedLambdaInConstructor.kt") + public void testPostponedLambdaInConstructor() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/cfg/postponedLambdaInConstructor.kt"); + } + + @Test + @TestMetadata("postponedLambdas.kt") + public void testPostponedLambdas() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/cfg/postponedLambdas.kt"); + } + + @Test + @TestMetadata("propertiesAndInitBlocks.kt") + public void testPropertiesAndInitBlocks() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/cfg/propertiesAndInitBlocks.kt"); + } + + @Test + @TestMetadata("returnValuesFromLambda.kt") + public void testReturnValuesFromLambda() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/cfg/returnValuesFromLambda.kt"); } @Test @TestMetadata("safeCalls.kt") public void testSafeCalls() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCalls.kt"); + runTest("compiler/fir/analysis-tests/testData/resolve/cfg/safeCalls.kt"); + } + + @Test + @TestMetadata("simple.kt") + public void testSimple() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/cfg/simple.kt"); + } + + @Test + @TestMetadata("tryCatch.kt") + public void testTryCatch() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/cfg/tryCatch.kt"); + } + + @Test + @TestMetadata("when.kt") + public void testWhen() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/cfg/when.kt"); } } @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/smartcasts/stability") + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/constructors") @TestDataPath("$PROJECT_ROOT") @Execution(ExecutionMode.SAME_THREAD) - public class Stability extends AbstractFirDiagnosticsWithLightTreeTest { + public class Constructors extends AbstractFirDiagnosticsWithLightTreeTest { @Test - public void testAllFilesPresentInStability() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/smartcasts/stability"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + public void testAllFilesPresentInConstructors() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/constructors"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } @Test - @TestMetadata("overridenOpenVal.kt") - public void testOverridenOpenVal() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/stability/overridenOpenVal.kt"); + @TestMetadata("noSuperCallInSupertypes.kt") + public void testNoSuperCallInSupertypes() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/constructors/noSuperCallInSupertypes.kt"); } } @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/smartcasts/variables") + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/delegates") @TestDataPath("$PROJECT_ROOT") @Execution(ExecutionMode.SAME_THREAD) - public class Variables extends AbstractFirDiagnosticsWithLightTreeTest { + public class Delegates extends AbstractFirDiagnosticsWithLightTreeTest { @Test - public void testAllFilesPresentInVariables() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/smartcasts/variables"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + public void testAllFilesPresentInDelegates() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/delegates"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } @Test - @TestMetadata("delayedAssignment.kt") - public void testDelayedAssignment() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/delayedAssignment.kt"); + @TestMetadata("delegateInference.kt") + public void testDelegateInference() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/delegates/delegateInference.kt"); } @Test - @TestMetadata("smartcastAfterReassignment.kt") - public void testSmartcastAfterReassignment() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/smartcastAfterReassignment.kt"); + @TestMetadata("delegateWithLambda.kt") + public void testDelegateWithLambda() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/delegates/delegateWithLambda.kt"); + } + + @Test + @TestMetadata("extensionGenericGetValue.kt") + public void testExtensionGenericGetValue() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/delegates/extensionGenericGetValue.kt"); + } + + @Test + @TestMetadata("extensionGetValueWithTypeVariableAsReceiver.kt") + public void testExtensionGetValueWithTypeVariableAsReceiver() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/delegates/extensionGetValueWithTypeVariableAsReceiver.kt"); + } + + @Test + @TestMetadata("kt41982.kt") + public void testKt41982() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/delegates/kt41982.kt"); + } + + @Test + @TestMetadata("provideDelegate.kt") + public void testProvideDelegate() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/delegates/provideDelegate.kt"); + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/diagnostics") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class Diagnostics extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + @TestMetadata("abstractSuperCall.kt") + public void testAbstractSuperCall() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/abstractSuperCall.kt"); + } + + @Test + @TestMetadata("abstractSuperCallInPresenseOfNonAbstractMethodInParent.kt") + public void testAbstractSuperCallInPresenseOfNonAbstractMethodInParent() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/abstractSuperCallInPresenseOfNonAbstractMethodInParent.kt"); + } + + @Test + public void testAllFilesPresentInDiagnostics() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/diagnostics"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("annotationArgumentKClassLiteralTypeError.kt") + public void testAnnotationArgumentKClassLiteralTypeError() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/annotationArgumentKClassLiteralTypeError.kt"); + } + + @Test + @TestMetadata("annotationArgumentMustBeConst.kt") + public void testAnnotationArgumentMustBeConst() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/annotationArgumentMustBeConst.kt"); + } + + @Test + @TestMetadata("annotationArgumentMustBeEnumConst.kt") + public void testAnnotationArgumentMustBeEnumConst() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/annotationArgumentMustBeEnumConst.kt"); + } + + @Test + @TestMetadata("annotationArgumentMustBeKClassLiteral.kt") + public void testAnnotationArgumentMustBeKClassLiteral() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/annotationArgumentMustBeKClassLiteral.kt"); + } + + @Test + @TestMetadata("annotationClassMember.kt") + public void testAnnotationClassMember() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/annotationClassMember.kt"); + } + + @Test + @TestMetadata("anonymousObjectByDelegate.kt") + public void testAnonymousObjectByDelegate() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/anonymousObjectByDelegate.kt"); + } + + @Test + @TestMetadata("classInSupertypeForEnum.kt") + public void testClassInSupertypeForEnum() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/classInSupertypeForEnum.kt"); + } + + @Test + @TestMetadata("conflictingOverloads.kt") + public void testConflictingOverloads() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/conflictingOverloads.kt"); + } + + @Test + @TestMetadata("conflictingProjection.kt") + public void testConflictingProjection() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/conflictingProjection.kt"); + } + + @Test + @TestMetadata("constructorInInterface.kt") + public void testConstructorInInterface() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/constructorInInterface.kt"); + } + + @Test + @TestMetadata("cyclicConstructorDelegationCall.kt") + public void testCyclicConstructorDelegationCall() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/cyclicConstructorDelegationCall.kt"); + } + + @Test + @TestMetadata("delegationInInterface.kt") + public void testDelegationInInterface() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/delegationInInterface.kt"); + } + + @Test + @TestMetadata("delegationSuperCallInEnumConstructor.kt") + public void testDelegationSuperCallInEnumConstructor() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/delegationSuperCallInEnumConstructor.kt"); + } + + @Test + @TestMetadata("explicitDelegationCallRequired.kt") + public void testExplicitDelegationCallRequired() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/explicitDelegationCallRequired.kt"); + } + + @Test + @TestMetadata("inapplicableLateinitModifier.kt") + public void testInapplicableLateinitModifier() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/inapplicableLateinitModifier.kt"); + } + + @Test + @TestMetadata("incompatibleModifiers.kt") + public void testIncompatibleModifiers() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/incompatibleModifiers.kt"); + } + + @Test + @TestMetadata("infixFunctions.kt") + public void testInfixFunctions() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/infixFunctions.kt"); + } + + @Test + @TestMetadata("instanceAccessBeforeSuperCall.kt") + public void testInstanceAccessBeforeSuperCall() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/instanceAccessBeforeSuperCall.kt"); + } + + @Test + @TestMetadata("interfaceWithSuperclass.kt") + public void testInterfaceWithSuperclass() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/interfaceWithSuperclass.kt"); + } + + @Test + @TestMetadata("localAnnotationClass.kt") + public void testLocalAnnotationClass() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/localAnnotationClass.kt"); + } + + @Test + @TestMetadata("localEntitytNotAllowed.kt") + public void testLocalEntitytNotAllowed() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/localEntitytNotAllowed.kt"); + } + + @Test + @TestMetadata("manyCompanionObjects.kt") + public void testManyCompanionObjects() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/manyCompanionObjects.kt"); + } + + @Test + @TestMetadata("methodOfAnyImplementedInInterface.kt") + public void testMethodOfAnyImplementedInInterface() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/methodOfAnyImplementedInInterface.kt"); + } + + @Test + @TestMetadata("nonConstValInAnnotationArgument.kt") + public void testNonConstValInAnnotationArgument() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/nonConstValInAnnotationArgument.kt"); + } + + @Test + @TestMetadata("notASupertype.kt") + public void testNotASupertype() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/notASupertype.kt"); + } + + @Test + @TestMetadata("primaryConstructorRequiredForDataClass.kt") + public void testPrimaryConstructorRequiredForDataClass() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/primaryConstructorRequiredForDataClass.kt"); + } + + @Test + @TestMetadata("projectionsOnNonClassTypeArguments.kt") + public void testProjectionsOnNonClassTypeArguments() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/projectionsOnNonClassTypeArguments.kt"); + } + + @Test + @TestMetadata("propertyTypeMismatchOnOverride.kt") + public void testPropertyTypeMismatchOnOverride() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/propertyTypeMismatchOnOverride.kt"); + } + + @Test + @TestMetadata("qualifiedSupertypeExtendedByOtherSupertype.kt") + public void testQualifiedSupertypeExtendedByOtherSupertype() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/qualifiedSupertypeExtendedByOtherSupertype.kt"); + } + + @Test + @TestMetadata("redundantModifier.kt") + public void testRedundantModifier() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/redundantModifier.kt"); + } + + @Test + @TestMetadata("repeatedModifier.kt") + public void testRepeatedModifier() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/repeatedModifier.kt"); + } + + @Test + @TestMetadata("returnTypeMismatchOnOverride.kt") + public void testReturnTypeMismatchOnOverride() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/returnTypeMismatchOnOverride.kt"); + } + + @Test + @TestMetadata("sealedClassConstructorCall.kt") + public void testSealedClassConstructorCall() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/sealedClassConstructorCall.kt"); + } + + @Test + @TestMetadata("sealedSupertype.kt") + public void testSealedSupertype() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/sealedSupertype.kt"); + } + + @Test + @TestMetadata("someOverridesTest.kt") + public void testSomeOverridesTest() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/someOverridesTest.kt"); + } + + @Test + @TestMetadata("superCallWithDelegation.kt") + public void testSuperCallWithDelegation() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/superCallWithDelegation.kt"); + } + + @Test + @TestMetadata("superIsNotAnExpression.kt") + public void testSuperIsNotAnExpression() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/superIsNotAnExpression.kt"); + } + + @Test + @TestMetadata("superNotAvailable.kt") + public void testSuperNotAvailable() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/superNotAvailable.kt"); + } + + @Test + @TestMetadata("superclassNotAccessibleFromInterface.kt") + public void testSuperclassNotAccessibleFromInterface() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/superclassNotAccessibleFromInterface.kt"); + } + + @Test + @TestMetadata("supertypeInitializedInInterface.kt") + public void testSupertypeInitializedInInterface() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/supertypeInitializedInInterface.kt"); + } + + @Test + @TestMetadata("supertypeInitializedWithoutPrimaryConstructor.kt") + public void testSupertypeInitializedWithoutPrimaryConstructor() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/supertypeInitializedWithoutPrimaryConstructor.kt"); + } + + @Test + @TestMetadata("testIllegalAnnotationClass.kt") + public void testTestIllegalAnnotationClass() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/testIllegalAnnotationClass.kt"); + } + + @Test + @TestMetadata("typeArgumentsNotAllowed.kt") + public void testTypeArgumentsNotAllowed() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/typeArgumentsNotAllowed.kt"); + } + + @Test + @TestMetadata("typeOfAnnotationMember.kt") + public void testTypeOfAnnotationMember() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/typeOfAnnotationMember.kt"); + } + + @Test + @TestMetadata("typeParametersInEnum.kt") + public void testTypeParametersInEnum() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/typeParametersInEnum.kt"); + } + + @Test + @TestMetadata("typeParametersInObject.kt") + public void testTypeParametersInObject() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/typeParametersInObject.kt"); + } + + @Test + @TestMetadata("upperBoundViolated.kt") + public void testUpperBoundViolated() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/upperBoundViolated.kt"); + } + + @Test + @TestMetadata("valOnAnnotationParameter.kt") + public void testValOnAnnotationParameter() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/valOnAnnotationParameter.kt"); + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/diagnostics/functionAsExpression") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class FunctionAsExpression extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInFunctionAsExpression() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/diagnostics/functionAsExpression"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("Parameters.kt") + public void testParameters() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/diagnostics/functionAsExpression/Parameters.kt"); + } + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/expresssions") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class Expresssions extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + @TestMetadata("access.kt") + public void testAccess() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/access.kt"); + } + + @Test + public void testAllFilesPresentInExpresssions() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/expresssions"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("annotationWithReturn.kt") + public void testAnnotationWithReturn() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/annotationWithReturn.kt"); + } + + @Test + @TestMetadata("annotations.kt") + public void testAnnotations() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/annotations.kt"); + } + + @Test + @TestMetadata("baseQualifier.kt") + public void testBaseQualifier() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/baseQualifier.kt"); + } + + @Test + @TestMetadata("blockLocalScopes.kt") + public void testBlockLocalScopes() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/blockLocalScopes.kt"); + } + + @Test + @TestMetadata("CallBasedInExpressionGenerator.kt") + public void testCallBasedInExpressionGenerator() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/CallBasedInExpressionGenerator.kt"); + } + + @Test + @TestMetadata("checkArguments.kt") + public void testCheckArguments() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/checkArguments.kt"); + } + + @Test + @TestMetadata("classifierAccessFromCompanion.kt") + public void testClassifierAccessFromCompanion() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/classifierAccessFromCompanion.kt"); + } + + @Test + @TestMetadata("companion.kt") + public void testCompanion() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/companion.kt"); + } + + @Test + @TestMetadata("companionExtension.kt") + public void testCompanionExtension() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/companionExtension.kt"); + } + + @Test + @TestMetadata("constructor.kt") + public void testConstructor() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/constructor.kt"); + } + + @Test + @TestMetadata("dispatchReceiver.kt") + public void testDispatchReceiver() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/dispatchReceiver.kt"); + } + + @Test + @TestMetadata("enumEntryUse.kt") + public void testEnumEntryUse() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/enumEntryUse.kt"); + } + + @Test + @TestMetadata("enumValues.kt") + public void testEnumValues() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/enumValues.kt"); + } + + @Test + @TestMetadata("errCallable.kt") + public void testErrCallable() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/errCallable.kt"); + } + + @Test + @TestMetadata("extensionPropertyInLambda.kt") + public void testExtensionPropertyInLambda() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/extensionPropertyInLambda.kt"); + } + + @Test + @TestMetadata("genericDecorator.kt") + public void testGenericDecorator() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/genericDecorator.kt"); + } + + @Test + @TestMetadata("genericDescriptor.kt") + public void testGenericDescriptor() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/genericDescriptor.kt"); + } + + @Test + @TestMetadata("genericDiagnostic.kt") + public void testGenericDiagnostic() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/genericDiagnostic.kt"); + } + + @Test + @TestMetadata("genericPropertyAccess.kt") + public void testGenericPropertyAccess() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/genericPropertyAccess.kt"); + } + + @Test + @TestMetadata("genericUsedInFunction.kt") + public void testGenericUsedInFunction() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/genericUsedInFunction.kt"); + } + + @Test + @TestMetadata("importedReceiver.kt") + public void testImportedReceiver() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/importedReceiver.kt"); + } + + @Test + @TestMetadata("innerQualifier.kt") + public void testInnerQualifier() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/innerQualifier.kt"); + } + + @Test + @TestMetadata("innerWithSuperCompanion.kt") + public void testInnerWithSuperCompanion() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/innerWithSuperCompanion.kt"); + } + + @Test + @TestMetadata("javaFieldCallable.kt") + public void testJavaFieldCallable() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/javaFieldCallable.kt"); + } + + @Test + @TestMetadata("lambda.kt") + public void testLambda() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/lambda.kt"); + } + + @Test + @TestMetadata("lambdaWithReceiver.kt") + public void testLambdaWithReceiver() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/lambdaWithReceiver.kt"); + } + + @Test + @TestMetadata("localClassAccessesContainingClass.kt") + public void testLocalClassAccessesContainingClass() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/localClassAccessesContainingClass.kt"); + } + + @Test + @TestMetadata("localConstructor.kt") + public void testLocalConstructor() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/localConstructor.kt"); + } + + @Test + @TestMetadata("localExtension.kt") + public void testLocalExtension() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/localExtension.kt"); + } + + @Test + @TestMetadata("localImplicitBodies.kt") + public void testLocalImplicitBodies() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/localImplicitBodies.kt"); + } + + @Test + @TestMetadata("localInnerClass.kt") + public void testLocalInnerClass() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/localInnerClass.kt"); + } + + @Test + @TestMetadata("localObjects.kt") + public void testLocalObjects() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/localObjects.kt"); + } + + @Test + @TestMetadata("localScopes.kt") + public void testLocalScopes() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/localScopes.kt"); + } + + @Test + @TestMetadata("localTypes.kt") + public void testLocalTypes() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/localTypes.kt"); + } + + @Test + @TestMetadata("localWithBooleanNot.kt") + public void testLocalWithBooleanNot() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/localWithBooleanNot.kt"); + } + + @Test + @TestMetadata("memberExtension.kt") + public void testMemberExtension() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/memberExtension.kt"); + } + + @Test + @TestMetadata("nestedConstructorCallable.kt") + public void testNestedConstructorCallable() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/nestedConstructorCallable.kt"); + } + + @Test + @TestMetadata("nestedObjects.kt") + public void testNestedObjects() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/nestedObjects.kt"); + } + + @Test + @TestMetadata("nestedVisibility.kt") + public void testNestedVisibility() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/nestedVisibility.kt"); + } + + @Test + @TestMetadata("objectOverrideCallViaImport.kt") + public void testObjectOverrideCallViaImport() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/objectOverrideCallViaImport.kt"); + } + + @Test + @TestMetadata("objectVsProperty.kt") + public void testObjectVsProperty() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/objectVsProperty.kt"); + } + + @Test + @TestMetadata("objects.kt") + public void testObjects() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/objects.kt"); + } + + @Test + @TestMetadata("outerMemberAccesses.kt") + public void testOuterMemberAccesses() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/outerMemberAccesses.kt"); + } + + @Test + @TestMetadata("outerObject.kt") + public void testOuterObject() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/outerObject.kt"); + } + + @Test + @TestMetadata("overriddenJavaGetter.kt") + public void testOverriddenJavaGetter() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/overriddenJavaGetter.kt"); + } + + @Test + @TestMetadata("privateObjectLiteral.kt") + public void testPrivateObjectLiteral() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/privateObjectLiteral.kt"); + } + + @Test + @TestMetadata("privateVisibility.kt") + public void testPrivateVisibility() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/privateVisibility.kt"); + } + + @Test + @TestMetadata("protectedVisibility.kt") + public void testProtectedVisibility() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/protectedVisibility.kt"); + } + + @Test + @TestMetadata("qualifiedExpressions.kt") + public void testQualifiedExpressions() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/qualifiedExpressions.kt"); + } + + @Test + @TestMetadata("qualifierPriority.kt") + public void testQualifierPriority() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/qualifierPriority.kt"); + } + + @Test + @TestMetadata("receiverConsistency.kt") + public void testReceiverConsistency() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/receiverConsistency.kt"); + } + + @Test + @TestMetadata("sameReceiver.kt") + public void testSameReceiver() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/sameReceiver.kt"); + } + + @Test + @TestMetadata("simple.kt") + public void testSimple() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/simple.kt"); + } + + @Test + @TestMetadata("syntheticInImplicitBody.kt") + public void testSyntheticInImplicitBody() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/syntheticInImplicitBody.kt"); + } + + @Test + @TestMetadata("syntheticSmartCast.kt") + public void testSyntheticSmartCast() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/syntheticSmartCast.kt"); + } + + @Test + @TestMetadata("this.kt") + public void testThis() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/this.kt"); + } + + @Test + @TestMetadata("topExtensionVsOuterMember.kt") + public void testTopExtensionVsOuterMember() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/topExtensionVsOuterMember.kt"); + } + + @Test + @TestMetadata("typeAliasConstructor.kt") + public void testTypeAliasConstructor() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/typeAliasConstructor.kt"); + } + + @Test + @TestMetadata("vararg.kt") + public void testVararg() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/vararg.kt"); + } + + @Test + @TestMetadata("when.kt") + public void testWhen() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/when.kt"); + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/expresssions/inference") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class Inference extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInInference() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/expresssions/inference"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("id.kt") + public void testId() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/inference/id.kt"); + } + + @Test + @TestMetadata("typeParameters.kt") + public void testTypeParameters() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/inference/typeParameters.kt"); + } + + @Test + @TestMetadata("typeParameters2.kt") + public void testTypeParameters2() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/inference/typeParameters2.kt"); + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class Invoke extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInInvoke() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("doubleBrackets.kt") + public void testDoubleBrackets() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/doubleBrackets.kt"); + } + + @Test + @TestMetadata("explicitReceiver.kt") + public void testExplicitReceiver() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/explicitReceiver.kt"); + } + + @Test + @TestMetadata("explicitReceiver2.kt") + public void testExplicitReceiver2() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/explicitReceiver2.kt"); + } + + @Test + @TestMetadata("extension.kt") + public void testExtension() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/extension.kt"); + } + + @Test + @TestMetadata("extensionOnObject.kt") + public void testExtensionOnObject() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/extensionOnObject.kt"); + } + + @Test + @TestMetadata("extensionSafeCall.kt") + public void testExtensionSafeCall() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/extensionSafeCall.kt"); + } + + @Test + @TestMetadata("farInvokeExtension.kt") + public void testFarInvokeExtension() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/farInvokeExtension.kt"); + } + + @Test + @TestMetadata("implicitTypeOrder.kt") + public void testImplicitTypeOrder() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/implicitTypeOrder.kt"); + } + + @Test + @TestMetadata("inBrackets.kt") + public void testInBrackets() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/inBrackets.kt"); + } + + @Test + @TestMetadata("incorrectInvokeReceiver.kt") + public void testIncorrectInvokeReceiver() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/incorrectInvokeReceiver.kt"); + } + + @Test + @TestMetadata("propertyFromParameter.kt") + public void testPropertyFromParameter() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/propertyFromParameter.kt"); + } + + @Test + @TestMetadata("propertyWithExtensionType.kt") + public void testPropertyWithExtensionType() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/propertyWithExtensionType.kt"); + } + + @Test + @TestMetadata("simple.kt") + public void testSimple() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/simple.kt"); + } + + @Test + @TestMetadata("threeReceivers.kt") + public void testThreeReceivers() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/threeReceivers.kt"); + } + + @Test + @TestMetadata("threeReceiversCorrect.kt") + public void testThreeReceiversCorrect() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/invoke/threeReceiversCorrect.kt"); + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/expresssions/operators") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class Operators extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInOperators() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/expresssions/operators"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("plus.kt") + public void testPlus() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/operators/plus.kt"); + } + + @Test + @TestMetadata("plusAndPlusAssign.kt") + public void testPlusAndPlusAssign() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/operators/plusAndPlusAssign.kt"); + } + + @Test + @TestMetadata("plusAssign.kt") + public void testPlusAssign() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/expresssions/operators/plusAssign.kt"); + } + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/extendedCheckers") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class ExtendedCheckers extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInExtendedCheckers() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/extendedCheckers"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("ArrayEqualityCanBeReplacedWithEquals.kt") + public void testArrayEqualityCanBeReplacedWithEquals() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/ArrayEqualityCanBeReplacedWithEquals.kt"); + } + + @Test + @TestMetadata("CanBeValChecker.kt") + public void testCanBeValChecker() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/CanBeValChecker.kt"); + } + + @Test + @TestMetadata("RedundantExplicitTypeChecker.kt") + public void testRedundantExplicitTypeChecker() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantExplicitTypeChecker.kt"); + } + + @Test + @TestMetadata("RedundantModalityModifierChecker.kt") + public void testRedundantModalityModifierChecker() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantModalityModifierChecker.kt"); + } + + @Test + @TestMetadata("RedundantReturnUnitTypeChecker.kt") + public void testRedundantReturnUnitTypeChecker() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantReturnUnitTypeChecker.kt"); + } + + @Test + @TestMetadata("RedundantSetterParameterTypeChecker.kt") + public void testRedundantSetterParameterTypeChecker() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantSetterParameterTypeChecker.kt"); + } + + @Test + @TestMetadata("RedundantSingleExpressionStringTemplateChecker.kt") + public void testRedundantSingleExpressionStringTemplateChecker() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantSingleExpressionStringTemplateChecker.kt"); + } + + @Test + @TestMetadata("RedundantVisibilityModifierChecker.kt") + public void testRedundantVisibilityModifierChecker() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantVisibilityModifierChecker.kt"); + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/canBeReplacedWithOperatorAssignment") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class CanBeReplacedWithOperatorAssignment extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInCanBeReplacedWithOperatorAssignment() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/canBeReplacedWithOperatorAssignment"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("BasicTest.kt") + public void testBasicTest() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/canBeReplacedWithOperatorAssignment/BasicTest.kt"); + } + + @Test + @TestMetadata("ComplexExpression.kt") + public void testComplexExpression() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/canBeReplacedWithOperatorAssignment/ComplexExpression.kt"); + } + + @Test + @TestMetadata("flexibleTypeBug.kt") + public void testFlexibleTypeBug() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/canBeReplacedWithOperatorAssignment/flexibleTypeBug.kt"); + } + + @Test + @TestMetadata("illegalMultipleOperators.kt") + public void testIllegalMultipleOperators() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/canBeReplacedWithOperatorAssignment/illegalMultipleOperators.kt"); + } + + @Test + @TestMetadata("illegalMultipleOperatorsMiddle.kt") + public void testIllegalMultipleOperatorsMiddle() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/canBeReplacedWithOperatorAssignment/illegalMultipleOperatorsMiddle.kt"); + } + + @Test + @TestMetadata("invalidSubtraction.kt") + public void testInvalidSubtraction() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/canBeReplacedWithOperatorAssignment/invalidSubtraction.kt"); + } + + @Test + @TestMetadata("list.kt") + public void testList() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/canBeReplacedWithOperatorAssignment/list.kt"); + } + + @Test + @TestMetadata("logicOperators.kt") + public void testLogicOperators() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/canBeReplacedWithOperatorAssignment/logicOperators.kt"); + } + + @Test + @TestMetadata("multipleOperators.kt") + public void testMultipleOperators() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/canBeReplacedWithOperatorAssignment/multipleOperators.kt"); + } + + @Test + @TestMetadata("multipleOperatorsRightSideRepeat.kt") + public void testMultipleOperatorsRightSideRepeat() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/canBeReplacedWithOperatorAssignment/multipleOperatorsRightSideRepeat.kt"); + } + + @Test + @TestMetadata("mutableList.kt") + public void testMutableList() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/canBeReplacedWithOperatorAssignment/mutableList.kt"); + } + + @Test + @TestMetadata("nonCommutativeRepeat.kt") + public void testNonCommutativeRepeat() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/canBeReplacedWithOperatorAssignment/nonCommutativeRepeat.kt"); + } + + @Test + @TestMetadata("nonRepeatingAssignment.kt") + public void testNonRepeatingAssignment() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/canBeReplacedWithOperatorAssignment/nonRepeatingAssignment.kt"); + } + + @Test + @TestMetadata("OperatorAssignment.kt") + public void testOperatorAssignment() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/canBeReplacedWithOperatorAssignment/OperatorAssignment.kt"); + } + + @Test + @TestMetadata("plusAssignConflict.kt") + public void testPlusAssignConflict() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/canBeReplacedWithOperatorAssignment/plusAssignConflict.kt"); + } + + @Test + @TestMetadata("rightSideRepeat.kt") + public void testRightSideRepeat() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/canBeReplacedWithOperatorAssignment/rightSideRepeat.kt"); + } + + @Test + @TestMetadata("simpleAssign.kt") + public void testSimpleAssign() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/canBeReplacedWithOperatorAssignment/simpleAssign.kt"); + } + + @Test + @TestMetadata("validAddition.kt") + public void testValidAddition() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/canBeReplacedWithOperatorAssignment/validAddition.kt"); + } + + @Test + @TestMetadata("validSubtraction.kt") + public void testValidSubtraction() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/canBeReplacedWithOperatorAssignment/validSubtraction.kt"); + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/emptyRangeChecker") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class EmptyRangeChecker extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInEmptyRangeChecker() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/emptyRangeChecker"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("NoWarning.kt") + public void testNoWarning() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/emptyRangeChecker/NoWarning.kt"); + } + + @Test + @TestMetadata("Warning.kt") + public void testWarning() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/emptyRangeChecker/Warning.kt"); + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class RedundantCallOfConversionMethod extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInRedundantCallOfConversionMethod() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("booleanToInt.kt") + public void testBooleanToInt() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod/booleanToInt.kt"); + } + + @Test + @TestMetadata("byte.kt") + public void testByte() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod/byte.kt"); + } + + @Test + @TestMetadata("char.kt") + public void testChar() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod/char.kt"); + } + + @Test + @TestMetadata("double.kt") + public void testDouble() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod/double.kt"); + } + + @Test + @TestMetadata("float.kt") + public void testFloat() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod/float.kt"); + } + + @Test + @TestMetadata("int.kt") + public void testInt() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod/int.kt"); + } + + @Test + @TestMetadata("long.kt") + public void testLong() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod/long.kt"); + } + + @Test + @TestMetadata("nullable.kt") + public void testNullable() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod/nullable.kt"); + } + + @Test + @TestMetadata("nullable2.kt") + public void testNullable2() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod/nullable2.kt"); + } + + @Test + @TestMetadata("safeString.kt") + public void testSafeString() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod/safeString.kt"); + } + + @Test + @TestMetadata("safeString2.kt") + public void testSafeString2() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod/safeString2.kt"); + } + + @Test + @TestMetadata("short.kt") + public void testShort() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod/short.kt"); + } + + @Test + @TestMetadata("string.kt") + public void testString() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod/string.kt"); + } + + @Test + @TestMetadata("StringTemplate.kt") + public void testStringTemplate() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod/StringTemplate.kt"); + } + + @Test + @TestMetadata("toOtherType.kt") + public void testToOtherType() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod/toOtherType.kt"); + } + + @Test + @TestMetadata("uByte.kt") + public void testUByte() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod/uByte.kt"); + } + + @Test + @TestMetadata("uInt.kt") + public void testUInt() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod/uInt.kt"); + } + + @Test + @TestMetadata("uLong.kt") + public void testULong() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod/uLong.kt"); + } + + @Test + @TestMetadata("uShort.kt") + public void testUShort() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod/uShort.kt"); + } + + @Test + @TestMetadata("variable.kt") + public void testVariable() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/RedundantCallOfConversionMethod/variable.kt"); + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class Unused extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInUnused() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("classProperty.kt") + public void testClassProperty() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/classProperty.kt"); + } + + @Test + @TestMetadata("invoke.kt") + public void testInvoke() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/invoke.kt"); + } + + @Test + @TestMetadata("lambda.kt") + public void testLambda() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/lambda.kt"); + } + + @Test + @TestMetadata("localVariable.kt") + public void testLocalVariable() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/localVariable.kt"); + } + + @Test + @TestMetadata("manyLocalVariables.kt") + public void testManyLocalVariables() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/manyLocalVariables.kt"); + } + + @Test + @TestMetadata("usedInAnnotationArguments.kt") + public void testUsedInAnnotationArguments() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/usedInAnnotationArguments.kt"); + } + + @Test + @TestMetadata("valueIsNeverRead.kt") + public void testValueIsNeverRead() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/unused/valueIsNeverRead.kt"); + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/UselessCallOnNotNullChecker") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class UselessCallOnNotNullChecker extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInUselessCallOnNotNullChecker() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/UselessCallOnNotNullChecker"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("Basic.kt") + public void testBasic() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/UselessCallOnNotNullChecker/Basic.kt"); + } + + @Test + @TestMetadata("NotNullType.kt") + public void testNotNullType() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/UselessCallOnNotNullChecker/NotNullType.kt"); + } + + @Test + @TestMetadata("NotNullTypeChain.kt") + public void testNotNullTypeChain() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/UselessCallOnNotNullChecker/NotNullTypeChain.kt"); + } + + @Test + @TestMetadata("NullOrBlankSafe.kt") + public void testNullOrBlankSafe() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/UselessCallOnNotNullChecker/NullOrBlankSafe.kt"); + } + + @Test + @TestMetadata("NullOrEmpty.kt") + public void testNullOrEmpty() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/UselessCallOnNotNullChecker/NullOrEmpty.kt"); + } + + @Test + @TestMetadata("NullOrEmptyFake.kt") + public void testNullOrEmptyFake() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/UselessCallOnNotNullChecker/NullOrEmptyFake.kt"); + } + + @Test + @TestMetadata("NullOrEmptySafe.kt") + public void testNullOrEmptySafe() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/UselessCallOnNotNullChecker/NullOrEmptySafe.kt"); + } + + @Test + @TestMetadata("OrEmptyFake.kt") + public void testOrEmptyFake() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/UselessCallOnNotNullChecker/OrEmptyFake.kt"); + } + + @Test + @TestMetadata("SafeCall.kt") + public void testSafeCall() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/UselessCallOnNotNullChecker/SafeCall.kt"); + } + + @Test + @TestMetadata("Sequence.kt") + public void testSequence() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/UselessCallOnNotNullChecker/Sequence.kt"); + } + + @Test + @TestMetadata("String.kt") + public void testString() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/extendedCheckers/UselessCallOnNotNullChecker/String.kt"); + } + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/fromBuilder") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class FromBuilder extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInFromBuilder() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/fromBuilder"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("complexTypes.kt") + public void testComplexTypes() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/fromBuilder/complexTypes.kt"); + } + + @Test + @TestMetadata("enums.kt") + public void testEnums() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/fromBuilder/enums.kt"); + } + + @Test + @TestMetadata("noPrimaryConstructor.kt") + public void testNoPrimaryConstructor() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/fromBuilder/noPrimaryConstructor.kt"); + } + + @Test + @TestMetadata("simpleClass.kt") + public void testSimpleClass() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/fromBuilder/simpleClass.kt"); + } + + @Test + @TestMetadata("typeParameters.kt") + public void testTypeParameters() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/fromBuilder/typeParameters.kt"); + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/inference") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class Inference extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInInference() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/inference"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("callableReferenceOnInstance.kt") + public void testCallableReferenceOnInstance() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/inference/callableReferenceOnInstance.kt"); + } + + @Test + @TestMetadata("callableReferenceToLocalClass.kt") + public void testCallableReferenceToLocalClass() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/inference/callableReferenceToLocalClass.kt"); + } + + @Test + @TestMetadata("callableReferencesAndDefaultParameters.kt") + public void testCallableReferencesAndDefaultParameters() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/inference/callableReferencesAndDefaultParameters.kt"); + } + + @Test + @TestMetadata("capturedTypeForJavaTypeParameter.kt") + public void testCapturedTypeForJavaTypeParameter() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/inference/capturedTypeForJavaTypeParameter.kt"); + } + + @Test + @TestMetadata("coercionToUnitWithEarlyReturn.kt") + public void testCoercionToUnitWithEarlyReturn() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/inference/coercionToUnitWithEarlyReturn.kt"); + } + + @Test + @TestMetadata("definitelyNotNullIntersectionType.kt") + public void testDefinitelyNotNullIntersectionType() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/inference/definitelyNotNullIntersectionType.kt"); + } + + @Test + @TestMetadata("extensionCallableReferences.kt") + public void testExtensionCallableReferences() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/inference/extensionCallableReferences.kt"); + } + + @Test + @TestMetadata("integerLiteralAsComparable.kt") + public void testIntegerLiteralAsComparable() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/inference/integerLiteralAsComparable.kt"); + } + + @Test + @TestMetadata("intersectionTypesInConstraints.kt") + public void testIntersectionTypesInConstraints() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/inference/intersectionTypesInConstraints.kt"); + } + + @Test + @TestMetadata("kt40131.kt") + public void testKt40131() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/inference/kt40131.kt"); + } + + @Test + @TestMetadata("kt41989.kt") + public void testKt41989() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/inference/kt41989.kt"); + } + + @Test + @TestMetadata("lambdaAsReturnStatementOfLambda.kt") + public void testLambdaAsReturnStatementOfLambda() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/inference/lambdaAsReturnStatementOfLambda.kt"); + } + + @Test + @TestMetadata("lambdaInElvis.kt") + public void testLambdaInElvis() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/inference/lambdaInElvis.kt"); + } + + @Test + @TestMetadata("lambdasReturns.kt") + public void testLambdasReturns() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/inference/lambdasReturns.kt"); + } + + @Test + @TestMetadata("nestedExtensionFunctionType.kt") + public void testNestedExtensionFunctionType() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/inference/nestedExtensionFunctionType.kt"); + } + + @Test + @TestMetadata("nestedLambdas.kt") + public void testNestedLambdas() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/inference/nestedLambdas.kt"); + } + + @Test + @TestMetadata("nullableIntegerLiteralType.kt") + public void testNullableIntegerLiteralType() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/inference/nullableIntegerLiteralType.kt"); + } + + @Test + @TestMetadata("receiverWithCapturedType.kt") + public void testReceiverWithCapturedType() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/inference/receiverWithCapturedType.kt"); + } + + @Test + @TestMetadata("simpleCapturedTypes.kt") + public void testSimpleCapturedTypes() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/inference/simpleCapturedTypes.kt"); + } + + @Test + @TestMetadata("typeDepthForTypeAlias.kt") + public void testTypeDepthForTypeAlias() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/inference/typeDepthForTypeAlias.kt"); + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/innerClasses") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class InnerClasses extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInInnerClasses() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/innerClasses"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("inner.kt") + public void testInner() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/innerClasses/inner.kt"); + } + + @Test + @TestMetadata("innerTypeFromSuperClassInBody.kt") + public void testInnerTypeFromSuperClassInBody() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/innerClasses/innerTypeFromSuperClassInBody.kt"); + } + + @Test + @TestMetadata("innerTypes.kt") + public void testInnerTypes() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/innerClasses/innerTypes.kt"); + } + + @Test + @TestMetadata("simple.kt") + public void testSimple() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/innerClasses/simple.kt"); + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/localClasses") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class LocalClasses extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInLocalClasses() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/localClasses"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("implicitInAnonymous.kt") + public void testImplicitInAnonymous() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/localClasses/implicitInAnonymous.kt"); + } + + @Test + @TestMetadata("implicitInLocalClasses.kt") + public void testImplicitInLocalClasses() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/localClasses/implicitInLocalClasses.kt"); + } + + @Test + @TestMetadata("typesFromSuperClasses.kt") + public void testTypesFromSuperClasses() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/localClasses/typesFromSuperClasses.kt"); + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/multifile") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class Multifile extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInMultifile() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/multifile"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("Annotations.kt") + public void testAnnotations() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/multifile/Annotations.kt"); + } + + @Test + @TestMetadata("ByteArray.kt") + public void testByteArray() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/multifile/ByteArray.kt"); + } + + @Test + @TestMetadata("importFromObject.kt") + public void testImportFromObject() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/multifile/importFromObject.kt"); + } + + @Test + @TestMetadata("NestedSuperType.kt") + public void testNestedSuperType() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/multifile/NestedSuperType.kt"); + } + + @Test + @TestMetadata("sealedStarImport.kt") + public void testSealedStarImport() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/multifile/sealedStarImport.kt"); + } + + @Test + @TestMetadata("simpleAliasedImport.kt") + public void testSimpleAliasedImport() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/multifile/simpleAliasedImport.kt"); + } + + @Test + @TestMetadata("simpleImport.kt") + public void testSimpleImport() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/multifile/simpleImport.kt"); + } + + @Test + @TestMetadata("simpleImportNested.kt") + public void testSimpleImportNested() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/multifile/simpleImportNested.kt"); + } + + @Test + @TestMetadata("simpleImportOuter.kt") + public void testSimpleImportOuter() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/multifile/simpleImportOuter.kt"); + } + + @Test + @TestMetadata("simpleStarImport.kt") + public void testSimpleStarImport() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/multifile/simpleStarImport.kt"); + } + + @Test + @TestMetadata("TypeAliasExpansion.kt") + public void testTypeAliasExpansion() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/multifile/TypeAliasExpansion.kt"); + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/overrides") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class Overrides extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInOverrides() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/overrides"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("generics.kt") + public void testGenerics() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/overrides/generics.kt"); + } + + @Test + @TestMetadata("protobufExt.kt") + public void testProtobufExt() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/overrides/protobufExt.kt"); + } + + @Test + @TestMetadata("simple.kt") + public void testSimple() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/overrides/simple.kt"); + } + + @Test + @TestMetadata("simpleFakeOverride.kt") + public void testSimpleFakeOverride() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/overrides/simpleFakeOverride.kt"); + } + + @Test + @TestMetadata("simpleMostSpecific.kt") + public void testSimpleMostSpecific() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/overrides/simpleMostSpecific.kt"); + } + + @Test + @TestMetadata("supertypeGenerics.kt") + public void testSupertypeGenerics() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/overrides/supertypeGenerics.kt"); + } + + @Test + @TestMetadata("supertypeGenericsComplex.kt") + public void testSupertypeGenericsComplex() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/overrides/supertypeGenericsComplex.kt"); + } + + @Test + @TestMetadata("three.kt") + public void testThree() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/overrides/three.kt"); + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/problems") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class Problems extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInProblems() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/problems"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("compilerPhase.kt") + public void testCompilerPhase() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/problems/compilerPhase.kt"); + } + + @Test + @TestMetadata("complexLambdaWithTypeVariableAsExpectedType.kt") + public void testComplexLambdaWithTypeVariableAsExpectedType() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/problems/complexLambdaWithTypeVariableAsExpectedType.kt"); + } + + @Test + @TestMetadata("defaultParametersFromDifferentScopes.kt") + public void testDefaultParametersFromDifferentScopes() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/problems/defaultParametersFromDifferentScopes.kt"); + } + + @Test + @TestMetadata("definitelyNotNullAndOriginalType.kt") + public void testDefinitelyNotNullAndOriginalType() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/problems/definitelyNotNullAndOriginalType.kt"); + } + + @Test + @TestMetadata("flexibleTypeVarAgainstNull.kt") + public void testFlexibleTypeVarAgainstNull() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/problems/flexibleTypeVarAgainstNull.kt"); + } + + @Test + @TestMetadata("inaccessibleJavaGetter.kt") + public void testInaccessibleJavaGetter() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/problems/inaccessibleJavaGetter.kt"); + } + + @Test + @TestMetadata("innerClassHierarchy.kt") + public void testInnerClassHierarchy() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/problems/innerClassHierarchy.kt"); + } + + @Test + @TestMetadata("javaQualifier.kt") + public void testJavaQualifier() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/problems/javaQualifier.kt"); + } + + @Test + @TestMetadata("kt42346.kt") + public void testKt42346() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/problems/kt42346.kt"); + } + + @Test + @TestMetadata("multipleJavaClassesInOneFile.kt") + public void testMultipleJavaClassesInOneFile() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/problems/multipleJavaClassesInOneFile.kt"); + } + + @Test + @TestMetadata("objectDerivedFromInnerClass.kt") + public void testObjectDerivedFromInnerClass() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/problems/objectDerivedFromInnerClass.kt"); + } + + @Test + @TestMetadata("questionableSmartCast.kt") + public void testQuestionableSmartCast() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/problems/questionableSmartCast.kt"); + } + + @Test + @TestMetadata("recursiveNamedAnnotation.kt") + public void testRecursiveNamedAnnotation() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/problems/recursiveNamedAnnotation.kt"); + } + + @Test + @TestMetadata("safeCallInvoke.kt") + public void testSafeCallInvoke() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/problems/safeCallInvoke.kt"); + } + + @Test + @TestMetadata("secondaryConstructorCfg.kt") + public void testSecondaryConstructorCfg() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/problems/secondaryConstructorCfg.kt"); + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/properties") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class Properties extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInProperties() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/properties"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("javaAccessorConversion.kt") + public void testJavaAccessorConversion() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/properties/javaAccessorConversion.kt"); + } + + @Test + @TestMetadata("javaAccessorsComplex.kt") + public void testJavaAccessorsComplex() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/properties/javaAccessorsComplex.kt"); + } + + @Test + @TestMetadata("kotlinOverridesJavaComplex.kt") + public void testKotlinOverridesJavaComplex() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/properties/kotlinOverridesJavaComplex.kt"); + } + + @Test + @TestMetadata("noBackingFieldForExtension.kt") + public void testNoBackingFieldForExtension() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/properties/noBackingFieldForExtension.kt"); + } + + @Test + @TestMetadata("noBackingFieldInProperty.kt") + public void testNoBackingFieldInProperty() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/properties/noBackingFieldInProperty.kt"); + } + + @Test + @TestMetadata("syntheticPropertiesForJavaAnnotations.kt") + public void testSyntheticPropertiesForJavaAnnotations() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/properties/syntheticPropertiesForJavaAnnotations.kt"); + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/references") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class References extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInReferences() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/references"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("integerLiteralInLhs.kt") + public void testIntegerLiteralInLhs() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/references/integerLiteralInLhs.kt"); + } + + @Test + @TestMetadata("referenceToExtension.kt") + public void testReferenceToExtension() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/references/referenceToExtension.kt"); + } + + @Test + @TestMetadata("simple.kt") + public void testSimple() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/references/simple.kt"); + } + + @Test + @TestMetadata("superMember.kt") + public void testSuperMember() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/references/superMember.kt"); + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/samConstructors") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class SamConstructors extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInSamConstructors() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/samConstructors"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("genericSam.kt") + public void testGenericSam() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/samConstructors/genericSam.kt"); + } + + @Test + @TestMetadata("genericSamInferenceFromExpectType.kt") + public void testGenericSamInferenceFromExpectType() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/samConstructors/genericSamInferenceFromExpectType.kt"); + } + + @Test + @TestMetadata("kotlinSam.kt") + public void testKotlinSam() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/samConstructors/kotlinSam.kt"); + } + + @Test + @TestMetadata("realConstructorFunction.kt") + public void testRealConstructorFunction() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/samConstructors/realConstructorFunction.kt"); + } + + @Test + @TestMetadata("runnable.kt") + public void testRunnable() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/samConstructors/runnable.kt"); + } + + @Test + @TestMetadata("simple.kt") + public void testSimple() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/samConstructors/simple.kt"); + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/samConversions") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class SamConversions extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInSamConversions() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/samConversions"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("genericSam.kt") + public void testGenericSam() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/samConversions/genericSam.kt"); + } + + @Test + @TestMetadata("kotlinSam.kt") + public void testKotlinSam() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/samConversions/kotlinSam.kt"); + } + + @Test + @TestMetadata("notSamBecauseOfSupertype.kt") + public void testNotSamBecauseOfSupertype() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/samConversions/notSamBecauseOfSupertype.kt"); + } + + @Test + @TestMetadata("runnable.kt") + public void testRunnable() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/samConversions/runnable.kt"); + } + + @Test + @TestMetadata("samConversionInConstructorCall.kt") + public void testSamConversionInConstructorCall() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/samConversions/samConversionInConstructorCall.kt"); + } + + @Test + @TestMetadata("samSupertype.kt") + public void testSamSupertype() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/samConversions/samSupertype.kt"); + } + + @Test + @TestMetadata("samSupertypeWithOverride.kt") + public void testSamSupertypeWithOverride() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/samConversions/samSupertypeWithOverride.kt"); + } + + @Test + @TestMetadata("samWithEquals.kt") + public void testSamWithEquals() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/samConversions/samWithEquals.kt"); + } + + @Test + @TestMetadata("simple.kt") + public void testSimple() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/samConversions/simple.kt"); + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/smartcasts") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class Smartcasts extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInSmartcasts() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/smartcasts"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("bangbang.kt") + public void testBangbang() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/bangbang.kt"); + } + + @Test + @TestMetadata("casts.kt") + public void testCasts() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/casts.kt"); + } + + @Test + @TestMetadata("equalsAndIdentity.kt") + public void testEqualsAndIdentity() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/equalsAndIdentity.kt"); + } + + @Test + @TestMetadata("kt10240.kt") + public void testKt10240() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/kt10240.kt"); + } + + @Test + @TestMetadata("kt37327.kt") + public void testKt37327() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/kt37327.kt"); + } + + @Test + @TestMetadata("kt39000.kt") + public void testKt39000() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/kt39000.kt"); + } + + @Test + @TestMetadata("multipleCasts.kt") + public void testMultipleCasts() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/multipleCasts.kt"); + } + + @Test + @TestMetadata("nullability.kt") + public void testNullability() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/nullability.kt"); + } + + @Test + @TestMetadata("orInWhenBranch.kt") + public void testOrInWhenBranch() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/orInWhenBranch.kt"); + } + + @Test + @TestMetadata("smartCastInInit.kt") + public void testSmartCastInInit() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/smartCastInInit.kt"); + } + + @Test + @TestMetadata("smartcastToNothing.kt") + public void testSmartcastToNothing() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastToNothing.kt"); + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class Booleans extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInBooleans() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("booleanOperators.kt") + public void testBooleanOperators() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/booleanOperators.kt"); + } + + @Test + @TestMetadata("equalsToBoolean.kt") + public void testEqualsToBoolean() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/equalsToBoolean.kt"); + } + + @Test + @TestMetadata("jumpFromRhsOfOperator.kt") + public void testJumpFromRhsOfOperator() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/jumpFromRhsOfOperator.kt"); + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class BoundSmartcasts extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInBoundSmartcasts() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("boundSmartcasts.kt") + public void testBoundSmartcasts() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcasts.kt"); + } + + @Test + @TestMetadata("boundSmartcastsInBranches.kt") + public void testBoundSmartcastsInBranches() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.kt"); + } + + @Test + @TestMetadata("functionCallBound.kt") + public void testFunctionCallBound() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/functionCallBound.kt"); + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class ControlStructures extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInControlStructures() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("elvis.kt") + public void testElvis() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/elvis.kt"); + } + + @Test + @TestMetadata("returns.kt") + public void testReturns() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/returns.kt"); + } + + @Test + @TestMetadata("simpleIf.kt") + public void testSimpleIf() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/simpleIf.kt"); + } + + @Test + @TestMetadata("smartcastFromArgument.kt") + public void testSmartcastFromArgument() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/smartcastFromArgument.kt"); + } + + @Test + @TestMetadata("when.kt") + public void testWhen() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/controlStructures/when.kt"); + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/smartcasts/lambdas") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class Lambdas extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInLambdas() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/smartcasts/lambdas"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("inPlaceLambdas.kt") + public void testInPlaceLambdas() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/lambdas/inPlaceLambdas.kt"); + } + + @Test + @TestMetadata("lambdaInWhenBranch.kt") + public void testLambdaInWhenBranch() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/lambdas/lambdaInWhenBranch.kt"); + } + + @Test + @TestMetadata("smartcastOnLambda.kt") + public void testSmartcastOnLambda() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/lambdas/smartcastOnLambda.kt"); + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/smartcasts/loops") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class Loops extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInLoops() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/smartcasts/loops"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("dataFlowInfoFromWhileCondition.kt") + public void testDataFlowInfoFromWhileCondition() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/loops/dataFlowInfoFromWhileCondition.kt"); + } + + @Test + @TestMetadata("endlessLoops.kt") + public void testEndlessLoops() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/loops/endlessLoops.kt"); + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/smartcasts/problems") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class Problems extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInProblems() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/smartcasts/problems"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("invoke.kt") + public void testInvoke() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/problems/invoke.kt"); + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class Receivers extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInReceivers() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("implicitReceiverAsWhenSubject.kt") + public void testImplicitReceiverAsWhenSubject() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/implicitReceiverAsWhenSubject.kt"); + } + + @Test + @TestMetadata("implicitReceivers.kt") + public void testImplicitReceivers() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/implicitReceivers.kt"); + } + + @Test + @TestMetadata("mixingImplicitAndExplicitReceivers.kt") + public void testMixingImplicitAndExplicitReceivers() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/mixingImplicitAndExplicitReceivers.kt"); + } + + @Test + @TestMetadata("thisOfExtensionProperty.kt") + public void testThisOfExtensionProperty() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/receivers/thisOfExtensionProperty.kt"); + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class SafeCalls extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInSafeCalls() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("assignSafeCall.kt") + public void testAssignSafeCall() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/assignSafeCall.kt"); + } + + @Test + @TestMetadata("boundSafeCallAndIsCheck.kt") + public void testBoundSafeCallAndIsCheck() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/boundSafeCallAndIsCheck.kt"); + } + + @Test + @TestMetadata("safeCallAndEqualityToBool.kt") + public void testSafeCallAndEqualityToBool() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCallAndEqualityToBool.kt"); + } + + @Test + @TestMetadata("safeCalls.kt") + public void testSafeCalls() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCalls.kt"); + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/smartcasts/stability") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class Stability extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInStability() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/smartcasts/stability"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("overridenOpenVal.kt") + public void testOverridenOpenVal() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/stability/overridenOpenVal.kt"); + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/smartcasts/variables") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class Variables extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInVariables() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/smartcasts/variables"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("delayedAssignment.kt") + public void testDelayedAssignment() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/delayedAssignment.kt"); + } + + @Test + @TestMetadata("smartcastAfterReassignment.kt") + public void testSmartcastAfterReassignment() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/smartcastAfterReassignment.kt"); + } + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/stdlib") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class Stdlib extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInStdlib() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/stdlib"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/stdlib/j+k") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class J_k extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInJ_k() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/stdlib/j+k"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("ArrayInGenericArguments.kt") + public void testArrayInGenericArguments() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/stdlib/j+k/ArrayInGenericArguments.kt"); + } + + @Test + @TestMetadata("flexibleWildcard.kt") + public void testFlexibleWildcard() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/stdlib/j+k/flexibleWildcard.kt"); + } + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/types") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class Types extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInTypes() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/types"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("bareWithSubjectTypeAlias.kt") + public void testBareWithSubjectTypeAlias() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/types/bareWithSubjectTypeAlias.kt"); + } + + @Test + @TestMetadata("capturedParametersOfInnerClasses.kt") + public void testCapturedParametersOfInnerClasses() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/types/capturedParametersOfInnerClasses.kt"); + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolve/visibility") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class Visibility extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInVisibility() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/visibility"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("exposedFunctionParameterType.kt") + public void testExposedFunctionParameterType() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/visibility/exposedFunctionParameterType.kt"); + } + + @Test + @TestMetadata("exposedFunctionReturnType.kt") + public void testExposedFunctionReturnType() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/visibility/exposedFunctionReturnType.kt"); + } + + @Test + @TestMetadata("exposedPropertyType.kt") + public void testExposedPropertyType() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/visibility/exposedPropertyType.kt"); + } + + @Test + @TestMetadata("exposedSupertype.kt") + public void testExposedSupertype() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/visibility/exposedSupertype.kt"); + } + + @Test + @TestMetadata("exposedTypeAlias.kt") + public void testExposedTypeAlias() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/visibility/exposedTypeAlias.kt"); + } + + @Test + @TestMetadata("exposedTypeParameters.kt") + public void testExposedTypeParameters() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/visibility/exposedTypeParameters.kt"); + } + + @Test + @TestMetadata("intersectionOverrideWithImplicitTypes.kt") + public void testIntersectionOverrideWithImplicitTypes() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/visibility/intersectionOverrideWithImplicitTypes.kt"); + } + + @Test + @TestMetadata("kotlinJavaKotlinHierarchy.kt") + public void testKotlinJavaKotlinHierarchy() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/visibility/kotlinJavaKotlinHierarchy.kt"); + } + + @Test + @TestMetadata("protectedInCompanion.kt") + public void testProtectedInCompanion() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/visibility/protectedInCompanion.kt"); + } + + @Test + @TestMetadata("singletonConstructors.kt") + public void testSingletonConstructors() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/visibility/singletonConstructors.kt"); + } + + @Test + @TestMetadata("visibilityWithOverrides.kt") + public void testVisibilityWithOverrides() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolve/visibility/visibilityWithOverrides.kt"); } } } @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/stdlib") + @TestMetadata("compiler/fir/analysis-tests/testData/resolveWithStdlib") @TestDataPath("$PROJECT_ROOT") @Execution(ExecutionMode.SAME_THREAD) - public class Stdlib extends AbstractFirDiagnosticsWithLightTreeTest { + public class ResolveWithStdlib extends AbstractFirDiagnosticsWithLightTreeTest { @Test - public void testAllFilesPresentInStdlib() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/stdlib"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + @TestMetadata("addAllOnJavaCollection.kt") + public void testAddAllOnJavaCollection() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/addAllOnJavaCollection.kt"); + } + + @Test + public void testAllFilesPresentInResolveWithStdlib() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolveWithStdlib"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("arrayFilterCapturedType.kt") + public void testArrayFilterCapturedType() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/arrayFilterCapturedType.kt"); + } + + @Test + @TestMetadata("arrayFirstOrNull.kt") + public void testArrayFirstOrNull() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/arrayFirstOrNull.kt"); + } + + @Test + @TestMetadata("arrayInLocal.kt") + public void testArrayInLocal() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/arrayInLocal.kt"); + } + + @Test + @TestMetadata("backingField.kt") + public void testBackingField() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/backingField.kt"); + } + + @Test + @TestMetadata("classLiteralForParameter.kt") + public void testClassLiteralForParameter() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/classLiteralForParameter.kt"); + } + + @Test + @TestMetadata("cloneArray.kt") + public void testCloneArray() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/cloneArray.kt"); + } + + @Test + @TestMetadata("companionLoad.kt") + public void testCompanionLoad() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/companionLoad.kt"); + } + + @Test + @TestMetadata("complexPostponedCfg.kt") + public void testComplexPostponedCfg() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/complexPostponedCfg.kt"); + } + + @Test + @TestMetadata("components.kt") + public void testComponents() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/components.kt"); + } + + @Test + @TestMetadata("concurrent.kt") + public void testConcurrent() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/concurrent.kt"); + } + + @Test + @TestMetadata("concurrentMapOfAliases.kt") + public void testConcurrentMapOfAliases() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/concurrentMapOfAliases.kt"); + } + + @Test + @TestMetadata("emptyArray.kt") + public void testEmptyArray() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/emptyArray.kt"); + } + + @Test + @TestMetadata("enumValuesDeserialized.kt") + public void testEnumValuesDeserialized() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/enumValuesDeserialized.kt"); + } + + @Test + @TestMetadata("exception.kt") + public void testException() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/exception.kt"); + } + + @Test + @TestMetadata("factoryFunctionOverloads.kt") + public void testFactoryFunctionOverloads() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/factoryFunctionOverloads.kt"); + } + + @Test + @TestMetadata("fillInStackTrace.kt") + public void testFillInStackTrace() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/fillInStackTrace.kt"); + } + + @Test + @TestMetadata("functionAndFunctionN.kt") + public void testFunctionAndFunctionN() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/functionAndFunctionN.kt"); + } + + @Test + @TestMetadata("functionX.kt") + public void testFunctionX() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/functionX.kt"); + } + + @Test + @TestMetadata("getOnKProperty.kt") + public void testGetOnKProperty() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/getOnKProperty.kt"); + } + + @Test + @TestMetadata("getOrPutAmbiguity.kt") + public void testGetOrPutAmbiguity() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/getOrPutAmbiguity.kt"); + } + + @Test + @TestMetadata("hashMapTypeAlias.kt") + public void testHashMapTypeAlias() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/hashMapTypeAlias.kt"); + } + + @Test + @TestMetadata("hashSet.kt") + public void testHashSet() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/hashSet.kt"); + } + + @Test + @TestMetadata("hashTableWithForEach.kt") + public void testHashTableWithForEach() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/hashTableWithForEach.kt"); + } + + @Test + @TestMetadata("helloWorld.kt") + public void testHelloWorld() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/helloWorld.kt"); + } + + @Test + @TestMetadata("implicitReceiverOrder.kt") + public void testImplicitReceiverOrder() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/implicitReceiverOrder.kt"); + } + + @Test + @TestMetadata("inapplicableRemoveAll.kt") + public void testInapplicableRemoveAll() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/inapplicableRemoveAll.kt"); + } + + @Test + @TestMetadata("javaEnumSynthetic.kt") + public void testJavaEnumSynthetic() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/javaEnumSynthetic.kt"); + } + + @Test + @TestMetadata("javaLangComparator.kt") + public void testJavaLangComparator() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/javaLangComparator.kt"); + } + + @Test + @TestMetadata("kotlinComparatorAlias.kt") + public void testKotlinComparatorAlias() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/kotlinComparatorAlias.kt"); + } + + @Test + @TestMetadata("listPlusAssign.kt") + public void testListPlusAssign() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/listPlusAssign.kt"); + } + + @Test + @TestMetadata("lowPriorityInResolution.kt") + public void testLowPriorityInResolution() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/lowPriorityInResolution.kt"); + } + + @Test + @TestMetadata("mapList.kt") + public void testMapList() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/mapList.kt"); + } + + @Test + @TestMetadata("multipleImplicitReceivers.kt") + public void testMultipleImplicitReceivers() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/multipleImplicitReceivers.kt"); + } + + @Test + @TestMetadata("noneWithForEach.kt") + public void testNoneWithForEach() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/noneWithForEach.kt"); + } + + @Test + @TestMetadata("nullableTypeParameter.kt") + public void testNullableTypeParameter() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/nullableTypeParameter.kt"); + } + + @Test + @TestMetadata("plusAssignNullable.kt") + public void testPlusAssignNullable() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/plusAssignNullable.kt"); + } + + @Test + @TestMetadata("problems.kt") + public void testProblems() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/problems.kt"); + } + + @Test + @TestMetadata("rangeTo.kt") + public void testRangeTo() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/rangeTo.kt"); + } + + @Test + @TestMetadata("recursiveBug.kt") + public void testRecursiveBug() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/recursiveBug.kt"); + } + + @Test + @TestMetadata("reflectionClass.kt") + public void testReflectionClass() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/reflectionClass.kt"); + } + + @Test + @TestMetadata("removeIf.kt") + public void testRemoveIf() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/removeIf.kt"); + } + + @Test + @TestMetadata("removeOnAbstractMap.kt") + public void testRemoveOnAbstractMap() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/removeOnAbstractMap.kt"); + } + + @Test + @TestMetadata("runOnIntegerLiteral.kt") + public void testRunOnIntegerLiteral() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/runOnIntegerLiteral.kt"); + } + + @Test + @TestMetadata("samForComparator.kt") + public void testSamForComparator() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/samForComparator.kt"); + } + + @Test + @TestMetadata("simpleLazy.kt") + public void testSimpleLazy() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/simpleLazy.kt"); + } + + @Test + @TestMetadata("stringConstructors.kt") + public void testStringConstructors() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/stringConstructors.kt"); + } + + @Test + @TestMetadata("toSortedMapWithComparator.kt") + public void testToSortedMapWithComparator() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/toSortedMapWithComparator.kt"); + } + + @Test + @TestMetadata("topLevelResolve.kt") + public void testTopLevelResolve() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/topLevelResolve.kt"); + } + + @Test + @TestMetadata("typeAliasDeserialization.kt") + public void testTypeAliasDeserialization() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/typeAliasDeserialization.kt"); + } + + @Test + @TestMetadata("typeAliasWithForEach.kt") + public void testTypeAliasWithForEach() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/typeAliasWithForEach.kt"); + } + + @Test + @TestMetadata("typeParameterDerived.kt") + public void testTypeParameterDerived() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/typeParameterDerived.kt"); + } + + @Test + @TestMetadata("unaryOperators.kt") + public void testUnaryOperators() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/unaryOperators.kt"); + } + + @Test + @TestMetadata("whenAsLambdaReturnStatement.kt") + public void testWhenAsLambdaReturnStatement() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/whenAsLambdaReturnStatement.kt"); + } + + @Test + @TestMetadata("withInInitializer.kt") + public void testWithInInitializer() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/withInInitializer.kt"); } @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/stdlib/j+k") + @TestMetadata("compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class CallableReferences extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInCallableReferences() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("beyoundCalls.kt") + public void testBeyoundCalls() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/beyoundCalls.kt"); + } + + @Test + @TestMetadata("coercionToUnit.kt") + public void testCoercionToUnit() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/coercionToUnit.kt"); + } + + @Test + @TestMetadata("companions.kt") + public void testCompanions() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/companions.kt"); + } + + @Test + @TestMetadata("constructors.kt") + public void testConstructors() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/constructors.kt"); + } + + @Test + @TestMetadata("differentLevels.kt") + public void testDifferentLevels() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/differentLevels.kt"); + } + + @Test + @TestMetadata("extensionReceiverInference.kt") + public void testExtensionReceiverInference() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/extensionReceiverInference.kt"); + } + + @Test + @TestMetadata("genericInReceiver.kt") + public void testGenericInReceiver() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/genericInReceiver.kt"); + } + + @Test + @TestMetadata("ifWithCR.kt") + public void testIfWithCR() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/ifWithCR.kt"); + } + + @Test + @TestMetadata("implicitTypes.kt") + public void testImplicitTypes() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/implicitTypes.kt"); + } + + @Test + @TestMetadata("inferenceFromCallableReferenceType.kt") + public void testInferenceFromCallableReferenceType() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/inferenceFromCallableReferenceType.kt"); + } + + @Test + @TestMetadata("inferenceFromExpectedType.kt") + public void testInferenceFromExpectedType() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/inferenceFromExpectedType.kt"); + } + + @Test + @TestMetadata("javaStatic.kt") + public void testJavaStatic() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/javaStatic.kt"); + } + + @Test + @TestMetadata("manyCandidatesInference.kt") + public void testManyCandidatesInference() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/manyCandidatesInference.kt"); + } + + @Test + @TestMetadata("manyInnerCandidates.kt") + public void testManyInnerCandidates() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/manyInnerCandidates.kt"); + } + + @Test + @TestMetadata("manyInnerManyOuterCandidates.kt") + public void testManyInnerManyOuterCandidates() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/manyInnerManyOuterCandidates.kt"); + } + + @Test + @TestMetadata("manyInnermanyOuterCandidatesAmbiguity.kt") + public void testManyInnermanyOuterCandidatesAmbiguity() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/manyInnermanyOuterCandidatesAmbiguity.kt"); + } + + @Test + @TestMetadata("manyOuterCandidates.kt") + public void testManyOuterCandidates() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/manyOuterCandidates.kt"); + } + + @Test + @TestMetadata("properties.kt") + public void testProperties() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/properties.kt"); + } + + @Test + @TestMetadata("sam.kt") + public void testSam() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/sam.kt"); + } + + @Test + @TestMetadata("simpleClassReceiver.kt") + public void testSimpleClassReceiver() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/simpleClassReceiver.kt"); + } + + @Test + @TestMetadata("simpleExpressionReceiver.kt") + public void testSimpleExpressionReceiver() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/simpleExpressionReceiver.kt"); + } + + @Test + @TestMetadata("simpleNoReceiver.kt") + public void testSimpleNoReceiver() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/simpleNoReceiver.kt"); + } + + @Test + @TestMetadata("varProperties.kt") + public void testVarProperties() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/varProperties.kt"); + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class FromBasicDiagnosticTests extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInFromBasicDiagnosticTests() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("ambiguityWhenNoApplicableCallableReferenceCandidate.kt") + public void testAmbiguityWhenNoApplicableCallableReferenceCandidate() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/ambiguityWhenNoApplicableCallableReferenceCandidate.kt"); + } + + @Test + @TestMetadata("applicableCallableReferenceFromDistantScope.kt") + public void testApplicableCallableReferenceFromDistantScope() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/applicableCallableReferenceFromDistantScope.kt"); + } + + @Test + @TestMetadata("chooseCallableReferenceDependingOnInferredReceiver.kt") + public void testChooseCallableReferenceDependingOnInferredReceiver() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/chooseCallableReferenceDependingOnInferredReceiver.kt"); + } + + @Test + @TestMetadata("commonSupertypeFromReturnTypesOfCallableReference.kt") + public void testCommonSupertypeFromReturnTypesOfCallableReference() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/commonSupertypeFromReturnTypesOfCallableReference.kt"); + } + + @Test + @TestMetadata("eagerAndPostponedCallableReferences.kt") + public void testEagerAndPostponedCallableReferences() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/eagerAndPostponedCallableReferences.kt"); + } + + @Test + @TestMetadata("eagerResolveOfSingleCallableReference.kt") + public void testEagerResolveOfSingleCallableReference() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/eagerResolveOfSingleCallableReference.kt"); + } + + @Test + @TestMetadata("moreSpecificAmbiguousExtensions.kt") + public void testMoreSpecificAmbiguousExtensions() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/moreSpecificAmbiguousExtensions.kt"); + } + + @Test + @TestMetadata("multipleOutersAndMultipleCallableReferences.kt") + public void testMultipleOutersAndMultipleCallableReferences() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/multipleOutersAndMultipleCallableReferences.kt"); + } + + @Test + @TestMetadata("noAmbiguityBetweenTopLevelAndMemberProperty.kt") + public void testNoAmbiguityBetweenTopLevelAndMemberProperty() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/noAmbiguityBetweenTopLevelAndMemberProperty.kt"); + } + + @Test + @TestMetadata("overloadsBound.kt") + public void testOverloadsBound() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/overloadsBound.kt"); + } + + @Test + @TestMetadata("postponedResolveOfManyCallableReference.kt") + public void testPostponedResolveOfManyCallableReference() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/postponedResolveOfManyCallableReference.kt"); + } + + @Test + @TestMetadata("resolveCallableReferencesAfterAllSimpleArguments.kt") + public void testResolveCallableReferencesAfterAllSimpleArguments() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/resolveCallableReferencesAfterAllSimpleArguments.kt"); + } + + @Test + @TestMetadata("withGenericFun.kt") + public void testWithGenericFun() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/withGenericFun.kt"); + } + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class Contracts extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInContracts() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromLibrary") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class FromLibrary extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInFromLibrary() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromLibrary"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("callsInPlace.kt") + public void testCallsInPlace() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromLibrary/callsInPlace.kt"); + } + + @Test + @TestMetadata("conditionalEffects.kt") + public void testConditionalEffects() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromLibrary/conditionalEffects.kt"); + } + + @Test + @TestMetadata("notIsNullOrEmpty.kt") + public void testNotIsNullOrEmpty() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromLibrary/notIsNullOrEmpty.kt"); + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class FromSource extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInFromSource() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/bad") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class Bad extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInBad() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/bad"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/bad/callsInPlace") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class CallsInPlace extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInCallsInPlace() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/bad/callsInPlace"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("inAnonymousObject.kt") + public void testInAnonymousObject() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/bad/callsInPlace/inAnonymousObject.kt"); + } + + @Test + @TestMetadata("inLocalClass.kt") + public void testInLocalClass() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/bad/callsInPlace/inLocalClass.kt"); + } + + @Test + @TestMetadata("inLocalFunction.kt") + public void testInLocalFunction() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/bad/callsInPlace/inLocalFunction.kt"); + } + + @Test + @TestMetadata("toLocalVariables.kt") + public void testToLocalVariables() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/bad/callsInPlace/toLocalVariables.kt"); + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/bad/returnsImplies") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class ReturnsImplies extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInReturnsImplies() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/bad/returnsImplies"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("notNull.kt") + public void testNotNull() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/bad/returnsImplies/notNull.kt"); + } + + @Test + @TestMetadata("propertyGetter.kt") + public void testPropertyGetter() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/bad/returnsImplies/propertyGetter.kt"); + } + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class Good extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInGood() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class CallsInPlace extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInCallsInPlace() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("atLeastOnce.kt") + public void testAtLeastOnce() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/atLeastOnce.kt"); + } + + @Test + @TestMetadata("atMostOnce.kt") + public void testAtMostOnce() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/atMostOnce.kt"); + } + + @Test + @TestMetadata("contractsUsage.kt") + public void testContractsUsage() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/contractsUsage.kt"); + } + + @Test + @TestMetadata("exactlyOnce.kt") + public void testExactlyOnce() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/exactlyOnce.kt"); + } + + @Test + @TestMetadata("flow.kt") + public void testFlow() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/flow.kt"); + } + + @Test + @TestMetadata("inPlaceLambda.kt") + public void testInPlaceLambda() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/inPlaceLambda.kt"); + } + + @Test + @TestMetadata("simple.kt") + public void testSimple() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/simple.kt"); + } + + @Test + @TestMetadata("unknown.kt") + public void testUnknown() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/callsInPlace/unknown.kt"); + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class ReturnsImplies extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInReturnsImplies() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("booleanOperators.kt") + public void testBooleanOperators() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/booleanOperators.kt"); + } + + @Test + @TestMetadata("conditionLogic.kt") + public void testConditionLogic() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/conditionLogic.kt"); + } + + @Test + @TestMetadata("eqNotEq.kt") + public void testEqNotEq() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/eqNotEq.kt"); + } + + @Test + @TestMetadata("inapplicable.kt") + public void testInapplicable() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/inapplicable.kt"); + } + + @Test + @TestMetadata("namedArguments.kt") + public void testNamedArguments() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/namedArguments.kt"); + } + + @Test + @TestMetadata("notNull.kt") + public void testNotNull() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/notNull.kt"); + } + + @Test + @TestMetadata("propertyAccessors.kt") + public void testPropertyAccessors() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/propertyAccessors.kt"); + } + + @Test + @TestMetadata("receivers.kt") + public void testReceivers() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/receivers.kt"); + } + + @Test + @TestMetadata("safeCall.kt") + public void testSafeCall() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/safeCall.kt"); + } + + @Test + @TestMetadata("trickyCases.kt") + public void testTrickyCases() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/trickyCases.kt"); + } + + @Test + @TestMetadata("typePredicate.kt") + public void testTypePredicate() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/typePredicate.kt"); + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/variousContracts") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class VariousContracts extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInVariousContracts() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/variousContracts"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/variousContracts/newSyntax") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class NewSyntax extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInNewSyntax() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/variousContracts/newSyntax"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("functionsWithContract.kt") + public void testFunctionsWithContract() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/variousContracts/newSyntax/functionsWithContract.kt"); + } + } + } + } + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class Delegates extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInDelegates() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("anonymousInDelegate.kt") + public void testAnonymousInDelegate() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/anonymousInDelegate.kt"); + } + + @Test + @TestMetadata("delegateTypeMismatch.kt") + public void testDelegateTypeMismatch() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateTypeMismatch.kt"); + } + + @Test + @TestMetadata("delegateWithAnonymousObject.kt") + public void testDelegateWithAnonymousObject() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/delegateWithAnonymousObject.kt"); + } + + @Test + @TestMetadata("propertyWithFunctionalType.kt") + public void testPropertyWithFunctionalType() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/propertyWithFunctionalType.kt"); + } + + @Test + @TestMetadata("simpleDelegateProvider.kt") + public void testSimpleDelegateProvider() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/simpleDelegateProvider.kt"); + } + + @Test + @TestMetadata("simpleDelegatedToMap.kt") + public void testSimpleDelegatedToMap() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/delegates/simpleDelegatedToMap.kt"); + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolveWithStdlib/inference") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class Inference extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInInference() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolveWithStdlib/inference"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("builderInference.kt") + public void testBuilderInference() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/inference/builderInference.kt"); + } + + @Test + @TestMetadata("builderInferenceAndCoercionToUnit.kt") + public void testBuilderInferenceAndCoercionToUnit() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/inference/builderInferenceAndCoercionToUnit.kt"); + } + + @Test + @TestMetadata("builderInferenceFromStdlib.kt") + public void testBuilderInferenceFromStdlib() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/inference/builderInferenceFromStdlib.kt"); + } + + @Test + @TestMetadata("complexConstraintSystem.kt") + public void testComplexConstraintSystem() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/inference/complexConstraintSystem.kt"); + } + + @Test + @TestMetadata("flexibleTypeInSystem.kt") + public void testFlexibleTypeInSystem() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/inference/flexibleTypeInSystem.kt"); + } + + @Test + @TestMetadata("ifElvisReturn.kt") + public void testIfElvisReturn() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/inference/ifElvisReturn.kt"); + } + + @Test + @TestMetadata("plusAssignWithLambdaInRhs.kt") + public void testPlusAssignWithLambdaInRhs() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/inference/plusAssignWithLambdaInRhs.kt"); + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolveWithStdlib/initialization") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class Initialization extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInInitialization() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolveWithStdlib/initialization"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("fromLocalMembers.kt") + public void testFromLocalMembers() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/initialization/fromLocalMembers.kt"); + } + } + + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k") @TestDataPath("$PROJECT_ROOT") @Execution(ExecutionMode.SAME_THREAD) public class J_k extends AbstractFirDiagnosticsWithLightTreeTest { @Test public void testAllFilesPresentInJ_k() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/stdlib/j+k"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k"), Pattern.compile("^([^.]+)\\.kt$"), null, true); } @Test - @TestMetadata("ArrayInGenericArguments.kt") - public void testArrayInGenericArguments() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/stdlib/j+k/ArrayInGenericArguments.kt"); + @TestMetadata("BasicWithAnnotatedJava.kt") + public void testBasicWithAnnotatedJava() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/BasicWithAnnotatedJava.kt"); } @Test - @TestMetadata("flexibleWildcard.kt") - public void testFlexibleWildcard() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/stdlib/j+k/flexibleWildcard.kt"); + @TestMetadata("BasicWithAnnotatedOverriddenJava.kt") + public void testBasicWithAnnotatedOverriddenJava() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/BasicWithAnnotatedOverriddenJava.kt"); + } + + @Test + @TestMetadata("BasicWithJava.kt") + public void testBasicWithJava() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/BasicWithJava.kt"); + } + + @Test + @TestMetadata("BasicWithJavaFakeOverride.kt") + public void testBasicWithJavaFakeOverride() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/BasicWithJavaFakeOverride.kt"); + } + + @Test + @TestMetadata("BasicWithPrimitiveJava.kt") + public void testBasicWithPrimitiveJava() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/BasicWithPrimitiveJava.kt"); + } + + @Test + @TestMetadata("capturedFlexible.kt") + public void testCapturedFlexible() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/capturedFlexible.kt"); + } + + @Test + @TestMetadata("complexFlexibleInference.kt") + public void testComplexFlexibleInference() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/complexFlexibleInference.kt"); + } + + @Test + @TestMetadata("FieldAccessFromDerived.kt") + public void testFieldAccessFromDerived() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/FieldAccessFromDerived.kt"); + } + + @Test + @TestMetadata("FieldAndGetter.kt") + public void testFieldAndGetter() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/FieldAndGetter.kt"); + } + + @Test + @TestMetadata("fieldOverride.kt") + public void testFieldOverride() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/fieldOverride.kt"); + } + + @Test + @TestMetadata("FieldSubstitution.kt") + public void testFieldSubstitution() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/FieldSubstitution.kt"); + } + + @Test + @TestMetadata("FlexiblePrimitiveOverloading.kt") + public void testFlexiblePrimitiveOverloading() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/FlexiblePrimitiveOverloading.kt"); + } + + @Test + @TestMetadata("flexibleTypeAliases.kt") + public void testFlexibleTypeAliases() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/flexibleTypeAliases.kt"); + } + + @Test + @TestMetadata("FunctionTypeInJava.kt") + public void testFunctionTypeInJava() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/FunctionTypeInJava.kt"); + } + + @Test + @TestMetadata("IntersectionTypesProblem.kt") + public void testIntersectionTypesProblem() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/IntersectionTypesProblem.kt"); + } + + @Test + @TestMetadata("JavaGetPrefixConflict.kt") + public void testJavaGetPrefixConflict() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/JavaGetPrefixConflict.kt"); + } + + @Test + @TestMetadata("JavaInheritsKotlinDerived.kt") + public void testJavaInheritsKotlinDerived() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/JavaInheritsKotlinDerived.kt"); + } + + @Test + @TestMetadata("JavaInheritsKotlinExtension.kt") + public void testJavaInheritsKotlinExtension() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/JavaInheritsKotlinExtension.kt"); + } + + @Test + @TestMetadata("JavaInheritsKotlinProperty.kt") + public void testJavaInheritsKotlinProperty() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/JavaInheritsKotlinProperty.kt"); + } + + @Test + @TestMetadata("JavaInheritsRawKotlin.kt") + public void testJavaInheritsRawKotlin() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/JavaInheritsRawKotlin.kt"); + } + + @Test + @TestMetadata("JavaSyntheticProperty.kt") + public void testJavaSyntheticProperty() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/JavaSyntheticProperty.kt"); + } + + @Test + @TestMetadata("JavaVisibility2.kt") + public void testJavaVisibility2() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/JavaVisibility2.kt"); + } + + @Test + @TestMetadata("KJKComplexHierarchy.kt") + public void testKJKComplexHierarchy() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/KJKComplexHierarchy.kt"); + } + + @Test + @TestMetadata("KJKComplexHierarchyWithNested.kt") + public void testKJKComplexHierarchyWithNested() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/KJKComplexHierarchyWithNested.kt"); + } + + @Test + @TestMetadata("KJKInheritance.kt") + public void testKJKInheritance() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/KJKInheritance.kt"); + } + + @Test + @TestMetadata("KJKInheritanceGeneric.kt") + public void testKJKInheritanceGeneric() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/KJKInheritanceGeneric.kt"); + } + + @Test + @TestMetadata("KotlinClassParameter.kt") + public void testKotlinClassParameter() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/KotlinClassParameter.kt"); + } + + @Test + @TestMetadata("KotlinClassParameterGeneric.kt") + public void testKotlinClassParameterGeneric() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/KotlinClassParameterGeneric.kt"); + } + + @Test + @TestMetadata("kt39076.kt") + public void testKt39076() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/kt39076.kt"); + } + + @Test + @TestMetadata("LoggerInstance.kt") + public void testLoggerInstance() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/LoggerInstance.kt"); + } + + @Test + @TestMetadata("MapCompute.kt") + public void testMapCompute() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/MapCompute.kt"); + } + + @Test + @TestMetadata("MapEntry.kt") + public void testMapEntry() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/MapEntry.kt"); + } + + @Test + @TestMetadata("mapMerge.kt") + public void testMapMerge() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/mapMerge.kt"); + } + + @Test + @TestMetadata("MyException.kt") + public void testMyException() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/MyException.kt"); + } + + @Test + @TestMetadata("MyIterable.kt") + public void testMyIterable() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/MyIterable.kt"); + } + + @Test + @TestMetadata("MyMap.kt") + public void testMyMap() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/MyMap.kt"); + } + + @Test + @TestMetadata("outerInnerClasses.kt") + public void testOuterInnerClasses() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/outerInnerClasses.kt"); + } + + @Test + @TestMetadata("OverrideWithJava.kt") + public void testOverrideWithJava() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/OverrideWithJava.kt"); + } + + @Test + @TestMetadata("RawType.kt") + public void testRawType() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/RawType.kt"); + } + + @Test + @TestMetadata("serializableString.kt") + public void testSerializableString() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/serializableString.kt"); + } + + @Test + @TestMetadata("smartSet.kt") + public void testSmartSet() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/smartSet.kt"); + } + + @Test + @TestMetadata("StaticClassConstructorFromBaseClass.kt") + public void testStaticClassConstructorFromBaseClass() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/StaticClassConstructorFromBaseClass.kt"); + } + + @Test + @TestMetadata("StaticFromBaseClass.kt") + public void testStaticFromBaseClass() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/StaticFromBaseClass.kt"); + } + + @Test + @TestMetadata("StaticGenericMethod.kt") + public void testStaticGenericMethod() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/StaticGenericMethod.kt"); + } + + @Test + @TestMetadata("SyntheticAfterFiltering.kt") + public void testSyntheticAfterFiltering() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/SyntheticAfterFiltering.kt"); + } + + @Test + @TestMetadata("SyntheticWithForEach.kt") + public void testSyntheticWithForEach() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/SyntheticWithForEach.kt"); + } + + @Test + @TestMetadata("typeParameterUse.kt") + public void testTypeParameterUse() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/typeParameterUse.kt"); } } - } - @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/types") - @TestDataPath("$PROJECT_ROOT") - @Execution(ExecutionMode.SAME_THREAD) - public class Types extends AbstractFirDiagnosticsWithLightTreeTest { - @Test - public void testAllFilesPresentInTypes() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/types"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolveWithStdlib/multiModule") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class MultiModule extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInMultiModule() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolveWithStdlib/multiModule"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("Basic.kt") + public void testBasic() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/multiModule/Basic.kt"); + } + + @Test + @TestMetadata("FakeOverrides.kt") + public void testFakeOverrides() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/multiModule/FakeOverrides.kt"); + } + + @Test + @TestMetadata("MemberType.kt") + public void testMemberType() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/multiModule/MemberType.kt"); + } + + @Test + @TestMetadata("Members.kt") + public void testMembers() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/multiModule/Members.kt"); + } + + @Test + @TestMetadata("SuperTypes.kt") + public void testSuperTypes() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/multiModule/SuperTypes.kt"); + } } - @Test - @TestMetadata("bareWithSubjectTypeAlias.kt") - public void testBareWithSubjectTypeAlias() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/types/bareWithSubjectTypeAlias.kt"); + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolveWithStdlib/problems") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class Problems extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInProblems() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolveWithStdlib/problems"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("DeepCopyIrTree.kt") + public void testDeepCopyIrTree() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/DeepCopyIrTree.kt"); + } + + @Test + @TestMetadata("EnumMapGet.kt") + public void testEnumMapGet() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/EnumMapGet.kt"); + } + + @Test + @TestMetadata("invokePriority.kt") + public void testInvokePriority() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/invokePriority.kt"); + } + + @Test + @TestMetadata("invokePriorityComplex.kt") + public void testInvokePriorityComplex() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/invokePriorityComplex.kt"); + } + + @Test + @TestMetadata("KJKComplexHierarchyNestedLoop.kt") + public void testKJKComplexHierarchyNestedLoop() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/KJKComplexHierarchyNestedLoop.kt"); + } + + @Test + @TestMetadata("qualifierPriority.kt") + public void testQualifierPriority() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/qualifierPriority.kt"); + } + + @Test + @TestMetadata("receiverResolutionInLambda.kt") + public void testReceiverResolutionInLambda() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/receiverResolutionInLambda.kt"); + } + + @Test + @TestMetadata("selfReferenceToCompanionObject.kt") + public void testSelfReferenceToCompanionObject() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/selfReferenceToCompanionObject.kt"); + } + + @Test + @TestMetadata("SpecialCallsWithLambdas.kt") + public void testSpecialCallsWithLambdas() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/SpecialCallsWithLambdas.kt"); + } + + @Test + @TestMetadata("TypesEligibleForSimpleVisit.kt") + public void testTypesEligibleForSimpleVisit() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/TypesEligibleForSimpleVisit.kt"); + } + + @Test + @TestMetadata("weakHashMap.kt") + public void testWeakHashMap() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/weakHashMap.kt"); + } } - @Test - @TestMetadata("capturedParametersOfInnerClasses.kt") - public void testCapturedParametersOfInnerClasses() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/types/capturedParametersOfInnerClasses.kt"); - } - } + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolveWithStdlib/reinitializations") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class Reinitializations extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInReinitializations() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolveWithStdlib/reinitializations"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } - @Nested - @TestMetadata("compiler/fir/analysis-tests/testData/resolve/visibility") - @TestDataPath("$PROJECT_ROOT") - @Execution(ExecutionMode.SAME_THREAD) - public class Visibility extends AbstractFirDiagnosticsWithLightTreeTest { - @Test - public void testAllFilesPresentInVisibility() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/visibility"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + @Test + @TestMetadata("constructorVarWrite.kt") + public void testConstructorVarWrite() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/reinitializations/constructorVarWrite.kt"); + } } - @Test - @TestMetadata("exposedFunctionParameterType.kt") - public void testExposedFunctionParameterType() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/visibility/exposedFunctionParameterType.kt"); - } + @Nested + @TestMetadata("compiler/fir/analysis-tests/testData/resolveWithStdlib/smartcasts") + @TestDataPath("$PROJECT_ROOT") + @Execution(ExecutionMode.SAME_THREAD) + public class Smartcasts extends AbstractFirDiagnosticsWithLightTreeTest { + @Test + public void testAllFilesPresentInSmartcasts() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolveWithStdlib/smartcasts"), Pattern.compile("^([^.]+)\\.kt$"), null, true); + } - @Test - @TestMetadata("exposedFunctionReturnType.kt") - public void testExposedFunctionReturnType() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/visibility/exposedFunctionReturnType.kt"); - } - - @Test - @TestMetadata("exposedPropertyType.kt") - public void testExposedPropertyType() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/visibility/exposedPropertyType.kt"); - } - - @Test - @TestMetadata("exposedSupertype.kt") - public void testExposedSupertype() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/visibility/exposedSupertype.kt"); - } - - @Test - @TestMetadata("exposedTypeAlias.kt") - public void testExposedTypeAlias() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/visibility/exposedTypeAlias.kt"); - } - - @Test - @TestMetadata("exposedTypeParameters.kt") - public void testExposedTypeParameters() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/visibility/exposedTypeParameters.kt"); - } - - @Test - @TestMetadata("intersectionOverrideWithImplicitTypes.kt") - public void testIntersectionOverrideWithImplicitTypes() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/visibility/intersectionOverrideWithImplicitTypes.kt"); - } - - @Test - @TestMetadata("kotlinJavaKotlinHierarchy.kt") - public void testKotlinJavaKotlinHierarchy() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/visibility/kotlinJavaKotlinHierarchy.kt"); - } - - @Test - @TestMetadata("protectedInCompanion.kt") - public void testProtectedInCompanion() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/visibility/protectedInCompanion.kt"); - } - - @Test - @TestMetadata("singletonConstructors.kt") - public void testSingletonConstructors() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/visibility/singletonConstructors.kt"); - } - - @Test - @TestMetadata("visibilityWithOverrides.kt") - public void testVisibilityWithOverrides() throws Exception { - runTest("compiler/fir/analysis-tests/testData/resolve/visibility/visibilityWithOverrides.kt"); + @Test + @TestMetadata("tryWithLambdaInside.kt") + public void testTryWithLambdaInside() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/smartcasts/tryWithLambdaInside.kt"); + } } } } diff --git a/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit5CompilerTests.kt b/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit5CompilerTests.kt index c2d4c24b273..cd795baedc4 100644 --- a/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit5CompilerTests.kt +++ b/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit5CompilerTests.kt @@ -104,6 +104,7 @@ fun generateJUnit5CompilerTests(args: Array) { annotations = listOf(annotation(Execution::class.java, ExecutionMode.SAME_THREAD)) ) { model("resolve", pattern = TestGeneratorUtil.KT_WITHOUT_DOTS_IN_NAME) + model("resolveWithStdlib", pattern = TestGeneratorUtil.KT_WITHOUT_DOTS_IN_NAME) } } From 6747084fe23ea6c9308b09711fcdb0d4e61ffd42 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Fri, 29 Jan 2021 14:59:43 +0300 Subject: [PATCH 187/212] FIR TEST: perform more accurate check on file identity --- .../classic/handlers/FirTestDataConsistencyHandler.kt | 8 ++++++-- .../test/frontend/fir/handlers/FirIdenticalChecker.kt | 2 +- .../kotlin/test/utils/FirIdenticalCheckerHelper.kt | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/classic/handlers/FirTestDataConsistencyHandler.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/classic/handlers/FirTestDataConsistencyHandler.kt index 7c85ad66ac0..61d7c74e6ff 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/classic/handlers/FirTestDataConsistencyHandler.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/classic/handlers/FirTestDataConsistencyHandler.kt @@ -31,8 +31,12 @@ class FirTestDataConsistencyHandler(testServices: TestServices) : AfterAnalysisC runFirTestAndGeneratedTestData(testData, firTestData) return } - val originalFileContent = clearTextFromDiagnosticMarkup(testData.readText()) - val firFileContent = clearTextFromDiagnosticMarkup(firTestData.readText()) + var originalFileContent = clearTextFromDiagnosticMarkup(testData.readText()).trim() + var firFileContent = clearTextFromDiagnosticMarkup(firTestData.readText()).trim() + if (System.lineSeparator() != "\n") { + originalFileContent = originalFileContent.replace("\r\n", "\n") + firFileContent = firFileContent.replace("\r\n", "\n") + } testServices.assertions.assertEquals(originalFileContent, firFileContent) { "Original and fir test data aren't identical. " + "Please, add changes from ${testData.name} to ${firTestData.name}" diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/handlers/FirIdenticalChecker.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/handlers/FirIdenticalChecker.kt index b0cc9954135..161cdee9af6 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/handlers/FirIdenticalChecker.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/handlers/FirIdenticalChecker.kt @@ -31,7 +31,7 @@ class FirIdenticalChecker(testServices: TestServices) : AfterAnalysisChecker(tes if (testDataFile.isFirTestData) { val firFile = helper.getFirFileToCompare(testDataFile) val classicFile = helper.getClassicFileToCompare(testDataFile) - if (helper.contentsAreEquals(classicFile, firFile)) { + if (helper.contentsAreEquals(classicFile, firFile, trimLines = true)) { helper.deleteFirFile(testDataFile) helper.addDirectiveToClassicFileAndAssert(classicFile) } diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/utils/FirIdenticalCheckerHelper.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/utils/FirIdenticalCheckerHelper.kt index 6f5e5cb8a5d..7767aa1390b 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/utils/FirIdenticalCheckerHelper.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/utils/FirIdenticalCheckerHelper.kt @@ -28,7 +28,7 @@ abstract class FirIdenticalCheckerHelper(private val testServices: TestServices) private fun File.readContent(trimLines: Boolean): String { return if (trimLines) { - this.readLines().map { it.trimEnd() }.joinToString("\n").trimEnd() + this.readLines().joinToString("\n") { it.trimEnd() }.trimEnd() } else { this.readText() } From 482e217b5e96fbb7422f96e02202eb0ff35c6999 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steven=20Sch=C3=A4fer?= Date: Thu, 28 Jan 2021 14:20:21 +0100 Subject: [PATCH 188/212] JVM IR: Fix inline class mangling for calls to internal functions ...in a different module, e.g., using -Xfriend-paths. --- ...rCompileKotlinAgainstKotlinTestGenerated.java | 5 +++++ .../backend/jvm/codegen/MethodSignatureMapper.kt | 5 ++++- .../kotlin/backend/jvm/codegen/irCodegenUtils.kt | 5 +++-- .../internalWithInlineClass.kt | 16 ++++++++++++++++ .../CompileKotlinAgainstKotlinTestGenerated.java | 5 +++++ ...rCompileKotlinAgainstKotlinTestGenerated.java | 5 +++++ .../ir/JvmIrAgainstOldBoxTestGenerated.java | 5 +++++ .../ir/JvmOldAgainstIrBoxTestGenerated.java | 5 +++++ 8 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 compiler/testData/compileKotlinAgainstKotlin/internalWithInlineClass.kt diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/FirCompileKotlinAgainstKotlinTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/FirCompileKotlinAgainstKotlinTestGenerated.java index 84630348abd..78cb73d344c 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/FirCompileKotlinAgainstKotlinTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/codegen/FirCompileKotlinAgainstKotlinTestGenerated.java @@ -245,6 +245,11 @@ public class FirCompileKotlinAgainstKotlinTestGenerated extends AbstractFirCompi runTest("compiler/testData/compileKotlinAgainstKotlin/internalWithDefaultArgs.kt"); } + @TestMetadata("internalWithInlineClass.kt") + public void testInternalWithInlineClass() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/internalWithInlineClass.kt"); + } + @TestMetadata("internalWithOtherModuleName.kt") public void testInternalWithOtherModuleName() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/internalWithOtherModuleName.kt"); diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/MethodSignatureMapper.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/MethodSignatureMapper.kt index 30b0ad3cb90..ab1e9090d9a 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/MethodSignatureMapper.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/MethodSignatureMapper.kt @@ -134,7 +134,10 @@ class MethodSignatureMapper(private val context: JvmBackendContext) { origin != JvmLoweredDeclarationOrigin.SYNTHETIC_METHOD_FOR_PROPERTY_OR_TYPEALIAS_ANNOTATIONS && !isPublishedApi() ) { - return this + return originalFunction.takeIf { it != this } + ?.safeAs() + ?.getInternalFunctionForManglingIfNeeded() + ?: this } originalForDefaultAdapter?.getInternalFunctionForManglingIfNeeded()?.let { return it } return null diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/irCodegenUtils.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/irCodegenUtils.kt index 1dcae594b3d..a9d18685a60 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/irCodegenUtils.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/codegen/irCodegenUtils.kt @@ -383,12 +383,13 @@ fun IrSimpleType.isRawType(): Boolean = hasAnnotation(JvmGeneratorExtensions.RAW_TYPE_ANNOTATION_FQ_NAME) internal fun classFileContainsMethod(classId: ClassId, function: IrFunction, context: JvmBackendContext): Boolean? { - val originalDescriptor = context.methodSignatureMapper.mapSignatureWithGeneric(function).asmMethod.descriptor + val originalSignature = context.methodSignatureMapper.mapSignatureWithGeneric(function).asmMethod + val originalDescriptor = originalSignature.descriptor val descriptor = if (function.isSuspend) listOf(*Type.getArgumentTypes(originalDescriptor), Type.getObjectType("kotlin/coroutines/Continuation")) .joinToString(prefix = "(", postfix = ")", separator = "") + AsmTypes.OBJECT_TYPE else originalDescriptor - return classFileContainsMethod(classId, context.state, Method(function.name.asString(), descriptor)) + return classFileContainsMethod(classId, context.state, Method(originalSignature.name, descriptor)) } val IrMemberWithContainerSource.parentClassId: ClassId? diff --git a/compiler/testData/compileKotlinAgainstKotlin/internalWithInlineClass.kt b/compiler/testData/compileKotlinAgainstKotlin/internalWithInlineClass.kt new file mode 100644 index 00000000000..939d2ee11fe --- /dev/null +++ b/compiler/testData/compileKotlinAgainstKotlin/internalWithInlineClass.kt @@ -0,0 +1,16 @@ +// IGNORE_BACKEND_FIR: JVM_IR +// FILE: A.kt + +package a + +inline class Message(val value: String) + +class Box { + internal fun result(msg: Message): String = msg.value +} + +// FILE: B.kt + +fun box(): String { + return a.Box().result(a.Message("OK")) +} diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/CompileKotlinAgainstKotlinTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/CompileKotlinAgainstKotlinTestGenerated.java index fcc51dc8196..db674468db1 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/CompileKotlinAgainstKotlinTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/CompileKotlinAgainstKotlinTestGenerated.java @@ -244,6 +244,11 @@ public class CompileKotlinAgainstKotlinTestGenerated extends AbstractCompileKotl runTest("compiler/testData/compileKotlinAgainstKotlin/internalWithDefaultArgs.kt"); } + @TestMetadata("internalWithInlineClass.kt") + public void testInternalWithInlineClass() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/internalWithInlineClass.kt"); + } + @TestMetadata("internalWithOtherModuleName.kt") public void testInternalWithOtherModuleName() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/internalWithOtherModuleName.kt"); diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstKotlinTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstKotlinTestGenerated.java index 0cb25e9e39d..5d113d872e1 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstKotlinTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstKotlinTestGenerated.java @@ -245,6 +245,11 @@ public class IrCompileKotlinAgainstKotlinTestGenerated extends AbstractIrCompile runTest("compiler/testData/compileKotlinAgainstKotlin/internalWithDefaultArgs.kt"); } + @TestMetadata("internalWithInlineClass.kt") + public void testInternalWithInlineClass() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/internalWithInlineClass.kt"); + } + @TestMetadata("internalWithOtherModuleName.kt") public void testInternalWithOtherModuleName() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/internalWithOtherModuleName.kt"); diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmIrAgainstOldBoxTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmIrAgainstOldBoxTestGenerated.java index 8e232cfc58f..7a938973a5b 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmIrAgainstOldBoxTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmIrAgainstOldBoxTestGenerated.java @@ -245,6 +245,11 @@ public class JvmIrAgainstOldBoxTestGenerated extends AbstractJvmIrAgainstOldBoxT runTest("compiler/testData/compileKotlinAgainstKotlin/internalWithDefaultArgs.kt"); } + @TestMetadata("internalWithInlineClass.kt") + public void testInternalWithInlineClass() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/internalWithInlineClass.kt"); + } + @TestMetadata("internalWithOtherModuleName.kt") public void testInternalWithOtherModuleName() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/internalWithOtherModuleName.kt"); diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmOldAgainstIrBoxTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmOldAgainstIrBoxTestGenerated.java index 842f7dc7c68..05848569b43 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmOldAgainstIrBoxTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/ir/JvmOldAgainstIrBoxTestGenerated.java @@ -245,6 +245,11 @@ public class JvmOldAgainstIrBoxTestGenerated extends AbstractJvmOldAgainstIrBoxT runTest("compiler/testData/compileKotlinAgainstKotlin/internalWithDefaultArgs.kt"); } + @TestMetadata("internalWithInlineClass.kt") + public void testInternalWithInlineClass() throws Exception { + runTest("compiler/testData/compileKotlinAgainstKotlin/internalWithInlineClass.kt"); + } + @TestMetadata("internalWithOtherModuleName.kt") public void testInternalWithOtherModuleName() throws Exception { runTest("compiler/testData/compileKotlinAgainstKotlin/internalWithOtherModuleName.kt"); From 716326a60f9192677490d086741be04b788d82eb Mon Sep 17 00:00:00 2001 From: Alexander Shabalin Date: Mon, 25 Jan 2021 15:24:47 +0300 Subject: [PATCH 189/212] Disable erroneously enabled tests on wasm (#4652) --- kotlin-native/backend.native/tests/build.gradle | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kotlin-native/backend.native/tests/build.gradle b/kotlin-native/backend.native/tests/build.gradle index b21012613d8..8a7fb3f998a 100644 --- a/kotlin-native/backend.native/tests/build.gradle +++ b/kotlin-native/backend.native/tests/build.gradle @@ -4069,11 +4069,13 @@ interopTest("interop_kt43265") { } interopTest("interop_leakMemoryWithRunningThreadUnchecked") { + disabled = (project.testTarget == 'wasm32') // No interop for wasm yet. interop = 'leakMemoryWithRunningThread' source = "interop/leakMemoryWithRunningThread/unchecked.kt" } interopTest("interop_leakMemoryWithRunningThreadChecked") { + disabled = (project.testTarget == 'wasm32') // No interop for wasm yet. interop = 'leakMemoryWithRunningThread' source = "interop/leakMemoryWithRunningThread/checked.kt" expectedExitStatusChecker = { it != 0 } From 8a48609823075dd33a10fe8010c6355533a6ac42 Mon Sep 17 00:00:00 2001 From: Pavel Punegov Date: Tue, 19 Jan 2021 13:51:46 +0300 Subject: [PATCH 190/212] Lazy task creation in konan plugin using Gradle Providers API. Removes obsolete CMake task and IDE model. Use Provider API for klib files. Replace findAll with matching to make tasks configure lazily Make some test tasks use lazy configuration Fix adding tasks to lists. Add it. to all fields to improve IDEA navigation Remove obsolete IDE model from the task Remove tooling model tests Fix aggregate task dependency Fix run tasks. Cleanup Review fixes --- .../backend.native/tests/build.gradle | 51 ++-- .../org/jetbrains/kotlin/KLibInstall.kt | 15 +- kotlin-native/platformLibs/build.gradle | 68 ++--- .../plugin/konan/KonanBuildingConfig.kt | 135 +++++---- .../gradle/plugin/konan/KonanCompileConfig.kt | 38 +-- .../plugin/konan/KonanInteropLibrary.kt | 29 +- .../gradle/plugin/konan/KonanLibrariesSpec.kt | 2 +- .../kotlin/gradle/plugin/konan/KonanPlugin.kt | 37 ++- .../plugin/konan/tasks/KonanBuildingTask.kt | 2 - .../plugin/konan/tasks/KonanCompileTask.kt | 50 +--- .../konan/tasks/KonanGenerateCMakeTask.kt | 147 ---------- .../plugin/konan/tasks/KonanInteropTask.kt | 25 -- .../kotlin/gradle/plugin/model/KonanModel.kt | 50 ---- .../gradle/plugin/model/KonanModelImpl.kt | 79 ------ .../src/test/kotlin/ToolingModelTests.kt | 267 ------------------ 15 files changed, 218 insertions(+), 777 deletions(-) delete mode 100644 kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/tasks/KonanGenerateCMakeTask.kt delete mode 100644 kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/model/KonanModel.kt delete mode 100644 kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/model/KonanModelImpl.kt delete mode 100644 kotlin-native/tools/kotlin-native-gradle-plugin/src/test/kotlin/ToolingModelTests.kt diff --git a/kotlin-native/backend.native/tests/build.gradle b/kotlin-native/backend.native/tests/build.gradle index 8a7fb3f998a..edf0aa019ea 100644 --- a/kotlin-native/backend.native/tests/build.gradle +++ b/kotlin-native/backend.native/tests/build.gradle @@ -192,9 +192,9 @@ konanArtifacts { } } -task installTestLibrary(type: KlibInstall) { - dependsOn compileKonanTestLibraryHost - klib = konanArtifacts.testLibrary.getArtifactByTarget('host') +def installTestLib = tasks.register("installTestLibrary", KlibInstall) { + dependsOn "compileKonanTestLibraryHost" + klib = project.provider { konanArtifacts.testLibrary.getArtifactByTarget('host') } repo = rootProject.file(testLibraryDir) doLast { @@ -2165,7 +2165,7 @@ standaloneTest("link_testLib_explicitly") { // there are no testLibrary for cross targets yet. enabled = project.target.name == project.hostName - dependsOn 'installTestLibrary' + dependsOn installTestLib goldValue = "This is a side effect of a test library linked into the binary.\nYou should not be seeing this.\n\nHello\n" source = "link/omit/hello.kt" // We force library inclusion, so need to see the warning banner. @@ -3535,12 +3535,12 @@ standaloneTest("testing_stacktrace") { } // Just check that the driver is able to produce runnable binaries. -task driver0(type: KonanDriverTest) { +tasks.register("driver0", KonanDriverTest) { goldValue = "Hello, world!\n" source = "runtime/basic/driver0.kt" } -task driver_opt(type: KonanDriverTest) { +tasks.register("driver_opt", KonanDriverTest) { disabled = (cacheTesting != null) // Cache is not compatible with -opt. goldValue = "Hello, world!\n" source = "runtime/basic/driver0.kt" @@ -3728,14 +3728,16 @@ createInterop("embedStaticLibraries") { // Note: also hardcoded in def file. final String libDir = "$buildDir/embedStaticLibraries/" - it.getByTarget(target.name).doFirst { - 1.upto(4) { - UtilsKt.buildStaticLibrary( - project, - [file("$projectDir/interop/embedStaticLibraries/${it}.c")], - file("$libDir/${it}.a"), - file("$libDir/${it}.objs"), - ) + it.getByTarget(target.name).configure { + doFirst { + 1.upto(4) { + UtilsKt.buildStaticLibrary( + project, + [file("$projectDir/interop/embedStaticLibraries/${it}.c")], + file("$libDir/${it}.a"), + file("$libDir/${it}.objs"), + ) + } } } @@ -4437,7 +4439,7 @@ dynamicTest("interop_memory_leaks") { outputChecker = { s -> s.contains("Memory leaks detected, 1 objects leaked!") } } -task library_mismatch(type: KonanDriverTest) { +tasks.register("library_mismatch", KonanDriverTest) { // Does not work for cross targets yet. enabled = !(project.testTarget != null && project.target.name != project.hostName) @@ -4475,7 +4477,7 @@ task library_mismatch(type: KonanDriverTest) { } } -task library_ir_provider_mismatch(type: KonanDriverTest) { +tasks.register("library_ir_provider_mismatch", KonanDriverTest) { def dir = buildDir.absolutePath def lib = "$projectDir/link/ir_providers/library/empty.kt" def invalidManifest = "$projectDir/link/ir_providers/library/manifest.properties" @@ -4861,12 +4863,14 @@ if (UtilsKt.getTestTargetSupportsCodeCoverage(project)) { } } -task metadata_compare_typedefs(type: MetadataComparisonTest) { +tasks.register("metadata_compare_typedefs", MetadataComparisonTest) { + UtilsKt.dependsOnDist(it) enabled = (project.testTarget != 'wasm32') defFile = "interop/basics/typedefs.def" } -task metadata_compare_unable_to_import(type: MetadataComparisonTest) { +tasks.register("metadata_compare_unable_to_import", MetadataComparisonTest) { + UtilsKt.dependsOnDist(it) enabled = (project.testTarget != 'wasm32') defFile = "interop/basics/unable_to_import.def" } @@ -4883,8 +4887,7 @@ standaloneTest("local_ea_arraysfieldwrite") { source = "codegen/localEscapeAnalysis/arraysFieldWrite.kt" } -task override_konan_properties0(type: KonanDriverTest) { - +tasks.register("override_konan_properties0", KonanDriverTest) { def overrides = PlatformInfo.isWindows() ? '-Xoverride-konan-properties="llvmInlineThreshold=76"' : '-Xoverride-konan-properties=llvmInlineThreshold=76' @@ -4989,7 +4992,7 @@ task buildKonanTests { t -> project.tasks .withType(KonanLocalTest.class) .matching { !(it instanceof KonanStandaloneTest) } - .forEach { it.dependsOn(t) } + .configureEach { it.dependsOn(t) } } @@ -5007,7 +5010,7 @@ sourceSets { } Task pluginTest(String name, String pluginName, Closure configureClosure) { - def jarTask = project.tasks.create("jar-$pluginName", Jar).configure { + def jarTask = project.tasks.register("jar-$pluginName", Jar) { it.dependsOn("compile${pluginName.capitalize()}Kotlin") from { sourceSets[pluginName].output @@ -5062,7 +5065,7 @@ project.tasks.register("debugger_test", Test.class) { if (target.family == Family.IOS && (target.architecture == ARM32 || target.architecture == ARM64)) { project.tasks .withType(KonanTestExecutable.class) - .forEach { + .configureEach { ExecutorServiceKt.configureXcodeBuild((KonanTestExecutable) it) } // Exclude tasks that cannot be run on device @@ -5074,5 +5077,5 @@ if (target.family == Family.IOS && (target.architecture == ARM32 || target.archi it instanceof KonanDynamicTest || it instanceof KonanLinkTest } - .forEach { it.enabled = false } + .configureEach { it.enabled = false } } diff --git a/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/KLibInstall.kt b/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/KLibInstall.kt index faea66b2134..ab1092f0d6b 100644 --- a/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/KLibInstall.kt +++ b/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/KLibInstall.kt @@ -2,6 +2,7 @@ package org.jetbrains.kotlin import groovy.lang.Closure import org.gradle.api.Task +import org.gradle.api.provider.Provider import org.gradle.api.tasks.Exec import org.gradle.api.tasks.Input import org.gradle.api.tasks.InputFile @@ -12,17 +13,17 @@ import java.io.File // TODO: Implement as a part of the gradle plugin open class KlibInstall: Exec() { - @InputFile - lateinit var klib: File + @Input + lateinit var klib: Provider @Input var repo: File = project.rootDir - val installDir: File + val installDir: Provider @OutputDirectory - get() { - val klibName = klib.name.take(klib.name.lastIndexOf('.')) - return project.file("${repo.absolutePath}/$klibName") + get() = project.provider { + val klibName = klib.get().nameWithoutExtension + project.file("${repo.absolutePath}/$klibName") } @Input @@ -38,7 +39,7 @@ open class KlibInstall: Exec() { repo.mkdirs() commandLine(klibProgram, - "install", klib.absolutePath, + "install", klib.get().absolutePath, "-target", target, "-repository", repo.absolutePath ) diff --git a/kotlin-native/platformLibs/build.gradle b/kotlin-native/platformLibs/build.gradle index 387df4de4e1..4f27fa92f1a 100644 --- a/kotlin-native/platformLibs/build.gradle +++ b/kotlin-native/platformLibs/build.gradle @@ -58,16 +58,16 @@ project.rootProject.ext.platformManager.enabled.each { target -> def targetName = target.visibleName - ArrayList installTasks = [] - ArrayList cacheTasks = [] + ArrayList installTasks = [] + ArrayList cacheTasks = [] if (target in cacheableTargets) { - task "${targetName}StdlibCache"(type: KonanCacheTask) { + tasks.register("${targetName}StdlibCache", KonanCacheTask) { it.target = targetName - originalKlib = file("$konanHome/klib/common/stdlib") - cacheRoot = file("$konanHome/klib/cache") + it.originalKlib = file("$konanHome/klib/common/stdlib") + it.cacheRoot = file("$konanHome/klib/cache") - dependsOn ":${targetName}CrossDistRuntime" + it.dependsOn ":${targetName}CrossDistRuntime" } } @@ -76,7 +76,7 @@ project.rootProject.ext.platformManager.enabled.each { target -> def fileNamePrefix = PlatformLibsInfo.namePrefix konanArtifacts { - interop (libName, targets: [targetName]) { + interop(libName, targets: [targetName]) { defFile df.file artifactName "${fileNamePrefix}${df.name}" noDefaultLibs true @@ -92,60 +92,60 @@ project.rootProject.ext.platformManager.enabled.each { target -> } def libTask = konanArtifacts."$libName"."$targetName" - libTask.dependsOn df.config.depends.collect{ defFileToLibName(targetName, it) } - libTask.dependsOn ":${targetName}CrossDist" - libTask.enableParallel = true - - task "$libName"(type: KlibInstall) { - klib = libTask.artifact - repo = file("$konanHome/klib/platform/$targetName") - it.target = targetName - dependsOn libTask - + libTask.configure { + it.dependsOn df.config.depends.collect { defFileToLibName(targetName, it) } + it.dependsOn ":${targetName}CrossDist" + it.enableParallel = true } - installTasks.add(tasks[libName]) + + def klibInstallTask = tasks.register("$libName", KlibInstall) { + it.klib = project.provider { libTask.get().artifact } + it.repo = file("$konanHome/klib/platform/$targetName") + it.target = targetName + it.dependsOn libTask + } + installTasks.add(klibInstallTask) if (target in cacheableTargets) { - task "${libName}Cache"(type: KonanCacheTask) { + def cacheTask = tasks.register("${libName}Cache", KonanCacheTask) { it.target = targetName - originalKlib = tasks[libName].installDir - cacheRoot = file("$konanHome/klib/cache") + it.originalKlib = tasks[libName].installDir.get() + it.cacheRoot = file("$konanHome/klib/cache") - dependsOn ":${targetName}StdlibCache" - dependsOn tasks[libName] - dependsOn df.config.depends.collect { + it.dependsOn ":${targetName}StdlibCache" + it.dependsOn tasks[libName] + it.dependsOn df.config.depends.collect { def depName = defFileToLibName(targetName, it) "${depName}Cache" } - - cacheTasks.add(it) } + cacheTasks.add(cacheTask) } } - task "${targetName}Install" { - dependsOn installTasks + tasks.register("${targetName}Install") { + it.dependsOn installTasks } if (target in cacheableTargets) { - task "${targetName}Cache" { - dependsOn cacheTasks + tasks.register("${targetName}Cache") { + it.dependsOn cacheTasks - group = BasePlugin.BUILD_GROUP - description = "Builds the compilation cache for platform: ${targetName}" + it.group = BasePlugin.BUILD_GROUP + it.description = "Builds the compilation cache for platform: ${targetName}" } } } // TODO: Don't install libraries here - copy them in the distPlatformLibs task task hostInstall { - dependsOn tasks.withType(KlibInstall.class).findAll { + dependsOn tasks.withType(KlibInstall.class).matching { it.target == HostManager.hostName } } task hostCache { - dependsOn tasks.withType(KonanCacheTask.class).findAll { + dependsOn tasks.withType(KonanCacheTask.class).matching { it.target == HostManager.hostName } } diff --git a/kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/KonanBuildingConfig.kt b/kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/KonanBuildingConfig.kt index a015407eceb..9159e317c56 100644 --- a/kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/KonanBuildingConfig.kt +++ b/kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/KonanBuildingConfig.kt @@ -17,30 +17,36 @@ package org.jetbrains.kotlin.gradle.plugin.konan import groovy.lang.Closure -import org.gradle.api.* +import org.gradle.api.Action +import org.gradle.api.InvalidUserDataException +import org.gradle.api.Named +import org.gradle.api.Task import org.gradle.api.internal.project.ProjectInternal import org.gradle.api.plugins.BasePlugin import org.gradle.api.plugins.ExtensionAware import org.gradle.api.publish.maven.MavenPom +import org.gradle.api.tasks.TaskProvider import org.gradle.util.ConfigureUtil -import org.gradle.util.WrapUtil import org.jetbrains.kotlin.gradle.plugin.tasks.KonanBuildingTask import org.jetbrains.kotlin.konan.target.KonanTarget import java.io.File /** Base class for all Kotlin/Native artifacts. */ -abstract class KonanBuildingConfig(private val name_: String, - val type: Class, - val project: ProjectInternal, - val targets: Iterable) - : KonanBuildingSpec, Named, DomainObjectSet by WrapUtil.toDomainObjectSet(type) { +abstract class KonanBuildingConfig( + private val name_: String, + val type: Class, + val project: ProjectInternal, + val targets: Iterable +) : KonanBuildingSpec, Named { internal val mainVariant = KonanSoftwareComponent(project) override fun getName() = name_ - protected val targetToTask = mutableMapOf() + protected val targetToTask = mutableMapOf>() - internal val aggregateBuildTask: Task + fun tasks() = targetToTask.values + + private val aggregateBuildTask: TaskProvider internal var pomActions = mutableListOf>() @@ -56,12 +62,11 @@ abstract class KonanBuildingConfig(private val name_: Stri continue } if (!targetIsSupported(konanTarget)) { - project.logger.info("The target ${targetName} is not supported by the artifact $name") + project.logger.info("The target $targetName is not supported by the artifact $name") continue } if (this[konanTarget] == null) { val task = createTask(konanTarget) - add(task) targetToTask[konanTarget] = task // Allow accessing targets just by their names in Groovy DSL. (this as? ExtensionAware)?.extensions?.add(konanTarget.visibleName, task) @@ -75,13 +80,13 @@ abstract class KonanBuildingConfig(private val name_: Stri } protected open fun generateTaskName(target: KonanTarget) = - "compileKonan${name.capitalize()}${target.visibleName.capitalize()}" + "compileKonan${name.capitalize()}${target.visibleName.capitalize()}" protected open fun generateAggregateTaskName() = - "compileKonan${name.capitalize()}" + "compileKonan${name.capitalize()}" protected open fun generateTargetAliasTaskName(targetName: String) = - "compileKonan${name.capitalize()}${targetName.capitalize()}" + "compileKonan${name.capitalize()}${targetName.capitalize()}" protected abstract fun generateTaskDescription(task: T): String protected abstract fun generateAggregateTaskDescription(task: Task): String @@ -109,31 +114,33 @@ abstract class KonanBuildingConfig(private val name_: Stri } } - protected fun createTask(target: KonanTarget): T = - project.tasks.create(generateTaskName(target), type) { - val outputDescription = determineOutputPlacement(target) - it.init(this, outputDescription.destinationDir, outputDescription.artifactName, target) - it.group = BasePlugin.BUILD_GROUP - it.description = generateTaskDescription(it) - } ?: throw Exception("Cannot create task for target: ${target.visibleName}") + private fun createTask(target: KonanTarget): TaskProvider = + project.tasks.register(generateTaskName(target), type) { + val outputDescription = determineOutputPlacement(target) + it.init(this, outputDescription.destinationDir, outputDescription.artifactName, target) + it.group = BasePlugin.BUILD_GROUP + it.description = generateTaskDescription(it) + } ?: throw Exception("Cannot create task for target: ${target.visibleName}") - protected fun createAggregateTask(): Task = - project.tasks.create(generateAggregateTaskName()) { task -> - task.group = BasePlugin.BUILD_GROUP - task.description = generateAggregateTaskDescription(task) - this.filter { - project.targetIsRequested(it.konanTarget) - }.forEach { - task.dependsOn(it) - } - project.compileAllTask.dependsOn(task) + private fun createAggregateTask(): TaskProvider = + project.tasks.register(generateAggregateTaskName()) { task -> + task.group = BasePlugin.BUILD_GROUP + task.description = generateAggregateTaskDescription(task) + + targetToTask.filter { + project.targetIsRequested(it.key) + }.forEach { + task.dependsOn(it.value) } + }.also { + project.compileAllTask.dependsOn(it) + } - protected fun createTargetAliasTaskIfDeclared(targetName: String): Task? { + protected fun createTargetAliasTaskIfDeclared(targetName: String): TaskProvider? { val canonicalTarget = project.hostManager.targetByName(targetName) return this[canonicalTarget]?.let { canonicalBuild -> - project.tasks.create(generateTargetAliasTaskName(targetName)) { + project.tasks.register(generateTargetAliasTaskName(targetName)) { it.group = BasePlugin.BUILD_GROUP it.description = generateTargetAliasTaskDescription(it, targetName) it.dependsOn(canonicalBuild) @@ -143,31 +150,53 @@ abstract class KonanBuildingConfig(private val name_: Stri internal operator fun get(target: KonanTarget) = targetToTask[target] - fun getByTarget(target: String) = findByTarget(target) ?: throw NoSuchElementException("No such target for artifact $name: ${target}") + fun getByTarget(target: String) = + findByTarget(target) ?: throw NoSuchElementException("No such target for artifact $name: $target") + fun findByTarget(target: String) = this[project.hostManager.targetByName(target)] - fun getArtifactByTarget(target: String) = getByTarget(target).artifact - fun findArtifactByTarget(target: String) = findByTarget(target)?.artifact + fun getArtifactByTarget(target: String) = getByTarget(target).get().artifact + fun findArtifactByTarget(target: String) = findByTarget(target)?.get()?.artifact // Common building DSL. - override fun artifactName(name: String) = forEach { it.artifactName(name) } + override fun artifactName(name: String) = tasks().forEach { it.configure { t -> t.artifactName(name) } } - fun baseDir(dir: Any) = forEach { it.destinationDir(project.file(dir).targetSubdir(it.konanTarget)) } + fun baseDir(dir: Any) = + tasks().forEach { + it.configure { t -> + t.destinationDir( + project.file(dir).targetSubdir(t.konanTarget) + ) + } + } - override fun libraries(closure: Closure) = forEach { it.libraries(closure) } - override fun libraries(action: Action) = forEach { it.libraries(action) } - override fun libraries(configure: KonanLibrariesSpec.() -> Unit) = forEach { it.libraries(configure) } + override fun libraries(closure: Closure) = + tasks().forEach { it.configure { t -> t.libraries(closure) } } - override fun noDefaultLibs(flag: Boolean) = forEach { it.noDefaultLibs(flag) } - override fun noEndorsedLibs(flag: Boolean) = forEach { it.noEndorsedLibs(flag) } + override fun libraries(action: Action) = + tasks().forEach { it.configure { t -> t.libraries(action) } } - override fun dumpParameters(flag: Boolean) = forEach { it.dumpParameters(flag) } + override fun libraries(configure: KonanLibrariesSpec.() -> Unit) = + tasks().forEach { it.configure { t -> t.libraries(configure) } } - override fun extraOpts(vararg values: Any) = forEach { it.extraOpts(*values) } - override fun extraOpts(values: List) = forEach { it.extraOpts(values) } + override fun noDefaultLibs(flag: Boolean) = + tasks().forEach { it.configure { t -> t.noDefaultLibs(flag) } } - fun dependsOn(vararg dependencies: Any?) = forEach { it.dependsOn(*dependencies) } + override fun noEndorsedLibs(flag: Boolean) = + tasks().forEach { it.configure { t -> t.noEndorsedLibs(flag) } } + + override fun dumpParameters(flag: Boolean) = + tasks().forEach { it.configure { t -> t.dumpParameters(flag) } } + + override fun extraOpts(vararg values: Any) = + tasks().forEach { it.configure { t -> t.extraOpts(*values) } } + + override fun extraOpts(values: List) = + tasks().forEach { it.configure { t -> t.extraOpts(values) } } + + fun dependsOn(vararg dependencies: Any?) = + tasks().forEach { it.configure { t -> t.dependsOn(*dependencies) } } fun target(targetString: String, configureAction: T.() -> Unit) { val target = project.hostManager.targetByName(targetString) @@ -177,14 +206,16 @@ abstract class KonanBuildingConfig(private val name_: Stri return } - val task = this[target] ?: - throw InvalidUserDataException("Target '$targetString' is not declared. Please add it into project.konanTasks list") - task.configureAction() + val task = this[target] + ?: throw InvalidUserDataException("Target '$targetString' is not declared. Please add it into project.konanTasks list") + task.configure(configureAction) } + fun target(targetString: String, configureAction: Action) = - target(targetString) { configureAction.execute(this) } + target(targetString) { configureAction.execute(this) } + fun target(targetString: String, configureAction: Closure) = - target(targetString, ConfigureUtil.configureUsing(configureAction)) + target(targetString, ConfigureUtil.configureUsing(configureAction)) fun pom(action: Action) = pomActions + action } diff --git a/kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/KonanCompileConfig.kt b/kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/KonanCompileConfig.kt index 925f555dd85..1de7d799950 100644 --- a/kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/KonanCompileConfig.kt +++ b/kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/KonanCompileConfig.kt @@ -43,33 +43,33 @@ abstract class KonanCompileConfig(name: String, override fun generateTargetAliasTaskDescription(task: Task, targetName: String) = "Build the Kotlin/Native $typeForDescription '${task.name}' for target '$targetName'" - override fun srcDir(dir: Any) = forEach { it.srcDir(dir) } - override fun srcFiles(vararg files: Any) = forEach { it.srcFiles(*files) } - override fun srcFiles(files: Collection) = forEach { it.srcFiles(files) } + override fun srcDir(dir: Any) = tasks().forEach { it.configure { t -> t.srcDir(dir) } } + override fun srcFiles(vararg files: Any) = tasks().forEach { it.configure { t -> t.srcFiles(*files) } } + override fun srcFiles(files: Collection) = tasks().forEach { it.configure { t -> t.srcFiles(files) } } - override fun nativeLibrary(lib: Any) = forEach { it.nativeLibrary(lib) } - override fun nativeLibraries(vararg libs: Any) = forEach { it.nativeLibraries(*libs) } - override fun nativeLibraries(libs: FileCollection) = forEach { it.nativeLibraries(libs) } + override fun nativeLibrary(lib: Any) = tasks().forEach { it.configure { t -> t.nativeLibrary(lib) } } + override fun nativeLibraries(vararg libs: Any) = tasks().forEach { it.configure { t -> t.nativeLibraries(*libs) } } + override fun nativeLibraries(libs: FileCollection) = tasks().forEach { it.configure { t -> t.nativeLibraries(libs) } } @Deprecated("Use commonSourceSets instead", ReplaceWith("commonSourceSets(sourceSetName)")) - override fun commonSourceSet(sourceSetName: String) = forEach { it.commonSourceSets(sourceSetName) } - override fun commonSourceSets(vararg sourceSetNames: String) = forEach { it.commonSourceSets(*sourceSetNames) } - override fun enableMultiplatform(flag: Boolean) = forEach { it.enableMultiplatform(flag) } + override fun commonSourceSet(sourceSetName: String) = tasks().forEach { it.configure { t -> t.commonSourceSets(sourceSetName) } } + override fun commonSourceSets(vararg sourceSetNames: String) = tasks().forEach { it.configure { t -> t.commonSourceSets(*sourceSetNames) } } + override fun enableMultiplatform(flag: Boolean) = tasks().forEach { it.configure { t -> t.enableMultiplatform(flag) } } - override fun linkerOpts(values: List) = forEach { it.linkerOpts(values) } - override fun linkerOpts(vararg values: String) = forEach { it.linkerOpts(*values) } + override fun linkerOpts(values: List) = tasks().forEach { it.configure { t -> t.linkerOpts(values) } } + override fun linkerOpts(vararg values: String) = tasks().forEach { it.configure { t -> t.linkerOpts(*values) } } - override fun enableDebug(flag: Boolean) = forEach { it.enableDebug(flag) } - override fun noStdLib(flag: Boolean) = forEach { it.noStdLib(flag) } - override fun noMain(flag: Boolean) = forEach { it.noMain(flag) } - override fun enableOptimizations(flag: Boolean) = forEach { it.enableOptimizations(flag) } - override fun enableAssertions(flag: Boolean) = forEach { it.enableAssertions(flag) } + override fun enableDebug(flag: Boolean) = tasks().forEach { it.configure { t -> t.enableDebug(flag) } } + override fun noStdLib(flag: Boolean) = tasks().forEach { it.configure { t -> t.noStdLib(flag) } } + override fun noMain(flag: Boolean) = tasks().forEach { it.configure { t -> t.noMain(flag) } } + override fun enableOptimizations(flag: Boolean) = tasks().forEach { it.configure { t -> t.enableOptimizations(flag) } } + override fun enableAssertions(flag: Boolean) = tasks().forEach { it.configure { t -> t.enableAssertions(flag) } } - override fun entryPoint(entryPoint: String) = forEach { it.entryPoint(entryPoint) } + override fun entryPoint(entryPoint: String) = tasks().forEach { it.configure { t -> t.entryPoint(entryPoint) } } - override fun measureTime(flag: Boolean) = forEach { it.measureTime(flag) } + override fun measureTime(flag: Boolean) = tasks().forEach { it.configure { t -> t.measureTime(flag) } } - override fun dependencies(closure: Closure) = forEach { it.dependencies(closure) } + override fun dependencies(closure: Closure) = tasks().forEach { it.configure { t -> t.dependencies(closure) } } } open class KonanProgram(name: String, diff --git a/kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/KonanInteropLibrary.kt b/kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/KonanInteropLibrary.kt index f5b87da03f1..2160efffc04 100644 --- a/kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/KonanInteropLibrary.kt +++ b/kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/KonanInteropLibrary.kt @@ -49,38 +49,37 @@ open class KonanInteropLibrary(name: String, inner class IncludeDirectoriesSpecImpl: IncludeDirectoriesSpec { override fun allHeaders(vararg includeDirs: Any) = allHeaders(includeDirs.toList()) - override fun allHeaders(includeDirs: Collection) = forEach { - it.includeDirs.allHeaders(includeDirs) + override fun allHeaders(includeDirs: Collection) = tasks().forEach { + it.configure { t -> t.includeDirs.allHeaders(includeDirs) } } override fun headerFilterOnly(vararg includeDirs: Any) = headerFilterOnly(includeDirs.toList()) - override fun headerFilterOnly(includeDirs: Collection) = forEach { - it.includeDirs.headerFilterOnly(includeDirs) + override fun headerFilterOnly(includeDirs: Collection) = tasks().forEach { + it.configure { t -> t.includeDirs.headerFilterOnly(includeDirs) } } } val includeDirs = IncludeDirectoriesSpecImpl() - override fun defFile(file: Any) = forEach { it.defFile(file) } + override fun defFile(file: Any) = tasks().forEach { it.configure { t -> t.defFile(file) } } - override fun packageName(value: String) = forEach { it.packageName(value) } + override fun packageName(value: String) = tasks().forEach { it.configure { t -> t.packageName(value) } } - override fun compilerOpts(vararg values: String) = forEach { it.compilerOpts(*values) } + override fun compilerOpts(vararg values: String) = tasks().forEach { it.configure { t -> t.compilerOpts(*values) } } - override fun headers(vararg files: Any) = forEach { it.headers(*files) } + override fun headers(vararg files: Any) = tasks().forEach { it.configure { t -> t.headers(*files) } } - override fun headers(files: FileCollection) = forEach { it.headers(files) } + override fun headers(files: FileCollection) = tasks().forEach { it.configure { t -> t.headers(files) } } - override fun includeDirs(vararg values: Any) = forEach { it.includeDirs(*values) } + override fun includeDirs(vararg values: Any) = tasks().forEach { it.configure { t -> t.includeDirs(*values) } } override fun includeDirs(closure: Closure) = includeDirs(ConfigureUtil.configureUsing(closure)) override fun includeDirs(action: Action) = includeDirs { action.execute(this) } override fun includeDirs(configure: IncludeDirectoriesSpec.() -> Unit) = includeDirs.configure() - override fun linkerOpts(values: List) = forEach { it.linkerOpts(values) } + override fun linkerOpts(values: List) = tasks().forEach { it.configure { t -> t.linkerOpts(values) } } override fun linkerOpts(vararg values: String) = linkerOpts(values.toList()) - override fun link(vararg files: Any) = forEach { it.link(*files) } - override fun link(files: FileCollection) = forEach { it.link(files) } - override fun dependencies(closure: Closure) = forEach { it.dependencies(closure) } - + override fun link(vararg files: Any) = tasks().forEach { it.configure { t -> t.link(*files) } } + override fun link(files: FileCollection) = tasks().forEach { it.configure { t -> t.link(files) } } + override fun dependencies(closure: Closure) = tasks().forEach { it.configure { t -> t.dependencies(closure) }} } \ No newline at end of file diff --git a/kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/KonanLibrariesSpec.kt b/kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/KonanLibrariesSpec.kt index 968a61185b3..3d9475ac536 100644 --- a/kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/KonanLibrariesSpec.kt +++ b/kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/KonanLibrariesSpec.kt @@ -86,7 +86,7 @@ open class KonanLibrariesSpec( throw InvalidUserDataException("Config ${lib.name} is not a library") } - val libraryTask = lib[target] ?: + val libraryTask = lib[target]?.get() ?: throw InvalidUserDataException("Library ${lib.name} has no target ${target.visibleName}") if (libraryTask == task) { diff --git a/kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/KonanPlugin.kt b/kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/KonanPlugin.kt index b58bbe2448f..5bc0d6f364e 100644 --- a/kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/KonanPlugin.kt +++ b/kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/KonanPlugin.kt @@ -16,6 +16,8 @@ package org.jetbrains.kotlin.gradle.plugin.konan +import groovy.lang.Closure +import org.codehaus.groovy.runtime.GStringImpl import org.gradle.api.* import org.gradle.api.component.ComponentWithVariants import org.gradle.api.component.SoftwareComponent @@ -28,11 +30,11 @@ import org.gradle.api.plugins.BasePlugin import org.gradle.api.publish.PublishingExtension import org.gradle.api.publish.maven.MavenPublication import org.gradle.api.publish.maven.internal.publication.MavenPublicationInternal +import org.gradle.api.tasks.Exec import org.gradle.language.cpp.internal.NativeVariantIdentity import org.gradle.tooling.provider.model.ToolingModelBuilderRegistry import org.gradle.util.GradleVersion import org.jetbrains.kotlin.gradle.plugin.konan.KonanPlugin.Companion.COMPILE_ALL_TASK_NAME -import org.jetbrains.kotlin.gradle.plugin.model.KonanToolingModelBuilder import org.jetbrains.kotlin.gradle.plugin.tasks.* import org.jetbrains.kotlin.konan.CURRENT import org.jetbrains.kotlin.konan.CompilerVersion @@ -330,11 +332,9 @@ class KonanPlugin @Inject constructor(private val registry: ToolingModelBuilderR return } checkGradleVersion() - registry.register(KonanToolingModelBuilder) project.plugins.apply("base") // Create necessary tasks and extensions. project.tasks.create(KONAN_DOWNLOAD_TASK_NAME, KonanCompilerDownloadTask::class.java) - project.tasks.create(KONAN_GENERATE_CMAKE_TASK_NAME, KonanGenerateCMakeTask::class.java) project.extensions.create(KONAN_EXTENSION_NAME, KonanExtension::class.java) val container = project.extensions.create( KonanArtifactContainer::class.java, @@ -363,15 +363,36 @@ class KonanPlugin @Inject constructor(private val registry: ToolingModelBuilderR doLast { project.cleanKonan() } } + project.afterEvaluate { + project.tasks + .withType(KonanCompileProgramTask::class.java) + .forEach { task -> + val isCrossCompile = (task.target != HostManager.host.visibleName) + if (!isCrossCompile && !project.hasProperty("konanNoRun")) + task.runTask = project.tasks.register("run${task.artifactName.capitalize()}", Exec::class.java) { + it.group= "run" + it.dependsOn(task) + val artifactPathClosure = object : Closure(this) { + override fun call() = task.artifactPath + } + // Use GString to evaluate a path to the artifact lazily thus allow changing it at configuration phase. + val lazyArtifactPath = GStringImpl(arrayOf(artifactPathClosure), arrayOf("")) + it.executable(lazyArtifactPath) + // Add values passed in the runArgs project property as arguments. + it.argumentProviders.add(task.RunArgumentProvider()) + } + } + } + val runTask = project.getOrCreateTask("run") project.afterEvaluate { project.konanArtifactsContainer - .filterIsInstance(KonanProgram::class.java) - .forEach { program -> - program.forEach { compile -> - compile.runTask?.let { runTask.dependsOn(it) } - } + .filterIsInstance(KonanProgram::class.java) + .forEach { program -> + program.tasks().forEach { compile -> + compile.configure { it.runTask?.let { runTask.dependsOn(it) } } } + } } // Enable multiplatform support diff --git a/kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/tasks/KonanBuildingTask.kt b/kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/tasks/KonanBuildingTask.kt index 50e9518649b..d03b77c0a5b 100644 --- a/kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/tasks/KonanBuildingTask.kt +++ b/kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/tasks/KonanBuildingTask.kt @@ -21,7 +21,6 @@ import org.gradle.api.tasks.Input import org.gradle.api.tasks.Internal import org.gradle.api.tasks.TaskAction import org.jetbrains.kotlin.gradle.plugin.konan.* -import org.jetbrains.kotlin.gradle.plugin.model.KonanModelArtifact import org.jetbrains.kotlin.konan.target.KonanTarget import java.io.File @@ -30,7 +29,6 @@ abstract class KonanBuildingTask: KonanArtifactWithLibrariesTask(), KonanBuildin @get:Internal internal abstract val toolRunner: KonanToolRunner - internal abstract fun toModelArtifact(): KonanModelArtifact override fun init(config: KonanBuildingConfig<*>, destinationDir: File, artifactName: String, target: KonanTarget) { dependsOn(project.konanCompilerDownloadTask) diff --git a/kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/tasks/KonanCompileTask.kt b/kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/tasks/KonanCompileTask.kt index 800ee821e2e..775d6937024 100644 --- a/kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/tasks/KonanCompileTask.kt +++ b/kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/tasks/KonanCompileTask.kt @@ -18,13 +18,12 @@ package org.jetbrains.kotlin.gradle.plugin.tasks import groovy.lang.Closure import org.codehaus.groovy.runtime.GStringImpl +import org.gradle.api.Project import org.gradle.api.file.ConfigurableFileTree import org.gradle.api.file.FileCollection import org.gradle.api.tasks.* import org.gradle.process.CommandLineArgumentProvider import org.jetbrains.kotlin.gradle.plugin.konan.* -import org.jetbrains.kotlin.gradle.plugin.model.KonanModelArtifact -import org.jetbrains.kotlin.gradle.plugin.model.KonanModelArtifactImpl import org.jetbrains.kotlin.konan.library.defaultResolver import org.jetbrains.kotlin.konan.target.CompilerOutputKind import org.jetbrains.kotlin.konan.target.Distribution @@ -323,29 +322,6 @@ abstract class KonanCompileTask: KonanBuildingTask(), KonanCompileSpec { } // endregion - // region IDE model - override fun toModelArtifact(): KonanModelArtifact { - val repos = libraries.repos - val resolver = defaultResolver( - repos.map { it.absolutePath }, - konanTarget, - Distribution(project.konanHome) - ) - - return KonanModelArtifactImpl( - artifactName, - artifact, - produce, - konanTarget.name, - name, - allSources.filterIsInstance(ConfigurableFileTree::class.java).map { it.dir }, - allSourceFiles, - libraries.asFiles(resolver), - repos.toList() - ) - } - // endregion - override fun run() { destinationDir.mkdirs() if (dumpParameters) { @@ -379,33 +355,13 @@ open class KonanCompileProgramTask: KonanCompileNativeBinary() { override val produce: CompilerOutputKind get() = CompilerOutputKind.PROGRAM @Internal - var runTask: Exec? = null + var runTask: TaskProvider? = null - inner class RunArgumentProvider(): CommandLineArgumentProvider { + inner class RunArgumentProvider: CommandLineArgumentProvider { override fun asArguments() = project.findProperty("runArgs")?.let { it.toString().split(' ') } ?: emptyList() } - - // Create tasks to run supported executables. - override fun init(config: KonanBuildingConfig<*>, destinationDir: File, artifactName: String, target: KonanTarget) { - super.init(config, destinationDir, artifactName, target) - if (!isCrossCompile && !project.hasProperty("konanNoRun")) { - runTask = project.tasks.create("run${artifactName.capitalize()}", Exec::class.java).apply { - group = "run" - dependsOn(this@KonanCompileProgramTask) - val artifactPathClosure = object : Closure(this) { - override fun call() = artifactPath - } - // Use GString to evaluate a path to the artifact lazily thus allow changing it at configuration phase. - val lazyArtifactPath = GStringImpl(arrayOf(artifactPathClosure), arrayOf("")) - executable(lazyArtifactPath) - // Add values passed in the runArgs project property as arguments. - argumentProviders.add(RunArgumentProvider()) - } - } - } - } open class KonanCompileDynamicTask: KonanCompileNativeBinary() { diff --git a/kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/tasks/KonanGenerateCMakeTask.kt b/kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/tasks/KonanGenerateCMakeTask.kt deleted file mode 100644 index 94351bf15f9..00000000000 --- a/kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/tasks/KonanGenerateCMakeTask.kt +++ /dev/null @@ -1,147 +0,0 @@ -/* - * 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.kotlin.gradle.plugin.tasks - -import org.gradle.api.DefaultTask -import org.gradle.api.file.FileCollection -import org.gradle.api.tasks.TaskAction -import org.jetbrains.kotlin.gradle.plugin.konan.KonanInteropLibrary -import org.jetbrains.kotlin.gradle.plugin.konan.KonanLibrary -import org.jetbrains.kotlin.gradle.plugin.konan.KonanProgram -import org.jetbrains.kotlin.gradle.plugin.konan.konanArtifactsContainer -import org.jetbrains.kotlin.konan.target.Family -import org.jetbrains.kotlin.konan.target.HostManager -import java.io.File - -open class KonanGenerateCMakeTask : DefaultTask() { - @Suppress("unused") - @TaskAction - fun generateCMake() { - val interops = project.konanArtifactsContainer.toList().filterIsInstance() - val libraries = project.konanArtifactsContainer.toList().filterIsInstance() - val programs = project.konanArtifactsContainer.toList().filterIsInstance() - val cMakeLists = generateCMakeLists( - project.name, - interops, - libraries, - programs - ) - File(project.projectDir, "CMakeLists.txt") - .writeText(cMakeLists) - - // This directory is filled out by the IDE - File(project.projectDir, "KotlinCMakeModule") - .mkdir() - } - - private val host = HostManager.host - - private fun generateCMakeLists( - projectName: String, - interops: List, - libraries: List, - programs: List - ): String { - val cMakeCurrentListDir = "$" + "{CMAKE_CURRENT_LIST_DIR}" - - return buildString { - appendln(""" - cmake_minimum_required(VERSION 3.8) - - set(CMAKE_MODULE_PATH $cMakeCurrentListDir/KotlinCMakeModule) - - project($projectName Kotlin) - """.trimIndent()) - appendln() - - for (interop in interops) { - val task = interop[host] ?: continue - appendln( - Call("cinterop") - .arg("NAME", interop.name) - .arg("DEF_FILE", task.defFile.relativePath.toString().crossPlatformPath) - .arg("COMPILER_OPTS", task.cMakeCompilerOpts) - ) - } - - for (library in libraries) { - val task = library[host] ?: continue - appendln( - Call("konanc_library") - .arg("NAME", library.name) - .arg("SOURCES", task.cMakeSources) - .arg("LIBRARIES", task.cMakeLibraries) - .arg("LINKER_OPTS", task.cMakeLinkerOpts)) - } - - for (program in programs) { - val task = program[host] ?: continue - appendln( - Call("konanc_executable") - .arg("NAME", program.name) - .arg("SOURCES", task.cMakeSources) - .arg("LIBRARIES", task.cMakeLibraries) - .arg("LINKER_OPTS", task.cMakeLinkerOpts)) - } - } - } - - private val File.relativePath get() = relativeTo(project.projectDir) - - private val String.crossPlatformPath get() = - if (host.family == Family.MINGW) replace('\\', '/') else this - - private val FileCollection.asCMakeSourceList: List - get() = files.map { it.relativePath.toString().crossPlatformPath } - - private val KonanInteropTask.cMakeCompilerOpts: String - get() = (compilerOpts + includeDirs.allHeadersDirs.map { "-I${it.absolutePath.crossPlatformPath}" }) - .joinToString(" ") - - private val KonanCompileTask.cMakeSources: String - get() = allSources.flatMap { it.asCMakeSourceList }.joinToString(" ") - - private val KonanCompileTask.cMakeLibraries: String - get() = mutableListOf().apply { - addAll(libraries.artifacts.map { it.artifactName }) - addAll(libraries.namedKlibs) - addAll(libraries.files.flatMap { it.files }.map { it.canonicalPath.crossPlatformPath }) - }.joinToString(" ") - - private val KonanCompileTask.cMakeLinkerOpts: String - get() = linkerOpts.joinToString(" ").replace('\\', '/') -} - -private class Call(val name: String) { - private val args: MutableList> = mutableListOf() - - fun arg(key: String, value: String?): Call { - if (value != null && value.isNotBlank()) args += key to value - return this - } - - override fun toString(): String = - buildString { - append(name) - append("(") - for ((key, value) in args) { - appendln() - append(" $key $value") - } - appendln(")") - } -} diff --git a/kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/tasks/KonanInteropTask.kt b/kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/tasks/KonanInteropTask.kt index a0080060abf..12119d2623d 100644 --- a/kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/tasks/KonanInteropTask.kt +++ b/kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/konan/tasks/KonanInteropTask.kt @@ -27,8 +27,6 @@ import org.gradle.workers.WorkParameters import org.gradle.workers.WorkerExecutor import org.jetbrains.kotlin.gradle.plugin.konan.* import org.jetbrains.kotlin.gradle.plugin.konan.KonanInteropSpec.IncludeDirectoriesSpec -import org.jetbrains.kotlin.gradle.plugin.model.KonanModelArtifact -import org.jetbrains.kotlin.gradle.plugin.model.KonanModelArtifactImpl import org.jetbrains.kotlin.konan.CURRENT import org.jetbrains.kotlin.konan.CompilerVersion import org.jetbrains.kotlin.konan.library.defaultResolver @@ -170,29 +168,6 @@ open class KonanInteropTask @Inject constructor(@Internal val workerExecutor: Wo // endregion - // region IDE model - override fun toModelArtifact(): KonanModelArtifact { - val repos = libraries.repos - val resolver = defaultResolver( - repos.map { it.absolutePath }, - konanTarget, - Distribution(project.konanHome) - ) - - return KonanModelArtifactImpl( - artifactName, - artifact, - CompilerOutputKind.LIBRARY, - konanTarget.name, - name, - listOfNotNull(defFile.parentFile), - listOf(defFile), - libraries.asFiles(resolver), - repos.toList() - ) - } - // endregion - internal interface RunToolParameters: WorkParameters { var taskName: String var args: List diff --git a/kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/model/KonanModel.kt b/kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/model/KonanModel.kt deleted file mode 100644 index cb3ff3e0318..00000000000 --- a/kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/model/KonanModel.kt +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.kotlin.gradle.plugin.model - -import org.jetbrains.kotlin.konan.CompilerVersion -import org.jetbrains.kotlin.konan.target.CompilerOutputKind -import java.io.File -import java.io.Serializable - -/** - * An immutable representation of Konan's project model for gradle tooling API. - * This model is shared with the client processes such as an IDE. - */ -interface KonanModel : Serializable { - val konanHome: File - val konanVersion: CompilerVersion - val languageVersion: String? - val apiVersion: String? - - val artifacts: List -} - -/** - * A representation of a single binary produced by Kotlin/Native for a cetrain target. - */ -interface KonanModelArtifact : Serializable { - val name: String - val type: CompilerOutputKind - val targetPlatform: String - val file: File - val buildTaskName: String - val srcDirs: List - val srcFiles: List - val libraries: List - val searchPaths: List -} diff --git a/kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/model/KonanModelImpl.kt b/kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/model/KonanModelImpl.kt deleted file mode 100644 index ce6a2c419cf..00000000000 --- a/kotlin-native/tools/kotlin-native-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/model/KonanModelImpl.kt +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright 2010-2018 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.kotlin.gradle.plugin.model - -import org.gradle.api.Project -import org.gradle.tooling.provider.model.ToolingModelBuilder -import org.jetbrains.kotlin.gradle.plugin.konan.konanArtifactsContainer -import org.jetbrains.kotlin.gradle.plugin.konan.konanExtension -import org.jetbrains.kotlin.gradle.plugin.konan.konanHome -import org.jetbrains.kotlin.gradle.plugin.konan.konanVersion -import org.jetbrains.kotlin.konan.CURRENT -import org.jetbrains.kotlin.konan.CompilerVersion -import org.jetbrains.kotlin.konan.target.CompilerOutputKind -import java.io.File - - -object KonanToolingModelBuilder : ToolingModelBuilder { - - override fun canBuild(modelName: String) = KonanModel::class.java.name == modelName - - private fun buildModelKonan(project: Project): KonanModel { - val artifacts = project.konanArtifactsContainer.flatten().toList().map { it.toModelArtifact() } - return KonanModelImpl( - artifacts, - project.file(project.konanHome), - project.konanVersion, - // TODO: Provide defaults for these versions. - project.konanExtension.languageVersion, - project.konanExtension.apiVersion - ) - } - - private val Project.hasKonanPlugin: Boolean - get() = with(pluginManager) { - hasPlugin("konan") || - hasPlugin("org.jetbrains.kotlin.konan") - } - - - override fun buildAll(modelName: String, project: Project): KonanModel = - when { - project.hasKonanPlugin -> buildModelKonan(project) - else -> throw IllegalStateException("The project '${project.path}' has no Kotlin/Native plugin") - } -} - -internal data class KonanModelImpl( - override val artifacts: List, - override val konanHome: File, - override val konanVersion: CompilerVersion, - override val languageVersion: String?, - override val apiVersion: String? -) : KonanModel - -internal data class KonanModelArtifactImpl( - override val name: String, - override val file: File, - override val type: CompilerOutputKind, - override val targetPlatform: String, - override val buildTaskName: String, - override val srcDirs: List, - override val srcFiles: List, - override val libraries: List, - override val searchPaths: List -) : KonanModelArtifact diff --git a/kotlin-native/tools/kotlin-native-gradle-plugin/src/test/kotlin/ToolingModelTests.kt b/kotlin-native/tools/kotlin-native-gradle-plugin/src/test/kotlin/ToolingModelTests.kt deleted file mode 100644 index 14b1a85be55..00000000000 --- a/kotlin-native/tools/kotlin-native-gradle-plugin/src/test/kotlin/ToolingModelTests.kt +++ /dev/null @@ -1,267 +0,0 @@ -/* - * Copyright 2010-2018 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.kotlin.gradle.plugin.test - -import org.gradle.api.internal.project.ProjectInternal -import org.gradle.testfixtures.ProjectBuilder -import org.jetbrains.kotlin.gradle.plugin.konan.KonanPlugin -import org.jetbrains.kotlin.gradle.plugin.konan.konanArtifactsContainer -import org.jetbrains.kotlin.gradle.plugin.model.KonanToolingModelBuilder -import org.jetbrains.kotlin.konan.CURRENT -import org.jetbrains.kotlin.konan.CompilerVersion -import org.junit.Ignore -import org.junit.Rule -import org.junit.rules.TemporaryFolder -import java.io.File -import java.nio.file.Paths -import kotlin.test.Test -import kotlin.test.assertEquals - -open class ToolingModelTests { - val tmpFolder = TemporaryFolder() - @Rule get - - val projectDirectory: File - get() = tmpFolder.root - - fun String.escapeBackSlashes() = KonanProject.escapeBackSlashes(this) - - @Ignore - @Test - fun `The model should be serialized without exceptions`() { - val project = KonanProject.createEmpty(projectDirectory).apply { - buildFile.appendText(""" - konanArtifacts { - library('foo') { - srcDir 'src/foo/kotlin' - } - interop('bar') - - program('main') { - libraries { - artifact konanArtifacts.foo - artifact konanArtifacts.bar - klib 'posix' - } - } - } - - import org.jetbrains.kotlin.gradle.plugin.model.* - - task testSerialization { - doLast { - def model = KonanToolingModelBuilder.INSTANCE.buildAll("KonanModel", project) - file("model.bin").withObjectOutputStream { - it.writeObject(model) - } - - KonanModelImpl deserializedModel - file("model.bin").withObjectInputStream(model.getClass().getClassLoader()) { stream -> - deserializedModel = (KonanModelImpl) stream.readObject() - } - - if (!deserializedModel.equals(model)) { - throw new AssertionError("The deserialized model doesn't equal to the initial one") - } - } - } - """.trimIndent()) - - generateSrcFile("main.kt") - generateSrcFile(Paths.get("src", "foo", "kotlin"), "foo.kt", "fun foo() = 1") - generateSrcFile(Paths.get("src", "bar", "kotlin"), "bar.kt", "fun bar() = 1") - generateDefFile("baz.def", "") - generateDefFile("qux.def", "") - } - project.createRunner().withArguments("testSerialization").build() - } - - @Ignore - @Test - fun `The model should contain the same data as the Gradle tasks`() { - val project = KonanProject.createEmpty(projectDirectory, listOf("host", "wasm32")).apply { - val konanVersion = CompilerVersion.CURRENT.toString() - generateSrcFile(listOf("src", "foo1"), "foo1.kt", "fun foo1() = 0") - generateSrcFile(listOf("src", "foo1"), "foo11.kt", "fun foo11() = 0") - generateSrcFile(listOf("src", "foo2"), "foo2.kt", "fun foo2() = 0") - generateSrcFile(listOf("defs_bar"), "bar.def", "") - generateSrcFile(listOf("src", "baz"), "baz.kt", "fun baz() = 0") - generateSrcFile("main.kt") - createSubDir("custom_repo") - buildFile.appendText(""" - konanArtifacts { - library('foo') { - srcDir 'src/foo1' - srcDir 'src/foo2' - } - interop('bar') { - defFile 'defs_bar/bar.def' - } - library('baz') { - srcDir 'src/baz' - } - - program('main') { - libraries { - artifact konanArtifacts.foo - artifact konanArtifacts.bar - klib 'baz' - - useRepo 'custom_repo' - } - } - } - - konan { - languageVersion = "1.2" - apiVersion = "1.2" - } - - import org.jetbrains.kotlin.gradle.plugin.model.* - import shadow.org.jetbrains.kotlin.konan.target.CompilerOutputKind - - public void assertEquals( - T actual, - T expected, - String message = "${'$'}expected expected but ${'$'}actual found") { - if (expected != actual) { - throw new AssertionError(message) - } - } - - public void assertContentEquals( - Collection actual, - Collection expected, - String message = "${'$'}expected\nexpected but\n${'$'}actual\nfound") { - if (actual.size() != expected.size() || !actual.containsAll(expected)) { - throw new AssertionError(message) - } - } - - task testModelData { - dependsOn('compileKonanBaz') - doLast { - def model = KonanToolingModelBuilder.INSTANCE.buildAll("KonanModel", project) - assertEquals(model.konanHome, file(project.getProperty('org.jetbrains.kotlin.native.home'))) - assertEquals(model.konanVersion.toString(), "$konanVersion") - - assertEquals(model.languageVersion, "1.2") - assertEquals(model.apiVersion, "1.2") - - model.artifacts.each { - - def konanArtifact = konanArtifacts[it.name] - def target = it.targetPlatform - def task = konanArtifact.getByTarget(target) - - assertEquals(it.file, task.artifact) - assertEquals(it.buildTaskName, task.name) - - switch(it.name) { - case 'foo': - assertEquals(it.type, CompilerOutputKind.valueOf('LIBRARY')) - assertContentEquals(it.srcDirs, [file('src/foo1'), file('src/foo2')]) - assertContentEquals(it.srcFiles, [ - file('src/foo1/foo1.kt'), - file('src/foo1/foo11.kt'), - file('src/foo2/foo2.kt')]) - assertContentEquals(it.libraries, []) - assertContentEquals(it.searchPaths, [task.artifact.parentFile]) - break - case 'bar': - assertEquals(it.type, CompilerOutputKind.valueOf('LIBRARY')) - assertContentEquals(it.srcDirs, [file('defs_bar')]) - assertContentEquals(it.srcFiles, [file('defs_bar/bar.def')]) - assertContentEquals(it.libraries, []) - assertContentEquals(it.searchPaths, [task.artifact.parentFile]) - break - case 'main': - assertEquals(it.type, CompilerOutputKind.valueOf('PROGRAM')) - assertContentEquals(it.srcDirs, [file('src/main/kotlin')]) - assertContentEquals(it.srcFiles, [file('src/main/kotlin/main.kt')]) - assertContentEquals(it.libraries, [ - konanArtifacts['foo'].getByTarget(target).artifact, - konanArtifacts['bar'].getByTarget(target).artifact, - konanArtifacts['baz'].getByTarget(target).artifact - ]) - assertContentEquals(it.searchPaths, [ - file('custom_repo'), - task.artifact.parentFile, - konanArtifacts.foo.getByTarget(target).artifact.parentFile - ]) - break - } - } - } - } - """.trimIndent()) - } - project.createRunner().withArguments("testModelData").build() - } - - @Test - fun `The model should support maven libraries`() { - val repoDir = projectDirectory.resolve("repo").absolutePath.escapeBackSlashes() - val dependency = KonanProject.createEmpty(projectDirectory).apply { - buildFile.appendText(""" - group 'test' - version '1.0' - - konanArtifacts { - library('foo') - } - - apply plugin: 'maven-publish' - - publishing { - repositories { - maven { - url = '$repoDir' - } - } - } - """.trimIndent()) - generateSrcFile("main.kt") - } - dependency.createRunner().withArguments("build", "publish").build() - - val dependentDir = projectDirectory.resolve("dependent").apply { - mkdirs() - } - - - val dependent = ProjectBuilder.builder().withProjectDir(dependentDir).build() as ProjectInternal - - with(dependent) { - pluginManager.apply(KonanPlugin::class.java) - konanArtifactsContainer.library("bar") - repositories.maven { - it.setUrl(repoDir) - } - dependencies.apply { - add("artifactbar", "test:foo:1.0") - } - } - val model = KonanToolingModelBuilder.buildAll("konanModel", dependent) - assertEquals(1, model.artifacts.size, "Incorrect number of artifacts.") - val libraries = model.artifacts[0].libraries - assertEquals(1, libraries.size, "Incorrect number of libraries.") - val library = libraries[0].name - assertEquals("foo.klib", library, "Incorrect library name.") - } - -} From a5cce930b1196bf79d09c1f85debeb99c8978aa7 Mon Sep 17 00:00:00 2001 From: Ilya Matveev Date: Thu, 28 Jan 2021 19:01:46 +0700 Subject: [PATCH 191/212] [samples] Correct architecture for CocoaPods sample --- kotlin-native/samples/cocoapods/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kotlin-native/samples/cocoapods/build.sh b/kotlin-native/samples/cocoapods/build.sh index 322e9cf4ba3..b45ef89fac5 100755 --- a/kotlin-native/samples/cocoapods/build.sh +++ b/kotlin-native/samples/cocoapods/build.sh @@ -23,4 +23,4 @@ fi pod --project-directory="$IOS_DIR" install # Run Xcode to build the app. -xcodebuild -sdk iphonesimulator -arch arm64 -configuration Release -workspace "$IOS_DIR/ios-app.xcworkspace" -scheme ios-app +xcodebuild -sdk iphonesimulator -arch x86_64 -configuration Release -workspace "$IOS_DIR/ios-app.xcworkspace" -scheme ios-app From 51f70254f740f6aa2caf00b8d0827a4e524f9957 Mon Sep 17 00:00:00 2001 From: Alexander Shabalin Date: Fri, 29 Jan 2021 10:49:59 +0300 Subject: [PATCH 192/212] Use non-terminating TODO for safepoints (#4659) --- kotlin-native/runtime/src/mm/cpp/Stubs.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kotlin-native/runtime/src/mm/cpp/Stubs.cpp b/kotlin-native/runtime/src/mm/cpp/Stubs.cpp index adcd91db5e2..b2c2dabc5fe 100644 --- a/kotlin-native/runtime/src/mm/cpp/Stubs.cpp +++ b/kotlin-native/runtime/src/mm/cpp/Stubs.cpp @@ -103,15 +103,15 @@ ForeignRefContext InitLocalForeignRef(ObjHeader* object) { } RUNTIME_NOTHROW void Kotlin_mm_safePointFunctionEpilogue() { - TODO(); + // TODO: Unimplemented } RUNTIME_NOTHROW void Kotlin_mm_safePointWhileLoopBody() { - TODO(); + // TODO: Unimplemented } RUNTIME_NOTHROW void Kotlin_mm_safePointExceptionUnwind() { - TODO(); + // TODO: Unimplemented } } // extern "C" From e2280ce8557f30ae64ad3212e1589b3d488b661b Mon Sep 17 00:00:00 2001 From: Alexander Shabalin Date: Fri, 29 Jan 2021 10:50:25 +0300 Subject: [PATCH 193/212] Add a bunch of symbols required by Kotlin runtime part (#4655) --- kotlin-native/runtime/src/main/cpp/Memory.h | 21 ++++++++ .../kotlin/native/concurrent/MutableData.kt | 8 ++- kotlin-native/runtime/src/mm/cpp/Memory.cpp | 36 +++++++++++++ kotlin-native/runtime/src/mm/cpp/Stubs.cpp | 52 +++++++++++++++++++ 4 files changed, 115 insertions(+), 2 deletions(-) diff --git a/kotlin-native/runtime/src/main/cpp/Memory.h b/kotlin-native/runtime/src/main/cpp/Memory.h index 5d1fe431a4a..dd5e7067212 100644 --- a/kotlin-native/runtime/src/main/cpp/Memory.h +++ b/kotlin-native/runtime/src/main/cpp/Memory.h @@ -220,6 +220,7 @@ void SetHeapRefLocked(ObjHeader** location, ObjHeader* newValue, int32_t* spinlo int32_t* cookie) RUNTIME_NOTHROW; // Reads reference with taken lock. OBJ_GETTER(ReadHeapRefLocked, ObjHeader** location, int32_t* spinlock, int32_t* cookie) RUNTIME_NOTHROW; +OBJ_GETTER(ReadHeapRefNoLock, ObjHeader* object, int32_t index); // Called on frame enter, if it has object slots. void EnterFrame(ObjHeader** start, int parameters, int count) RUNTIME_NOTHROW; // Called on frame leave, if it has object slots. @@ -257,7 +258,27 @@ void GC_RegisterWorker(void* worker) RUNTIME_NOTHROW; void GC_UnregisterWorker(void* worker) RUNTIME_NOTHROW; void GC_CollectorCallback(void* worker) RUNTIME_NOTHROW; +void Kotlin_native_internal_GC_collect(ObjHeader*); +void Kotlin_native_internal_GC_collectCyclic(ObjHeader*); +void Kotlin_native_internal_GC_suspend(ObjHeader*); +void Kotlin_native_internal_GC_resume(ObjHeader*); +void Kotlin_native_internal_GC_stop(ObjHeader*); +void Kotlin_native_internal_GC_start(ObjHeader*); +void Kotlin_native_internal_GC_setThreshold(ObjHeader*, int32_t value); +int32_t Kotlin_native_internal_GC_getThreshold(ObjHeader*); +void Kotlin_native_internal_GC_setCollectCyclesThreshold(ObjHeader*, int64_t value); +int64_t Kotlin_native_internal_GC_getCollectCyclesThreshold(ObjHeader*); +void Kotlin_native_internal_GC_setThresholdAllocations(ObjHeader*, int64_t value); +int64_t Kotlin_native_internal_GC_getThresholdAllocations(ObjHeader*); +void Kotlin_native_internal_GC_setTuneThreshold(ObjHeader*, int32_t value); +bool Kotlin_native_internal_GC_getTuneThreshold(ObjHeader*); +OBJ_GETTER(Kotlin_native_internal_GC_detectCycles, ObjHeader*); +OBJ_GETTER(Kotlin_native_internal_GC_findCycle, ObjHeader*, ObjHeader* root); +bool Kotlin_native_internal_GC_getCyclicCollector(ObjHeader* gc); +void Kotlin_native_internal_GC_setCyclicCollector(ObjHeader* gc, bool value); + bool Kotlin_Any_isShareable(ObjHeader* thiz); +void Kotlin_Any_share(ObjHeader* thiz); void PerformFullGC(MemoryState* memory) RUNTIME_NOTHROW; bool TryAddHeapRef(const ObjHeader* object); diff --git a/kotlin-native/runtime/src/main/kotlin/kotlin/native/concurrent/MutableData.kt b/kotlin-native/runtime/src/main/kotlin/kotlin/native/concurrent/MutableData.kt index 5f17ff70695..e097f883df3 100644 --- a/kotlin-native/runtime/src/main/kotlin/kotlin/native/concurrent/MutableData.kt +++ b/kotlin-native/runtime/src/main/kotlin/kotlin/native/concurrent/MutableData.kt @@ -31,7 +31,11 @@ public class MutableData constructor(capacity: Int = 16) { private var buffer_ = ByteArray(capacity).apply { share() } private var buffer: ByteArray - get() = readHeapRefNoLock(this, 0) as ByteArray + get() = + when (kotlin.native.Platform.memoryModel) { + kotlin.native.MemoryModel.EXPERIMENTAL -> buffer_ + else -> readHeapRefNoLock(this, 0) as ByteArray + } set(value) { buffer_ = value} private var size_ = 0 private val lock = Lock() @@ -130,4 +134,4 @@ public class MutableData constructor(capacity: Int = 16) { public fun withBufferLocked(block: (array: ByteArray, dataSize: Int) -> R) = locked(lock) { block(buffer, size) } -} \ No newline at end of file +} diff --git a/kotlin-native/runtime/src/mm/cpp/Memory.cpp b/kotlin-native/runtime/src/mm/cpp/Memory.cpp index 75a76239c1b..0ea354c650f 100644 --- a/kotlin-native/runtime/src/mm/cpp/Memory.cpp +++ b/kotlin-native/runtime/src/mm/cpp/Memory.cpp @@ -142,6 +142,11 @@ extern "C" RUNTIME_NOTHROW void InitAndRegisterGlobal(ObjHeader** location, cons extern "C" const MemoryModel CurrentMemoryModel = MemoryModel::kExperimental; +extern "C" OBJ_GETTER(ReadHeapRefNoLock, ObjHeader* object, int32_t index) { + // TODO: Remove when legacy MM is gone. + ThrowNotImplementedError(); +} + extern "C" RUNTIME_NOTHROW void EnterFrame(ObjHeader** start, int parameters, int count) { auto* threadData = mm::ThreadRegistry::Instance().CurrentThreadData(); threadData->shadowStack().EnterFrame(start, parameters, count); @@ -183,11 +188,42 @@ extern "C" RUNTIME_NOTHROW void GC_CollectorCallback(void* worker) { // Nothing to do } +extern "C" void Kotlin_native_internal_GC_collectCyclic(ObjHeader*) { + // TODO: Remove when legacy MM is gone. + ThrowIllegalArgumentException(); +} + +extern "C" OBJ_GETTER(Kotlin_native_internal_GC_detectCycles, ObjHeader*) { + // TODO: Remove when legacy MM is gone. + RETURN_OBJ(nullptr); +} + +extern "C" OBJ_GETTER(Kotlin_native_internal_GC_findCycle, ObjHeader*, ObjHeader* root) { + // TODO: Remove when legacy MM is gone. + RETURN_OBJ(nullptr); +} + +extern "C" bool Kotlin_native_internal_GC_getCyclicCollector(ObjHeader* gc) { + // TODO: Remove when legacy MM is gone. + return false; +} + +extern "C" void Kotlin_native_internal_GC_setCyclicCollector(ObjHeader* gc, bool value) { + // TODO: Remove when legacy MM is gone. + if (value) + ThrowIllegalArgumentException(); +} + extern "C" bool Kotlin_Any_isShareable(ObjHeader* thiz) { // TODO: Remove when legacy MM is gone. return true; } +extern "C" void Kotlin_Any_share(ObjHeader* thiz) { + // TODO: Remove when legacy MM is gone. + // Nothing to do +} + extern "C" RUNTIME_NOTHROW bool ClearSubgraphReferences(ObjHeader* root, bool checked) { // TODO: Remove when legacy MM is gone. return true; diff --git a/kotlin-native/runtime/src/mm/cpp/Stubs.cpp b/kotlin-native/runtime/src/mm/cpp/Stubs.cpp index b2c2dabc5fe..cf53f4f8b73 100644 --- a/kotlin-native/runtime/src/mm/cpp/Stubs.cpp +++ b/kotlin-native/runtime/src/mm/cpp/Stubs.cpp @@ -82,6 +82,58 @@ void EnsureNeverFrozen(ObjHeader* obj) { TODO(); } +void Kotlin_native_internal_GC_collect(ObjHeader*) { + TODO(); +} + +void Kotlin_native_internal_GC_suspend(ObjHeader*) { + TODO(); +} + +void Kotlin_native_internal_GC_resume(ObjHeader*) { + TODO(); +} + +void Kotlin_native_internal_GC_stop(ObjHeader*) { + TODO(); +} + +void Kotlin_native_internal_GC_start(ObjHeader*) { + TODO(); +} + +void Kotlin_native_internal_GC_setThreshold(ObjHeader*, int32_t value) { + TODO(); +} + +int32_t Kotlin_native_internal_GC_getThreshold(ObjHeader*) { + TODO(); +} + +void Kotlin_native_internal_GC_setCollectCyclesThreshold(ObjHeader*, int64_t value) { + TODO(); +} + +int64_t Kotlin_native_internal_GC_getCollectCyclesThreshold(ObjHeader*) { + TODO(); +} + +void Kotlin_native_internal_GC_setThresholdAllocations(ObjHeader*, int64_t value) { + TODO(); +} + +int64_t Kotlin_native_internal_GC_getThresholdAllocations(ObjHeader*) { + TODO(); +} + +void Kotlin_native_internal_GC_setTuneThreshold(ObjHeader*, int32_t value) { + TODO(); +} + +bool Kotlin_native_internal_GC_getTuneThreshold(ObjHeader*) { + TODO(); +} + RUNTIME_NOTHROW void PerformFullGC(MemoryState* memory) { TODO(); } From d84c83d7da09f40028bd4ab776db1f5adefcfb12 Mon Sep 17 00:00:00 2001 From: Alexander Shabalin Date: Fri, 29 Jan 2021 10:51:13 +0300 Subject: [PATCH 194/212] Extract FreezeHooks and make them testable (#4654) --- .../kotlin/backend/konan/KonanFqNames.kt | 1 + .../backend/konan/llvm/RTTIGenerator.kt | 5 ++ .../kotlin/bitcode/CompileToBitcode.kt | 2 + .../kotlin/testing/native/NativeTest.kt | 2 +- .../runtime/src/legacymm/cpp/Memory.cpp | 10 +--- .../runtime/src/main/cpp/FreezeHooks.cpp | 42 ++++++++++++++++ .../runtime/src/main/cpp/FreezeHooks.hpp | 21 ++++++++ .../runtime/src/main/cpp/FreezeHooksTest.cpp | 48 +++++++++++++++++++ .../src/main/cpp/FreezeHooksTestSupport.cpp | 30 ++++++++++++ .../src/main/cpp/FreezeHooksTestSupport.hpp | 29 +++++++++++ kotlin-native/runtime/src/main/cpp/TypeInfo.h | 1 + .../native/concurrent/WorkerBoundReference.kt | 1 + .../kotlin/native/internal/Annotations.kt | 6 +++ 13 files changed, 189 insertions(+), 9 deletions(-) create mode 100644 kotlin-native/runtime/src/main/cpp/FreezeHooks.cpp create mode 100644 kotlin-native/runtime/src/main/cpp/FreezeHooks.hpp create mode 100644 kotlin-native/runtime/src/main/cpp/FreezeHooksTest.cpp create mode 100644 kotlin-native/runtime/src/main/cpp/FreezeHooksTestSupport.cpp create mode 100644 kotlin-native/runtime/src/main/cpp/FreezeHooksTestSupport.hpp diff --git a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanFqNames.kt b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanFqNames.kt index 0ec960f9c12..b4e33339db6 100644 --- a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanFqNames.kt +++ b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/KonanFqNames.kt @@ -31,4 +31,5 @@ object KonanFqNames { val typedIntrinsic = FqName("kotlin.native.internal.TypedIntrinsic") val objCMethod = FqName("kotlinx.cinterop.ObjCMethod") val hasFinalizer = FqName("kotlin.native.internal.HasFinalizer") + val hasFreezeHook = FqName("kotlin.native.internal.HasFreezeHook") } diff --git a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/RTTIGenerator.kt b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/RTTIGenerator.kt index 502f9974249..fc4b3cceefc 100644 --- a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/RTTIGenerator.kt +++ b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/llvm/RTTIGenerator.kt @@ -75,6 +75,10 @@ internal class RTTIGenerator(override val context: Context) : ContextUtils { result = result or TF_HAS_FINALIZER } + if (irClass.hasAnnotation(KonanFqNames.hasFreezeHook)) { + result = result or TF_HAS_FREEZE_HOOK + } + return result } @@ -638,4 +642,5 @@ private const val TF_OBJC_DYNAMIC = 8 private const val TF_LEAK_DETECTOR_CANDIDATE = 16 private const val TF_SUSPEND_FUNCTION = 32 private const val TF_HAS_FINALIZER = 64 +private const val TF_HAS_FREEZE_HOOK = 128 diff --git a/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/bitcode/CompileToBitcode.kt b/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/bitcode/CompileToBitcode.kt index 1ef5d444f5b..c992c6e0ae3 100644 --- a/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/bitcode/CompileToBitcode.kt +++ b/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/bitcode/CompileToBitcode.kt @@ -33,7 +33,9 @@ open class CompileToBitcode @Inject constructor( val linkerArgs = mutableListOf() var excludeFiles: List = listOf( "**/*Test.cpp", + "**/*TestSupport.cpp", "**/*Test.mm", + "**/*TestSupport.mm", ) var includeFiles: List = listOf( "**/*.cpp", diff --git a/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/testing/native/NativeTest.kt b/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/testing/native/NativeTest.kt index 3c0a4c1c376..07348aece33 100644 --- a/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/testing/native/NativeTest.kt +++ b/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/testing/native/NativeTest.kt @@ -206,7 +206,7 @@ private fun createTestTask( ).apply { this.sanitizer = sanitizer excludeFiles = emptyList() - includeFiles = listOf("**/*Test.cpp", "**/*Test.mm") + includeFiles = listOf("**/*Test.cpp", "**/*TestSupport.cpp", "**/*Test.mm", "**/*TestSupport.mm") dependsOn(it) dependsOn("downloadGoogleTest") compilerArgs.addAll(it.compilerArgs) diff --git a/kotlin-native/runtime/src/legacymm/cpp/Memory.cpp b/kotlin-native/runtime/src/legacymm/cpp/Memory.cpp index 1ccd1102d01..8d5b166f42f 100644 --- a/kotlin-native/runtime/src/legacymm/cpp/Memory.cpp +++ b/kotlin-native/runtime/src/legacymm/cpp/Memory.cpp @@ -39,6 +39,7 @@ #include "CyclicCollector.h" #endif // USE_CYCLIC_GC #include "Exceptions.h" +#include "FreezeHooks.hpp" #include "KString.h" #include "Memory.h" #include "MemoryPrivate.hpp" @@ -2861,13 +2862,6 @@ void freezeCyclic(ObjHeader* root, } } -// These hooks are only allowed to modify `obj` subgraph. -void runFreezeHooks(ObjHeader* obj) { - if (obj->type_info() == theWorkerBoundReferenceTypeInfo) { - WorkerBoundReferenceFreezeHook(obj); - } -} - void runFreezeHooksRecursive(ObjHeader* root) { KStdUnorderedSet seen; KStdVector toVisit; @@ -2877,7 +2871,7 @@ void runFreezeHooksRecursive(ObjHeader* root) { KRef obj = toVisit.back(); toVisit.pop_back(); - runFreezeHooks(obj); + kotlin::RunFreezeHooks(obj); traverseReferredObjects(obj, [&seen, &toVisit](ObjHeader* field) { auto wasNotSeenYet = seen.insert(field).second; diff --git a/kotlin-native/runtime/src/main/cpp/FreezeHooks.cpp b/kotlin-native/runtime/src/main/cpp/FreezeHooks.cpp new file mode 100644 index 00000000000..04959ef470f --- /dev/null +++ b/kotlin-native/runtime/src/main/cpp/FreezeHooks.cpp @@ -0,0 +1,42 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the LICENSE file. + */ + +#include "FreezeHooks.hpp" + +#include "Memory.h" +#include "Types.h" +#include "WorkerBoundReference.h" + +using namespace kotlin; + +namespace { + +void (*g_hookOverrideForTesting)(ObjHeader*) = nullptr; + +NO_INLINE void RunFreezeHooksImpl(ObjHeader* object, const TypeInfo* type) noexcept { + if (g_hookOverrideForTesting != nullptr) { + g_hookOverrideForTesting(object); + return; + } + // TODO: Consider some global registration. + if (type == theWorkerBoundReferenceTypeInfo) { + WorkerBoundReferenceFreezeHook(object); + } +} + +} // namespace + +void kotlin::RunFreezeHooks(ObjHeader* object) noexcept { + auto* type = object->type_info(); + if ((type->flags_ & TF_HAS_FREEZE_HOOK) == 0) { + return; + } + // This is a cold path. + RunFreezeHooksImpl(object, type); +} + +void kotlin::SetFreezeHookForTesting(void (*hook)(ObjHeader*)) noexcept { + g_hookOverrideForTesting = hook; +} diff --git a/kotlin-native/runtime/src/main/cpp/FreezeHooks.hpp b/kotlin-native/runtime/src/main/cpp/FreezeHooks.hpp new file mode 100644 index 00000000000..f4e418ba01e --- /dev/null +++ b/kotlin-native/runtime/src/main/cpp/FreezeHooks.hpp @@ -0,0 +1,21 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the LICENSE file. + */ + +#ifndef RUNTIME_MM_FREEZE_HOOKS_H +#define RUNTIME_MM_FREEZE_HOOKS_H + +struct ObjHeader; +struct TypeInfo; + +namespace kotlin { + +// These hooks are only allowed to modify `object` subgraph. +void RunFreezeHooks(ObjHeader* object) noexcept; + +void SetFreezeHookForTesting(void (*hook)(ObjHeader*)) noexcept; + +} // namespace kotlin + +#endif // RUNTIME_MM_FREEZE_HOOKS_H diff --git a/kotlin-native/runtime/src/main/cpp/FreezeHooksTest.cpp b/kotlin-native/runtime/src/main/cpp/FreezeHooksTest.cpp new file mode 100644 index 00000000000..521dfe64828 --- /dev/null +++ b/kotlin-native/runtime/src/main/cpp/FreezeHooksTest.cpp @@ -0,0 +1,48 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the LICENSE file. + */ + +#include "FreezeHooks.hpp" + +#include "gtest/gtest.h" +#include "gmock/gmock.h" + +#include "FreezeHooksTestSupport.hpp" +#include "Memory.h" + +using namespace kotlin; + +using ::testing::_; + +namespace { + +class FreezeHooksTest : public testing::Test { +public: + testing::MockFunction& freezeHook() { return freezeHooks_.freezeHook(); } + +private: + FreezeHooksTestSupport freezeHooks_; +}; + +} // namespace + +TEST_F(FreezeHooksTest, TypeWithFreezeHook) { + TypeInfo type; + type.typeInfo_ = &type; + type.flags_ |= TF_HAS_FREEZE_HOOK; + ObjHeader obj = {&type}; + EXPECT_CALL(freezeHook(), Call(&obj)); + RunFreezeHooks(&obj); + testing::Mock::VerifyAndClearExpectations(&freezeHook()); +} + +TEST_F(FreezeHooksTest, TypeWithoutFreezeHook) { + TypeInfo type; + type.typeInfo_ = &type; + type.flags_ &= ~TF_HAS_FREEZE_HOOK; + ObjHeader obj = {&type}; + EXPECT_CALL(freezeHook(), Call(_)).Times(0); + RunFreezeHooks(&obj); + testing::Mock::VerifyAndClearExpectations(&freezeHook()); +} diff --git a/kotlin-native/runtime/src/main/cpp/FreezeHooksTestSupport.cpp b/kotlin-native/runtime/src/main/cpp/FreezeHooksTestSupport.cpp new file mode 100644 index 00000000000..aaeecc76d4a --- /dev/null +++ b/kotlin-native/runtime/src/main/cpp/FreezeHooksTestSupport.cpp @@ -0,0 +1,30 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the LICENSE file. + */ + +#include "FreezeHooksTestSupport.hpp" + +#include "FreezeHooks.hpp" + +using namespace kotlin; + +namespace { + +testing::MockFunction* g_freezeHook = nullptr; + +void freezeHook(ObjHeader* object) { + g_freezeHook->Call(object); +} + +} // namespace + +kotlin::FreezeHooksTestSupport::FreezeHooksTestSupport() { + g_freezeHook = &freezeHook_; + SetFreezeHookForTesting(&::freezeHook); +} + +kotlin::FreezeHooksTestSupport::~FreezeHooksTestSupport() { + SetFreezeHookForTesting(nullptr); + g_freezeHook = nullptr; +} diff --git a/kotlin-native/runtime/src/main/cpp/FreezeHooksTestSupport.hpp b/kotlin-native/runtime/src/main/cpp/FreezeHooksTestSupport.hpp new file mode 100644 index 00000000000..cf88e86fdfb --- /dev/null +++ b/kotlin-native/runtime/src/main/cpp/FreezeHooksTestSupport.hpp @@ -0,0 +1,29 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the LICENSE file. + */ + +#ifndef RUNTIME_MM_FREEZE_HOOKS_TEST_SUPPORT_H +#define RUNTIME_MM_FREEZE_HOOKS_TEST_SUPPORT_H + +#include "gtest/gtest.h" +#include "gmock/gmock.h" + +struct ObjHeader; + +namespace kotlin { + +class FreezeHooksTestSupport { +public: + FreezeHooksTestSupport(); + ~FreezeHooksTestSupport(); + + testing::MockFunction& freezeHook() { return freezeHook_; } + +private: + testing::StrictMock> freezeHook_; +}; + +} // namespace kotlin + +#endif // RUNTIME_MM_FREEZE_HOOKS_TEST_SUPPORT_H diff --git a/kotlin-native/runtime/src/main/cpp/TypeInfo.h b/kotlin-native/runtime/src/main/cpp/TypeInfo.h index ef3c302f6fd..69200b72a79 100644 --- a/kotlin-native/runtime/src/main/cpp/TypeInfo.h +++ b/kotlin-native/runtime/src/main/cpp/TypeInfo.h @@ -63,6 +63,7 @@ enum Konan_TypeFlags { TF_LEAK_DETECTOR_CANDIDATE = 1 << 4, TF_SUSPEND_FUNCTION = 1 << 5, TF_HAS_FINALIZER = 1 << 6, + TF_HAS_FREEZE_HOOK = 1 << 7, }; // Flags per object instance. diff --git a/kotlin-native/runtime/src/main/kotlin/kotlin/native/concurrent/WorkerBoundReference.kt b/kotlin-native/runtime/src/main/kotlin/kotlin/native/concurrent/WorkerBoundReference.kt index 7ac382a321f..c1d5ef010d6 100644 --- a/kotlin-native/runtime/src/main/kotlin/kotlin/native/concurrent/WorkerBoundReference.kt +++ b/kotlin-native/runtime/src/main/kotlin/kotlin/native/concurrent/WorkerBoundReference.kt @@ -29,6 +29,7 @@ external private fun describeWorkerBoundReference(ref: NativePtr): String @NoReorderFields @ExportTypeInfo("theWorkerBoundReferenceTypeInfo") @HasFinalizer +@HasFreezeHook public class WorkerBoundReference(value: T) { private var ptr = NativePtr.NULL diff --git a/kotlin-native/runtime/src/main/kotlin/kotlin/native/internal/Annotations.kt b/kotlin-native/runtime/src/main/kotlin/kotlin/native/internal/Annotations.kt index 90e60161a18..bb18ed0132a 100644 --- a/kotlin-native/runtime/src/main/kotlin/kotlin/native/internal/Annotations.kt +++ b/kotlin-native/runtime/src/main/kotlin/kotlin/native/internal/Annotations.kt @@ -145,3 +145,9 @@ internal annotation class HasFinalizer @RequiresOptIn(level = RequiresOptIn.Level.ERROR) @Retention(value = AnnotationRetention.BINARY) internal annotation class InternalForKotlinNative + +/** + * Marks a class that has a freeze hook. + */ +@Target(AnnotationTarget.CLASS) +internal annotation class HasFreezeHook \ No newline at end of file From f887dcb79ac44372bcd6c89fe4528209c7eb1b36 Mon Sep 17 00:00:00 2001 From: Vasily Levchenko Date: Thu, 28 Jan 2021 16:09:44 +0100 Subject: [PATCH 195/212] [interop][c][reverse] drop extensions check in function generator (KT-36639) - Initially this check was done with assumption that extension function couldn't be overrided --- .../src/org/jetbrains/kotlin/backend/konan/CAdapterGenerator.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/CAdapterGenerator.kt b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/CAdapterGenerator.kt index 1c2a88efdb8..5e74fb8b6c3 100644 --- a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/CAdapterGenerator.kt +++ b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/CAdapterGenerator.kt @@ -214,7 +214,7 @@ private class ExportedElement(val kind: ElementKind, cname = "_konan_function_${owner.nextFunctionIndex()}" val llvmFunction = owner.codegen.llvmFunction(irFunction) // If function is virtual, we need to resolve receiver properly. - val bridge = if (!DescriptorUtils.isTopLevelDeclaration(function) && !function.isExtension && + val bridge = if (!DescriptorUtils.isTopLevelDeclaration(function) && irFunction.isOverridable) { // We need LLVMGetElementType() as otherwise type is function pointer. generateFunction(owner.codegen, LLVMGetElementType(llvmFunction.type)!!, cname) { From 3378aeddb5c1046e981c4163585efd0f152a6915 Mon Sep 17 00:00:00 2001 From: Vasily Levchenko Date: Thu, 28 Jan 2021 16:42:38 +0100 Subject: [PATCH 196/212] [interop][c][reverse][test] (KT-36639) --- .../backend.native/tests/build.gradle | 13 +++++++++ .../tests/produce_dynamic/kt-36639/main.c | 28 +++++++++++++++++++ .../tests/produce_dynamic/kt-36639/main.kt | 21 ++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 kotlin-native/backend.native/tests/produce_dynamic/kt-36639/main.c create mode 100644 kotlin-native/backend.native/tests/produce_dynamic/kt-36639/main.kt diff --git a/kotlin-native/backend.native/tests/build.gradle b/kotlin-native/backend.native/tests/build.gradle index edf0aa019ea..b6103d957d6 100644 --- a/kotlin-native/backend.native/tests/build.gradle +++ b/kotlin-native/backend.native/tests/build.gradle @@ -4367,6 +4367,19 @@ dynamicTest("produce_dynamic") { "Error handler: kotlin.Error: Expected error\n" } +dynamicTest("kt36639") { + disabled = (project.target.name != project.hostName) + source = "produce_dynamic/kt-36639/main.kt" + cSource = "$projectDir/produce_dynamic/kt-36639/main.c" + goldValue = """|CFoo1::extfoo + |CFoo1::extfoo + |CFoo2::extfoo + |CFoo2::extfoo + |Int::extfoo + |Int::extfoo + |""".stripMargin() +} + dynamicTest("interop_concurrentRuntime") { disabled = (project.target.name != project.hostName) disabled = true // KT-43180 diff --git a/kotlin-native/backend.native/tests/produce_dynamic/kt-36639/main.c b/kotlin-native/backend.native/tests/produce_dynamic/kt-36639/main.c new file mode 100644 index 00000000000..b2236dbc277 --- /dev/null +++ b/kotlin-native/backend.native/tests/produce_dynamic/kt-36639/main.c @@ -0,0 +1,28 @@ +#include "testlib_api.h" + +#define __ testlib_symbols()-> +#define T_(x) testlib_kref_ ## x + + +int +main() { + T_(CFoo1) foo1 = __ kotlin.root.CFoo1.CFoo1(); + T_(CFoo2) foo2 = __ kotlin.root.CFoo2.CFoo2(); + T_(kotlin_Int) intV = __ createNullableInt(42); + T_(kotlin_Any) any; + T_(Foo) foo = { .pinned = foo1.pinned }; + + any.pinned = foo1.pinned; + __ kotlin.root.CFoo1.callMe(foo1, any); + __ kotlin.root.Foo.extfoo(foo, any); + any.pinned = foo2.pinned; + __ kotlin.root.CFoo1.callMe(foo1, any); + __ kotlin.root.Foo.extfoo(foo, any); + any.pinned = intV.pinned; + __ kotlin.root.CFoo1.callMe(foo1, any); + __ kotlin.root.Foo.extfoo(foo, any); + + __ DisposeStablePointer(foo1.pinned); + __ DisposeStablePointer(foo2.pinned); + __ DisposeStablePointer(intV.pinned); +} diff --git a/kotlin-native/backend.native/tests/produce_dynamic/kt-36639/main.kt b/kotlin-native/backend.native/tests/produce_dynamic/kt-36639/main.kt new file mode 100644 index 00000000000..236d1337aa2 --- /dev/null +++ b/kotlin-native/backend.native/tests/produce_dynamic/kt-36639/main.kt @@ -0,0 +1,21 @@ +interface Foo { + fun Any.extfoo() +} + +class CFoo1:Foo { + override fun Any.extfoo() { + when(this) { + is CFoo1 -> println("CFoo1::extfoo") + is CFoo2 -> println("CFoo2::extfoo") + is Int -> println("Int::extfoo") + } + } + + fun callMe(arg: Any) = arg.extfoo() +} + +class CFoo2:Foo { + override fun Any.extfoo() { + TODO("Not yet implemented") + } +} \ No newline at end of file From 95a92d865efe49cd005a41daf8d66e9f2ef01769 Mon Sep 17 00:00:00 2001 From: Pavel Punegov Date: Thu, 28 Jan 2021 21:03:17 +0300 Subject: [PATCH 197/212] Adds workaround for IDEA-257366 --- kotlin-native/shared/buildSrc/settings.gradle | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 kotlin-native/shared/buildSrc/settings.gradle diff --git a/kotlin-native/shared/buildSrc/settings.gradle b/kotlin-native/shared/buildSrc/settings.gradle new file mode 100644 index 00000000000..6f551606569 --- /dev/null +++ b/kotlin-native/shared/buildSrc/settings.gradle @@ -0,0 +1,4 @@ +// workaround for https://youtrack.jetbrains.com/issue/IDEA-257366 +if (gradle.startParameter.projectDir?.name == 'buildSrc') { + gradle.startParameter.setIncludedBuilds(new ArrayList()) +} \ No newline at end of file From c8633d8bdae7ea9f1b70a37843e98a900f3475c5 Mon Sep 17 00:00:00 2001 From: Igor Chevdar Date: Thu, 14 Jan 2021 19:07:48 +0500 Subject: [PATCH 198/212] [runtime] Vectorized polynomial hash for strings This is for consistency with Kotlin/JVM --- .../runtime/src/main/cpp/KString.cpp | 7 +- .../src/main/cpp/polyhash/PolyHash.cpp | 19 ++ .../runtime/src/main/cpp/polyhash/PolyHash.h | 14 ++ .../src/main/cpp/polyhash/PolyHashTest.cpp | 27 +++ .../runtime/src/main/cpp/polyhash/arm.cpp | 115 ++++++++++ .../runtime/src/main/cpp/polyhash/arm.h | 11 + .../runtime/src/main/cpp/polyhash/common.h | 201 ++++++++++++++++++ .../runtime/src/main/cpp/polyhash/naive.h | 18 ++ .../runtime/src/main/cpp/polyhash/x86.cpp | 166 +++++++++++++++ .../runtime/src/main/cpp/polyhash/x86.h | 11 + 10 files changed, 585 insertions(+), 4 deletions(-) create mode 100644 kotlin-native/runtime/src/main/cpp/polyhash/PolyHash.cpp create mode 100644 kotlin-native/runtime/src/main/cpp/polyhash/PolyHash.h create mode 100644 kotlin-native/runtime/src/main/cpp/polyhash/PolyHashTest.cpp create mode 100644 kotlin-native/runtime/src/main/cpp/polyhash/arm.cpp create mode 100644 kotlin-native/runtime/src/main/cpp/polyhash/arm.h create mode 100644 kotlin-native/runtime/src/main/cpp/polyhash/common.h create mode 100644 kotlin-native/runtime/src/main/cpp/polyhash/naive.h create mode 100644 kotlin-native/runtime/src/main/cpp/polyhash/x86.cpp create mode 100644 kotlin-native/runtime/src/main/cpp/polyhash/x86.h diff --git a/kotlin-native/runtime/src/main/cpp/KString.cpp b/kotlin-native/runtime/src/main/cpp/KString.cpp index bcfcedd7628..3f96007b706 100644 --- a/kotlin-native/runtime/src/main/cpp/KString.cpp +++ b/kotlin-native/runtime/src/main/cpp/KString.cpp @@ -28,6 +28,8 @@ #include "utf8.h" +#include "polyhash/PolyHash.h" + namespace { typedef std::back_insert_iterator KStdStringInserter; @@ -1165,10 +1167,7 @@ KInt Kotlin_String_lastIndexOfString(KString thiz, KString other, KInt fromIndex KInt Kotlin_String_hashCode(KString thiz) { // TODO: consider caching strings hashes. - // TODO: maybe use some simpler hashing algorithm? - // Note that we don't use Java's string hash. - return CityHash64( - CharArrayAddressOfElementAt(thiz, 0), thiz->count_ * sizeof(KChar)); + return polyHash(thiz->count_, CharArrayAddressOfElementAt(thiz, 0)); } const KChar* Kotlin_String_utf16pointer(KString message) { diff --git a/kotlin-native/runtime/src/main/cpp/polyhash/PolyHash.cpp b/kotlin-native/runtime/src/main/cpp/polyhash/PolyHash.cpp new file mode 100644 index 00000000000..194c27fb856 --- /dev/null +++ b/kotlin-native/runtime/src/main/cpp/polyhash/PolyHash.cpp @@ -0,0 +1,19 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the LICENSE file. + */ + +#include "polyhash/PolyHash.h" +#include "polyhash/naive.h" +#include "polyhash/x86.h" +#include "polyhash/arm.h" + +int polyHash(int length, uint16_t const* str) { +#if defined(__x86_64__) or defined(__i386__) + return polyHash_x86(length, str); +#elif defined(__arm__) or defined(__aarch64__) + return polyHash_arm(length, str); +#else + return polyHash_naive(length, str); +#endif +} \ No newline at end of file diff --git a/kotlin-native/runtime/src/main/cpp/polyhash/PolyHash.h b/kotlin-native/runtime/src/main/cpp/polyhash/PolyHash.h new file mode 100644 index 00000000000..b9bcf48d0c3 --- /dev/null +++ b/kotlin-native/runtime/src/main/cpp/polyhash/PolyHash.h @@ -0,0 +1,14 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the LICENSE file. + */ + +#ifndef RUNTIME_POLYHASH_H +#define RUNTIME_POLYHASH_H + +#include + +// Computes polynomial hash with base = 31. +int polyHash(int length, uint16_t const* str); + +#endif // RUNTIME_POLYHASH_H diff --git a/kotlin-native/runtime/src/main/cpp/polyhash/PolyHashTest.cpp b/kotlin-native/runtime/src/main/cpp/polyhash/PolyHashTest.cpp new file mode 100644 index 00000000000..ca2e7afb804 --- /dev/null +++ b/kotlin-native/runtime/src/main/cpp/polyhash/PolyHashTest.cpp @@ -0,0 +1,27 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the LICENSE file. + */ + +#include "polyhash/PolyHash.h" +#include "polyhash/naive.h" + +#include "gmock/gmock.h" +#include "gtest/gtest.h" + +namespace { + +TEST(PolyHashTest, Correctness) { + const int maxLength = 10000; + uint16_t str[maxLength + 100]; + for (int k = 1; k <= maxLength; ++k) { + for (int i = 0; i < k; ++i) + str[i] = k * maxLength + i; + str[k] = 0; + + for (int shift = 0; shift < 8 && k - shift > 0; ++shift) + EXPECT_EQ(polyHash_naive(k - shift, str + shift), polyHash(k - shift, str + shift)); + } +} + +} \ No newline at end of file diff --git a/kotlin-native/runtime/src/main/cpp/polyhash/arm.cpp b/kotlin-native/runtime/src/main/cpp/polyhash/arm.cpp new file mode 100644 index 00000000000..1e194af701f --- /dev/null +++ b/kotlin-native/runtime/src/main/cpp/polyhash/arm.cpp @@ -0,0 +1,115 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the LICENSE file. + */ + +#include "polyhash/common.h" +#include "polyhash/arm.h" + +#if defined(__arm__) or defined(__aarch64__) + +#ifndef __ARM_NEON + +int polyHash_arm(int length, uint16_t const* str) { + return polyHash_naive(length, str); +} + +#else + +#include + +namespace { + +alignas(32) constexpr auto p32 = DecreasingPowers<32>(31); // [base^31, base^30, .., base^2, base, 1] +alignas(32) constexpr auto b32 = RepeatingPowers<8>(31, 32); // [base^32, base^32, .., base^32] (8) +alignas(32) constexpr auto b16 = RepeatingPowers<8>(31, 16); // [base^16, base^16, .., base^16] (8) +alignas(32) constexpr auto b8 = RepeatingPowers<8>(31, 8); // [base^8, base^8, .., base^8 ] (8) +alignas(32) constexpr auto b4 = RepeatingPowers<8>(31, 4); // [base^4, base^4, .., base^4 ] (8) + +struct NeonTraits { + using VecType = uint32x4_t; + using Vec128Type = uint32x4_t; + using U16VecType = uint16x4_t; + + ALWAYS_INLINE static VecType initVec() { return vdupq_n_u32(0); } + ALWAYS_INLINE static Vec128Type initVec128() { return vdupq_n_u32(0); } + ALWAYS_INLINE static int vec128toInt(Vec128Type x) { return vgetq_lane_u32(x, 0); } + ALWAYS_INLINE static VecType u16Load(U16VecType x) { return vmovl_u16(x); } + ALWAYS_INLINE static Vec128Type vec128Mul(Vec128Type x, Vec128Type y) { return vmulq_u32(x, y); } + ALWAYS_INLINE static Vec128Type vec128Add(Vec128Type x, Vec128Type y) { return vaddq_u32(x, y); } + ALWAYS_INLINE static VecType vecMul(VecType x, VecType y) { return vmulq_u32(x, y); } + ALWAYS_INLINE static VecType vecAdd(VecType x, VecType y) { return vaddq_u32(x, y); } + ALWAYS_INLINE static Vec128Type squash2(VecType x, VecType y) { + return squash1(vaddq_u32(x, y)); // [x0 + y0, x1 + y1, x2 + y2, x3 + y3] + } + + ALWAYS_INLINE static uint32x4_t squash1(uint32x4_t z) { + #ifdef __aarch64__ + return vdupq_n_u32(vaddvq_u32(z)); // [z0..3, same, same, same] + #else + uint32x2_t lo = vget_low_u32(z); // [z0, z1] + uint32x2_t hi = vget_high_u32(z); // [z2, z3] + uint32x2_t sum = vadd_u32(lo, hi); // [z0 + z2, z1 + z3] + sum = vpadd_u32(sum, sum); // [z0..3, same] + return vcombine_u32(sum, sum); // [z0..3, same, same, same] + #endif + }; + + static int polyHashUnalignedUnrollUpTo16(int n, uint16_t const* str) { + Vec128Type res = initVec128(); + + polyHashUnroll4(n, str, res, &b16[0], &p32[16]); + polyHashUnroll2(n, str, res, &b8[0], &p32[24]); + polyHashTail(n, str, res, &b4[0], &p32[28]); + + return vec128toInt(res); + } + + static int polyHashUnalignedUnrollUpTo32(int n, uint16_t const* str) { + Vec128Type res = initVec128(); + + polyHashUnroll8(n, str, res, &b32[0], &p32[0]); + polyHashUnroll4(n, str, res, &b16[0], &p32[16]); + polyHashUnroll2(n, str, res, &b8[0], &p32[24]); + polyHashTail(n, str, res, &b4[0], &p32[28]); + + return vec128toInt(res); + } +}; + +#if defined(__aarch64__) + const bool neonSupported = true; // AArch64 always supports Neon. +#elif defined(__ANDROID__) + #include + const bool neonSupported = android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON; +#elif defined(__APPLE__) + const bool neonSupported = true; // It is supported starting from iPhone 3GS. +#elif defined(__linux__) or defined(__unix__) + #include + #include + const bool neonSupported = getauxval(AT_HWCAP) & HWCAP_NEON; +#else + #error "Not supported" +#endif + +} + +int polyHash_arm(int length, uint16_t const* str) { + if (!neonSupported) { + // Vectorization is not supported. + return polyHash_naive(length, str); + } + int res; + if (length < 488) + res = NeonTraits::polyHashUnalignedUnrollUpTo16(length / 4, str); + else + res = NeonTraits::polyHashUnalignedUnrollUpTo32(length / 4, str); + // Handle the tail naively. + for (int i = length & 0xFFFFFFFC; i < length; ++i) + res = res * 31 + str[i]; + return res; +} + +#endif // __ARM_NEON + +#endif // defined(__arm__) or defined(__aarch64__) \ No newline at end of file diff --git a/kotlin-native/runtime/src/main/cpp/polyhash/arm.h b/kotlin-native/runtime/src/main/cpp/polyhash/arm.h new file mode 100644 index 00000000000..919b76a8d94 --- /dev/null +++ b/kotlin-native/runtime/src/main/cpp/polyhash/arm.h @@ -0,0 +1,11 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the LICENSE file. + */ + +#ifndef RUNTIME_POLYHASH_ARM_H +#define RUNTIME_POLYHASH_ARM_H + +int polyHash_arm(int length, uint16_t const* str); + +#endif // RUNTIME_POLYHASH_ARM_H diff --git a/kotlin-native/runtime/src/main/cpp/polyhash/common.h b/kotlin-native/runtime/src/main/cpp/polyhash/common.h new file mode 100644 index 00000000000..5ed9302dbdc --- /dev/null +++ b/kotlin-native/runtime/src/main/cpp/polyhash/common.h @@ -0,0 +1,201 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the LICENSE file. + */ + +#ifndef RUNTIME_POLYHASH_COMMON_H +#define RUNTIME_POLYHASH_COMMON_H + +#include +#include +#include "polyhash/naive.h" +#include "../Common.h" + +constexpr uint32_t Power(uint32_t base, uint8_t exponent) { + uint32_t result = 1; + for (uint8_t i = 0; i < exponent; ++i) { + result *= base; + } + return result; +} + +template +constexpr std::array DecreasingPowers(uint32_t base) { + std::array result = {}; + uint32_t current = 1; + for (auto it = result.rbegin(); it != result.rend(); ++it) { + *it = current; + current *= base; + } + return result; +} + +template +constexpr std::array RepeatingPowers(uint32_t base, uint8_t exponent) { + std::array result = {}; + uint32_t value = Power(base, exponent); + for (auto& element : result) + element = value; + return result; +} + +#if defined(__x86_64__) or defined(__i386__) +#pragma clang attribute push (__attribute__((target("avx2"))), apply_to=function) +#endif + +template +ALWAYS_INLINE void polyHashTail(int& n, uint16_t const*& str, typename Traits::Vec128Type& res, uint32_t const* b, uint32_t const* p) { + using VecType = typename Traits::VecType; + using Vec128Type = typename Traits::Vec128Type; + using U16VecType = typename Traits::U16VecType; + + const int vecLength = sizeof(VecType) / 4; + if (n < vecLength / 4) return; + + VecType x = Traits::u16Load(*reinterpret_cast(str)); + res = Traits::vec128Mul(res, *reinterpret_cast(b)); + VecType z = Traits::vecMul(x, *reinterpret_cast(p)); + res = Traits::vec128Add(res, Traits::squash1(z)); + + str += vecLength; + n -= vecLength / 4; +} + +template +ALWAYS_INLINE void polyHashUnroll2(int& n, uint16_t const*& str, typename Traits::Vec128Type& res, uint32_t const* b, uint32_t const* p) { + using VecType = typename Traits::VecType; + using Vec128Type = typename Traits::Vec128Type; + using U16VecType = typename Traits::U16VecType; + + const int vecLength = sizeof(VecType) / 4; + if (n < vecLength / 2) return; + + res = Traits::vec128Mul(res, *reinterpret_cast(b)); + + VecType res0 = Traits::initVec(); + VecType res1 = Traits::initVec(); + + do { + VecType x0 = Traits::u16Load(*reinterpret_cast(str)); + VecType x1 = Traits::u16Load(*reinterpret_cast(str + vecLength)); + res0 = Traits::vecMul(res0, *reinterpret_cast(b)); + res1 = Traits::vecMul(res1, *reinterpret_cast(b)); + VecType z0 = Traits::vecMul(x0, *reinterpret_cast(p)); + VecType z1 = Traits::vecMul(x1, *reinterpret_cast(p + vecLength)); + res0 = Traits::vecAdd(res0, z0); + res1 = Traits::vecAdd(res1, z1); + + str += vecLength * 2; + n -= vecLength / 2; + } while (n >= vecLength / 2); + + res = Traits::vec128Add(res, Traits::squash2(res0, res1)); +} + +template +ALWAYS_INLINE void polyHashUnroll4(int& n, uint16_t const*& str, typename Traits::Vec128Type& res, uint32_t const* b, uint32_t const* p) { + using VecType = typename Traits::VecType; + using Vec128Type = typename Traits::Vec128Type; + using U16VecType = typename Traits::U16VecType; + + const int vecLength = sizeof(VecType) / 4; + if (n < vecLength) return; + + res = Traits::vec128Mul(res, *reinterpret_cast(b)); + + VecType res0 = Traits::initVec(); + VecType res1 = Traits::initVec(); + VecType res2 = Traits::initVec(); + VecType res3 = Traits::initVec(); + + do { + VecType x0 = Traits::u16Load(*reinterpret_cast(str)); + VecType x1 = Traits::u16Load(*reinterpret_cast(str + vecLength)); + VecType x2 = Traits::u16Load(*reinterpret_cast(str + vecLength * 2)); + VecType x3 = Traits::u16Load(*reinterpret_cast(str + vecLength * 3)); + res0 = Traits::vecMul(res0, *reinterpret_cast(b)); + res1 = Traits::vecMul(res1, *reinterpret_cast(b)); + res2 = Traits::vecMul(res2, *reinterpret_cast(b)); + res3 = Traits::vecMul(res3, *reinterpret_cast(b)); + VecType z0 = Traits::vecMul(x0, *reinterpret_cast(p)); + VecType z1 = Traits::vecMul(x1, *reinterpret_cast(p + vecLength)); + VecType z2 = Traits::vecMul(x2, *reinterpret_cast(p + vecLength * 2)); + VecType z3 = Traits::vecMul(x3, *reinterpret_cast(p + vecLength * 3)); + res0 = Traits::vecAdd(res0, z0); + res1 = Traits::vecAdd(res1, z1); + res2 = Traits::vecAdd(res2, z2); + res3 = Traits::vecAdd(res3, z3); + + str += vecLength * 4; + n -= vecLength; + } while (n >= vecLength); + + res = Traits::vec128Add(res, Traits::vec128Add(Traits::squash2(res0, res1), Traits::squash2(res2, res3))); +} + +template +ALWAYS_INLINE void polyHashUnroll8(int& n, uint16_t const*& str, typename Traits::Vec128Type& res, uint32_t const* b, uint32_t const* p) { + using VecType = typename Traits::VecType; + using Vec128Type = typename Traits::Vec128Type; + using U16VecType = typename Traits::U16VecType; + + const int vecLength = sizeof(VecType) / 4; + if (n < vecLength * 2) return; + + VecType res0 = Traits::initVec(); + VecType res1 = Traits::initVec(); + VecType res2 = Traits::initVec(); + VecType res3 = Traits::initVec(); + VecType res4 = Traits::initVec(); + VecType res5 = Traits::initVec(); + VecType res6 = Traits::initVec(); + VecType res7 = Traits::initVec(); + + do { + VecType x0 = Traits::u16Load(*reinterpret_cast(str)); + VecType x1 = Traits::u16Load(*reinterpret_cast(str + vecLength)); + VecType x2 = Traits::u16Load(*reinterpret_cast(str + vecLength * 2)); + VecType x3 = Traits::u16Load(*reinterpret_cast(str + vecLength * 3)); + VecType x4 = Traits::u16Load(*reinterpret_cast(str + vecLength * 4)); + VecType x5 = Traits::u16Load(*reinterpret_cast(str + vecLength * 5)); + VecType x6 = Traits::u16Load(*reinterpret_cast(str + vecLength * 6)); + VecType x7 = Traits::u16Load(*reinterpret_cast(str + vecLength * 7)); + res0 = Traits::vecMul(res0, *reinterpret_cast(b)); + res1 = Traits::vecMul(res1, *reinterpret_cast(b)); + res2 = Traits::vecMul(res2, *reinterpret_cast(b)); + res3 = Traits::vecMul(res3, *reinterpret_cast(b)); + res4 = Traits::vecMul(res4, *reinterpret_cast(b)); + res5 = Traits::vecMul(res5, *reinterpret_cast(b)); + res6 = Traits::vecMul(res6, *reinterpret_cast(b)); + res7 = Traits::vecMul(res7, *reinterpret_cast(b)); + VecType z0 = Traits::vecMul(x0, *reinterpret_cast(p)); + VecType z1 = Traits::vecMul(x1, *reinterpret_cast(p + vecLength)); + VecType z2 = Traits::vecMul(x2, *reinterpret_cast(p + vecLength * 2)); + VecType z3 = Traits::vecMul(x3, *reinterpret_cast(p + vecLength * 3)); + VecType z4 = Traits::vecMul(x4, *reinterpret_cast(p + vecLength * 4)); + VecType z5 = Traits::vecMul(x5, *reinterpret_cast(p + vecLength * 5)); + VecType z6 = Traits::vecMul(x6, *reinterpret_cast(p + vecLength * 6)); + VecType z7 = Traits::vecMul(x7, *reinterpret_cast(p + vecLength * 7)); + res0 = Traits::vecAdd(res0, z0); + res1 = Traits::vecAdd(res1, z1); + res2 = Traits::vecAdd(res2, z2); + res3 = Traits::vecAdd(res3, z3); + res4 = Traits::vecAdd(res4, z4); + res5 = Traits::vecAdd(res5, z5); + res6 = Traits::vecAdd(res6, z6); + res7 = Traits::vecAdd(res7, z7); + + str += vecLength * 8; + n -= vecLength * 2; + } while (n >= vecLength * 2); + + Vec128Type sum1 = Traits::vec128Add(Traits::squash2(res0, res1), Traits::squash2(res2, res3)); + Vec128Type sum2 = Traits::vec128Add(Traits::squash2(res4, res5), Traits::squash2(res6, res7)); + res = Traits::vec128Add(res, Traits::vec128Add(sum1, sum2)); +} + +#if defined(__x86_64__) or defined(__i386__) +#pragma clang attribute pop +#endif + +#endif // RUNTIME_POLYHASH_COMMON_H diff --git a/kotlin-native/runtime/src/main/cpp/polyhash/naive.h b/kotlin-native/runtime/src/main/cpp/polyhash/naive.h new file mode 100644 index 00000000000..20ca0a85052 --- /dev/null +++ b/kotlin-native/runtime/src/main/cpp/polyhash/naive.h @@ -0,0 +1,18 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the LICENSE file. + */ + +#ifndef RUNTIME_POLYHASH_NAIVE_H +#define RUNTIME_POLYHASH_NAIVE_H + +#include + +inline int polyHash_naive(int length, uint16_t const* str) { + int res = 0; + for (int i = 0; i < length; ++i) + res = res * 31 + str[i]; + return res; +} + +#endif // RUNTIME_POLYHASH_NAIVE_H diff --git a/kotlin-native/runtime/src/main/cpp/polyhash/x86.cpp b/kotlin-native/runtime/src/main/cpp/polyhash/x86.cpp new file mode 100644 index 00000000000..a5b2b321637 --- /dev/null +++ b/kotlin-native/runtime/src/main/cpp/polyhash/x86.cpp @@ -0,0 +1,166 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the LICENSE file. + */ + +#include "polyhash/common.h" +#include "polyhash/x86.h" + +#if defined(__x86_64__) or defined(__i386__) + +#include + +#pragma clang attribute push (__attribute__((target("avx2"))), apply_to=function) + +namespace { + +alignas(32) constexpr auto p64 = DecreasingPowers<64>(31); // [base^63, base^62, .., base^2, base, 1] +alignas(32) constexpr auto b64 = RepeatingPowers<8>(31, 64); // [base^64, base^64, .., base^64] (8) +alignas(32) constexpr auto b32 = RepeatingPowers<8>(31, 32); // [base^32, base^32, .., base^32] (8) +alignas(32) constexpr auto b16 = RepeatingPowers<8>(31, 16); // [base^16, base^16, .., base^16] (8) +alignas(32) constexpr auto b8 = RepeatingPowers<8>(31, 8); // [base^8, base^8, .., base^8 ] (8) +alignas(32) constexpr auto b4 = RepeatingPowers<8>(31, 4); // [base^4, base^4, .., base^4 ] (8) + +struct SSETraits { + using VecType = __m128i; + using Vec128Type = __m128i; + using U16VecType = __m128i; + + ALWAYS_INLINE static VecType initVec() { return _mm_setzero_si128(); } + ALWAYS_INLINE static Vec128Type initVec128() { return _mm_setzero_si128(); } + ALWAYS_INLINE static int vec128toInt(Vec128Type x) { return _mm_cvtsi128_si32(x); } + ALWAYS_INLINE static VecType u16Load(U16VecType x) { return _mm_cvtepu16_epi32(x); } + ALWAYS_INLINE static Vec128Type vec128Mul(Vec128Type x, Vec128Type y) { return _mm_mullo_epi32(x, y); } + ALWAYS_INLINE static Vec128Type vec128Add(Vec128Type x, Vec128Type y) { return _mm_add_epi32(x, y); } + ALWAYS_INLINE static VecType vecMul(VecType x, VecType y) { return _mm_mullo_epi32(x, y); } + ALWAYS_INLINE static VecType vecAdd(VecType x, VecType y) { return _mm_add_epi32(x, y); } + ALWAYS_INLINE static Vec128Type squash2(VecType x, VecType y) { + return squash1(_mm_hadd_epi32(x, y)); // [x0 + x1, x2 + x3, y0 + y1, y2 + y3] + } + + ALWAYS_INLINE static Vec128Type squash1(VecType z) { + VecType sum = _mm_hadd_epi32(z, z); // [z0 + z1, z2 + z3, z0 + z1, z2 + z3] + return _mm_hadd_epi32(sum, sum); // [z0..3, same, same, same] + } + + static int polyHashUnalignedUnrollUpTo8(int n, uint16_t const* str) { + Vec128Type res = initVec128(); + + polyHashUnroll2(n, str, res, &b8[0], &p64[56]); + polyHashTail(n, str, res, &b4[0], &p64[60]); + + return vec128toInt(res); + } + + static int polyHashUnalignedUnrollUpTo16(int n, uint16_t const* str) { + Vec128Type res = initVec128(); + + polyHashUnroll4(n, str, res, &b16[0], &p64[48]); + polyHashUnroll2(n, str, res, &b8[0], &p64[56]); + polyHashTail(n, str, res, &b4[0], &p64[60]); + + return vec128toInt(res); + } +}; + +struct AVX2Traits { + using VecType = __m256i; + using Vec128Type = __m128i; + using U16VecType = __m128i; + + ALWAYS_INLINE static VecType initVec() { return _mm256_setzero_si256(); } + ALWAYS_INLINE static Vec128Type initVec128() { return _mm_setzero_si128(); } + ALWAYS_INLINE static int vec128toInt(Vec128Type x) { return _mm_cvtsi128_si32(x); } + ALWAYS_INLINE static VecType u16Load(U16VecType x) { return _mm256_cvtepu16_epi32(x); } + ALWAYS_INLINE static Vec128Type vec128Mul(Vec128Type x, Vec128Type y) { return _mm_mullo_epi32(x, y); } + ALWAYS_INLINE static Vec128Type vec128Add(Vec128Type x, Vec128Type y) { return _mm_add_epi32(x, y); } + ALWAYS_INLINE static VecType vecMul(VecType x, VecType y) { return _mm256_mullo_epi32(x, y); } + ALWAYS_INLINE static VecType vecAdd(VecType x, VecType y) { return _mm256_add_epi32(x, y); } + ALWAYS_INLINE static Vec128Type squash2(VecType x, VecType y) { + return squash1(_mm256_hadd_epi32(x, y)); // [x0 + x1, x2 + x3, y0 + y1, y2 + y3, x4 + x5, x6 + x7, y4 + y5, y6 + y7] + } + + ALWAYS_INLINE static Vec128Type squash1(VecType z) { + VecType sum = _mm256_hadd_epi32(z, z); // [z0 + z1, z2 + z3, z0 + z1, z2 + z3, z4 + z5, z6 + z7, z4 + z5, z6 + z7] + sum = _mm256_hadd_epi32(sum, sum); // [z0..3, z0..3, z0..3, z0..3, z4..7, z4..7, z4..7, z4..7] + Vec128Type lo = _mm256_extracti128_si256(sum, 0); // [z0..3, same, same, same] + Vec128Type hi = _mm256_extracti128_si256(sum, 1); // [z4..7, same, same, same] + return _mm_add_epi32(lo, hi); // [z0..7, same, same, same] + } + + static int polyHashUnalignedUnrollUpTo16(int n, uint16_t const* str) { + Vec128Type res = initVec128(); + + polyHashUnroll2(n, str, res, &b16[0], &p64[48]); + polyHashTail(n, str, res, &b8[0], &p64[56]); + polyHashTail(n, str, res, &b4[0], &p64[60]); + + return vec128toInt(res); + } + + static int polyHashUnalignedUnrollUpTo32(int n, uint16_t const* str) { + Vec128Type res = initVec128(); + + polyHashUnroll4(n, str, res, &b32[0], &p64[32]); + polyHashUnroll2(n, str, res, &b16[0], &p64[48]); + polyHashTail(n, str, res, &b8[0], &p64[56]); + polyHashTail(n, str, res, &b4[0], &p64[60]); + + return vec128toInt(res); + } + + static int polyHashUnalignedUnrollUpTo64(int n, uint16_t const* str) { + Vec128Type res = initVec128(); + + polyHashUnroll8(n, str, res, &b64[0], &p64[0]); + polyHashUnroll4(n, str, res, &b32[0], &p64[32]); + polyHashUnroll2(n, str, res, &b16[0], &p64[48]); + polyHashTail(n, str, res, &b8[0], &p64[56]); + polyHashTail(n, str, res, &b4[0], &p64[60]); + + return vec128toInt(res); + } +}; + +#if defined(__x86_64__) + const bool x64 = true; +#else + const bool x64 = false; +#endif + bool initialized = false; + bool sseSupported; + bool avx2Supported; + +} + +int polyHash_x86(int length, uint16_t const* str) { + if (!initialized) { + initialized = true; + sseSupported = __builtin_cpu_supports("sse4.1"); + avx2Supported = __builtin_cpu_supports("avx2"); + } + if (length < 16 || (!sseSupported && !avx2Supported)) { + // Either vectorization is not supported or the string is too short to gain from it. + return polyHash_naive(length, str); + } + int res; + if (length < 32) + res = SSETraits::polyHashUnalignedUnrollUpTo8(length / 4, str); + else if (!avx2Supported) + res = SSETraits::polyHashUnalignedUnrollUpTo16(length / 4, str); + else if (length < 128) + res = AVX2Traits::polyHashUnalignedUnrollUpTo16(length / 4, str); + else if (!x64 || length < 576) + res = AVX2Traits::polyHashUnalignedUnrollUpTo32(length / 4, str); + else // Such big unrolling requires 64-bit mode (in 32-bit mode there are only 8 vector registers) + res = AVX2Traits::polyHashUnalignedUnrollUpTo64(length / 4, str); + + // Handle the tail naively. + for (int i = length & 0xFFFFFFFC; i < length; ++i) + res = res * 31 + str[i]; + return res; +} + +#pragma clang attribute pop + +#endif diff --git a/kotlin-native/runtime/src/main/cpp/polyhash/x86.h b/kotlin-native/runtime/src/main/cpp/polyhash/x86.h new file mode 100644 index 00000000000..d9f7f93288b --- /dev/null +++ b/kotlin-native/runtime/src/main/cpp/polyhash/x86.h @@ -0,0 +1,11 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the LICENSE file. + */ + +#ifndef RUNTIME_POLYHASH_X86_H +#define RUNTIME_POLYHASH_X86_H + +int polyHash_x86(int length, uint16_t const* str); + +#endif // RUNTIME_POLYHASH_X86_H From c12d79176a5c29531f0b8f4fa11eeaac3130813d Mon Sep 17 00:00:00 2001 From: Igor Chevdar Date: Fri, 29 Jan 2021 18:18:56 +0500 Subject: [PATCH 199/212] [runtime] Fixed UB with signed overflow --- kotlin-native/runtime/src/main/cpp/polyhash/arm.cpp | 2 +- kotlin-native/runtime/src/main/cpp/polyhash/naive.h | 2 +- kotlin-native/runtime/src/main/cpp/polyhash/x86.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kotlin-native/runtime/src/main/cpp/polyhash/arm.cpp b/kotlin-native/runtime/src/main/cpp/polyhash/arm.cpp index 1e194af701f..a31474a60a7 100644 --- a/kotlin-native/runtime/src/main/cpp/polyhash/arm.cpp +++ b/kotlin-native/runtime/src/main/cpp/polyhash/arm.cpp @@ -99,7 +99,7 @@ int polyHash_arm(int length, uint16_t const* str) { // Vectorization is not supported. return polyHash_naive(length, str); } - int res; + uint32_t res; if (length < 488) res = NeonTraits::polyHashUnalignedUnrollUpTo16(length / 4, str); else diff --git a/kotlin-native/runtime/src/main/cpp/polyhash/naive.h b/kotlin-native/runtime/src/main/cpp/polyhash/naive.h index 20ca0a85052..762763c0dbd 100644 --- a/kotlin-native/runtime/src/main/cpp/polyhash/naive.h +++ b/kotlin-native/runtime/src/main/cpp/polyhash/naive.h @@ -9,7 +9,7 @@ #include inline int polyHash_naive(int length, uint16_t const* str) { - int res = 0; + uint32_t res = 0; for (int i = 0; i < length; ++i) res = res * 31 + str[i]; return res; diff --git a/kotlin-native/runtime/src/main/cpp/polyhash/x86.cpp b/kotlin-native/runtime/src/main/cpp/polyhash/x86.cpp index a5b2b321637..406a33fccb9 100644 --- a/kotlin-native/runtime/src/main/cpp/polyhash/x86.cpp +++ b/kotlin-native/runtime/src/main/cpp/polyhash/x86.cpp @@ -143,7 +143,7 @@ int polyHash_x86(int length, uint16_t const* str) { // Either vectorization is not supported or the string is too short to gain from it. return polyHash_naive(length, str); } - int res; + uint32_t res; if (length < 32) res = SSETraits::polyHashUnalignedUnrollUpTo8(length / 4, str); else if (!avx2Supported) From 9e99932b24476b85bc2b752385fa913c599a2eac Mon Sep 17 00:00:00 2001 From: Alexander Shabalin Date: Sat, 30 Jan 2021 10:32:55 +0300 Subject: [PATCH 200/212] Add a check for single-thread mutator (#4665) --- kotlin-native/runtime/src/main/cpp/Runtime.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kotlin-native/runtime/src/main/cpp/Runtime.cpp b/kotlin-native/runtime/src/main/cpp/Runtime.cpp index 93d7bccf9e7..84b0cafa181 100644 --- a/kotlin-native/runtime/src/main/cpp/Runtime.cpp +++ b/kotlin-native/runtime/src/main/cpp/Runtime.cpp @@ -107,6 +107,9 @@ RuntimeState* initRuntime() { result->memoryState = InitMemory(false); // The argument will be ignored for legacy DestroyRuntimeMode result->worker = WorkerInit(true); firstRuntime = atomicAdd(&aliveRuntimesCount, 1) == 1; + if (CurrentMemoryModel == MemoryModel::kExperimental) { + RuntimeCheck(firstRuntime, "Experimental MM does not support multiple mutator threads yet"); + } break; case DESTROY_RUNTIME_ON_SHUTDOWN: // First update `aliveRuntimesCount` and then update `globalRuntimeStatus`, for synchronization with From 04ee3e37e781a03a0476b2804b702beb3e46a3be Mon Sep 17 00:00:00 2001 From: Alexander Shabalin Date: Mon, 1 Feb 2021 13:44:10 +0300 Subject: [PATCH 201/212] Implement ref updates in new MM (#4653) --- .../runtime/src/main/cpp/MemorySharedRefs.cpp | 1 + .../src/mm/cpp/InitializationScheme.cpp | 74 +++++ .../src/mm/cpp/InitializationScheme.hpp | 22 ++ .../src/mm/cpp/InitializationSchemeTest.cpp | 258 ++++++++++++++++++ kotlin-native/runtime/src/mm/cpp/Memory.cpp | 87 +++++- .../runtime/src/mm/cpp/ObjectFactory.hpp | 8 + .../runtime/src/mm/cpp/ObjectOps.cpp | 63 +++++ .../runtime/src/mm/cpp/ObjectOps.hpp | 35 +++ kotlin-native/runtime/src/mm/cpp/Stubs.cpp | 53 ---- .../runtime/src/mm/cpp/ThreadData.hpp | 10 +- 10 files changed, 543 insertions(+), 68 deletions(-) create mode 100644 kotlin-native/runtime/src/mm/cpp/InitializationScheme.cpp create mode 100644 kotlin-native/runtime/src/mm/cpp/InitializationScheme.hpp create mode 100644 kotlin-native/runtime/src/mm/cpp/InitializationSchemeTest.cpp create mode 100644 kotlin-native/runtime/src/mm/cpp/ObjectOps.cpp create mode 100644 kotlin-native/runtime/src/mm/cpp/ObjectOps.hpp diff --git a/kotlin-native/runtime/src/main/cpp/MemorySharedRefs.cpp b/kotlin-native/runtime/src/main/cpp/MemorySharedRefs.cpp index 6e046a7323d..b1714bed4c0 100644 --- a/kotlin-native/runtime/src/main/cpp/MemorySharedRefs.cpp +++ b/kotlin-native/runtime/src/main/cpp/MemorySharedRefs.cpp @@ -173,6 +173,7 @@ void BackRefFromAssociatedObject::releaseRef() { DeinitForeignRef(obj_, context); // From this moment [context] is generally a dangling pointer. // This is handled in [IsForeignRefAccessible] and [addRef]. + // TODO: This probably isn't fine in new MM. Make sure it works. } } diff --git a/kotlin-native/runtime/src/mm/cpp/InitializationScheme.cpp b/kotlin-native/runtime/src/mm/cpp/InitializationScheme.cpp new file mode 100644 index 00000000000..b4e1104ace3 --- /dev/null +++ b/kotlin-native/runtime/src/mm/cpp/InitializationScheme.cpp @@ -0,0 +1,74 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the LICENSE file. + */ + +#include "InitializationScheme.hpp" + +#include "Common.h" +#include "ObjectOps.hpp" +#include "ThreadData.hpp" + +using namespace kotlin; + +OBJ_GETTER(mm::InitThreadLocalSingleton, ThreadData* threadData, ObjHeader** location, const TypeInfo* typeInfo, void (*ctor)(ObjHeader*)) { + if (auto* value = *location) { + // Initialized by someone else. + RETURN_OBJ(value); + } + auto* value = mm::AllocateObject(threadData, typeInfo, OBJ_RESULT); + mm::SetHeapRef(location, value); +#if KONAN_NO_EXCEPTIONS + ctor(value); +#else + try { + ctor(value); + } catch (...) { + mm::SetStackRef(OBJ_RESULT, nullptr); + mm::SetHeapRef(location, nullptr); + throw; + } +#endif + return value; +} + +OBJ_GETTER(mm::InitSingleton, ThreadData* threadData, ObjHeader** location, const TypeInfo* typeInfo, void (*ctor)(ObjHeader*)) { + auto& initializingSingletons = threadData->initializingSingletons(); + + // Search from the top of the stack. + for (auto it = initializingSingletons.rbegin(); it != initializingSingletons.rend(); ++it) { + if (it->first == location) { + RETURN_OBJ(it->second); + } + } + + ObjHeader* initializing = reinterpret_cast(1); + + // Spin lock. + ObjHeader* value = nullptr; + while ((value = __sync_val_compare_and_swap(location, nullptr, initializing)) == initializing) { + } + if (value != nullptr) { + // Initialized by someone else. + RETURN_OBJ(value); + } + auto* object = mm::AllocateObject(threadData, typeInfo, OBJ_RESULT); + initializingSingletons.push_back(std::make_pair(location, object)); + +#if KONAN_NO_EXCEPTIONS + ctor(object); +#else + try { + ctor(object); + } catch (...) { + mm::SetStackRef(OBJ_RESULT, nullptr); + mm::SetHeapRefAtomic(location, nullptr); + initializingSingletons.pop_back(); + throw; + } +#endif + mm::GlobalsRegistry::Instance().RegisterStorageForGlobal(threadData, location); + mm::SetHeapRefAtomic(location, object); + initializingSingletons.pop_back(); + return object; +} diff --git a/kotlin-native/runtime/src/mm/cpp/InitializationScheme.hpp b/kotlin-native/runtime/src/mm/cpp/InitializationScheme.hpp new file mode 100644 index 00000000000..49420b1df61 --- /dev/null +++ b/kotlin-native/runtime/src/mm/cpp/InitializationScheme.hpp @@ -0,0 +1,22 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the LICENSE file. + */ + +#ifndef RUNTIME_MM_INITIALIZATION_SCHEME_H +#define RUNTIME_MM_INITIALIZATION_SCHEME_H + +#include "Memory.h" + +namespace kotlin { +namespace mm { + +class ThreadData; + +OBJ_GETTER(InitThreadLocalSingleton, ThreadData* threadData, ObjHeader** location, const TypeInfo* typeInfo, void (*ctor)(ObjHeader*)); +OBJ_GETTER(InitSingleton, ThreadData* threadData, ObjHeader** location, const TypeInfo* typeInfo, void (*ctor)(ObjHeader*)); + +} // namespace mm +} // namespace kotlin + +#endif // RUNTIME_MM_INITIALIZATION_SCHEME_H diff --git a/kotlin-native/runtime/src/mm/cpp/InitializationSchemeTest.cpp b/kotlin-native/runtime/src/mm/cpp/InitializationSchemeTest.cpp new file mode 100644 index 00000000000..a46c01debf3 --- /dev/null +++ b/kotlin-native/runtime/src/mm/cpp/InitializationSchemeTest.cpp @@ -0,0 +1,258 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the LICENSE file. + */ + +#include "InitializationScheme.hpp" + +#include +#include + +#include "gmock/gmock.h" +#include "gtest/gtest.h" + +#include "TestSupport.hpp" +#include "ThreadData.hpp" +#include "Types.h" + +using namespace kotlin; + +using testing::_; + +namespace { + +class InitSingletonTest : public testing::Test { +public: + InitSingletonTest() { + typeInfo_.typeInfo_ = &typeInfo_; + typeInfo_.instanceSize_ = sizeof(ObjHeader); + + globalConstructor_ = &constructor_; + + for (auto& threadData : threadDatas_) { + threadData = make_unique(pthread_t{}); + } + } + + ~InitSingletonTest() { + globalConstructor_ = nullptr; + // Make sure to clean everything allocated by the tests. + for (auto& threadData : threadDatas_) { + threadData->objectFactoryThreadQueue().ClearForTests(); + } + } + + mm::ThreadData& threadData(size_t threadIndex) { return *threadDatas_[threadIndex]; } + + testing::MockFunction& constructor() { return constructor_; } + + OBJ_GETTER(InitThreadLocalSingleton, ObjHeader** location, size_t threadIndex) { + RETURN_RESULT_OF(mm::InitThreadLocalSingleton, threadDatas_[threadIndex].get(), location, &typeInfo_, constructorImpl); + } + + OBJ_GETTER(InitSingleton, ObjHeader** location, size_t threadIndex) { + RETURN_RESULT_OF(mm::InitSingleton, threadDatas_[threadIndex].get(), location, &typeInfo_, constructorImpl); + } + +private: + testing::StrictMock> constructor_; + // TODO: It makes sense to somehow abstract `ThreadData` stuff away. Allocation in this case. + std::array, kDefaultThreadCount> threadDatas_; + TypeInfo typeInfo_; // Only used for allocator calls, uninteresting for these tests. + + static testing::MockFunction* globalConstructor_; + + static void constructorImpl(ObjHeader* object) { globalConstructor_->Call(object); } +}; + +// static +testing::MockFunction* InitSingletonTest::globalConstructor_ = nullptr; + +} // namespace + +TEST_F(InitSingletonTest, InitThreadLocalSingleton) { + ObjHeader* location = nullptr; + ObjHeader* stackLocation = nullptr; + + ObjHeader* valueAtConstructor = nullptr; + EXPECT_CALL(constructor(), Call(_)).WillOnce([&location, &stackLocation, &valueAtConstructor](ObjHeader* value) { + EXPECT_THAT(value, stackLocation); + EXPECT_THAT(value, location); + valueAtConstructor = value; + }); + ObjHeader* value = InitThreadLocalSingleton(&location, 0, &stackLocation); + EXPECT_THAT(value, stackLocation); + EXPECT_THAT(value, location); + EXPECT_THAT(valueAtConstructor, location); +} + +TEST_F(InitSingletonTest, InitThreadLocalSingletonTwice) { + ObjHeader previousValue; + ObjHeader* location = &previousValue; + ObjHeader* stackLocation = nullptr; + + EXPECT_CALL(constructor(), Call(_)).Times(0); + ObjHeader* value = InitThreadLocalSingleton(&location, 0, &stackLocation); + EXPECT_THAT(value, stackLocation); + EXPECT_THAT(value, location); + EXPECT_THAT(value, &previousValue); +} + +TEST_F(InitSingletonTest, InitThreadLocalSingletonFail) { + ObjHeader* location = nullptr; + ObjHeader* stackLocation = nullptr; + constexpr int kException = 42; + + EXPECT_CALL(constructor(), Call(_)).WillOnce([]() { throw kException; }); + try { + InitThreadLocalSingleton(&location, 0, &stackLocation); + ASSERT_TRUE(false); // Cannot be reached. + } catch (int exception) { + EXPECT_THAT(exception, kException); + } + EXPECT_THAT(stackLocation, nullptr); + EXPECT_THAT(location, nullptr); +} + +TEST_F(InitSingletonTest, InitSingleton) { + ObjHeader* location = nullptr; + ObjHeader* stackLocation = nullptr; + + ObjHeader* valueAtConstructor = nullptr; + EXPECT_CALL(constructor(), Call(_)).WillOnce([&location, &stackLocation, &valueAtConstructor](ObjHeader* value) { + EXPECT_THAT(value, stackLocation); + EXPECT_THAT(location, reinterpret_cast(1)); + valueAtConstructor = value; + }); + ObjHeader* value = InitSingleton(&location, 0, &stackLocation); + EXPECT_THAT(value, stackLocation); + EXPECT_THAT(value, location); + EXPECT_THAT(valueAtConstructor, location); +} + +TEST_F(InitSingletonTest, InitSingletonTwice) { + ObjHeader previousValue; + ObjHeader* location = &previousValue; + ObjHeader* stackLocation = nullptr; + + EXPECT_CALL(constructor(), Call(_)).Times(0); + ObjHeader* value = InitSingleton(&location, 0, &stackLocation); + EXPECT_THAT(value, stackLocation); + EXPECT_THAT(value, location); + EXPECT_THAT(value, &previousValue); +} + +TEST_F(InitSingletonTest, InitSingletonFail) { + ObjHeader* location = nullptr; + ObjHeader* stackLocation = nullptr; + constexpr int kException = 42; + + EXPECT_CALL(constructor(), Call(_)).WillOnce([]() { throw kException; }); + try { + InitSingleton(&location, 0, &stackLocation); + ASSERT_TRUE(false); // Cannot be reached. + } catch (int exception) { + EXPECT_THAT(exception, kException); + } + EXPECT_THAT(stackLocation, nullptr); + EXPECT_THAT(location, nullptr); +} + +TEST_F(InitSingletonTest, InitSingletonRecursive) { + // The first singleton. Its constructor depends on the second singleton. + ObjHeader* location1 = nullptr; + ObjHeader* stackLocation1 = nullptr; + // The second singleton. Its constructor depends on the first singleton. + ObjHeader* location2 = nullptr; + ObjHeader* stackLocation2 = nullptr; + + EXPECT_CALL(constructor(), Call(_)) + .Times(2) // called only once for each singleton. + .WillRepeatedly([this, &location1, &stackLocation1, &location2, &stackLocation2](ObjHeader* value) { + if (value == stackLocation1) { + ObjHeader* result = InitSingleton(&location2, 0, &stackLocation2); + EXPECT_THAT(result, stackLocation2); + EXPECT_THAT(result, location2); + EXPECT_THAT(result, testing::Ne(reinterpret_cast(1))); + } else { + ObjHeader* result = InitSingleton(&location1, 0, &stackLocation1); + EXPECT_THAT(result, stackLocation1); + EXPECT_THAT(result, testing::Ne(location1)); + EXPECT_THAT(location1, reinterpret_cast(1)); + } + }); + ObjHeader* value = InitSingleton(&location1, 0, &stackLocation1); + EXPECT_THAT(value, stackLocation1); + EXPECT_THAT(value, location1); +} + +TEST_F(InitSingletonTest, InitSingletonConcurrent) { + constexpr size_t kThreadCount = kDefaultThreadCount; + std::atomic canStart(false); + std::atomic readyCount(0); + KStdVector threads; + ObjHeader* location = nullptr; + KStdVector stackLocations(kThreadCount, nullptr); + KStdVector actual(kThreadCount, nullptr); + + for (size_t i = 0; i < kThreadCount; ++i) { + threads.emplace_back([this, i, &location, &stackLocations, &actual, &readyCount, &canStart]() { + ++readyCount; + while (!canStart) { + } + actual[i] = InitSingleton(&location, i, &stackLocations[i]); + }); + } + + while (readyCount < kThreadCount) { + } + // Constructor is called exactly once. + EXPECT_CALL(constructor(), Call(_)); + canStart = true; + for (auto& t : threads) { + t.join(); + } + testing::Mock::VerifyAndClearExpectations(&constructor()); + + EXPECT_THAT(location, testing::Ne(nullptr)); + EXPECT_THAT(location, testing::Ne(reinterpret_cast(1))); + EXPECT_THAT(stackLocations, testing::Each(location)); + EXPECT_THAT(actual, testing::Each(location)); +} + +TEST_F(InitSingletonTest, InitSingletonConcurrentFailing) { + constexpr size_t kThreadCount = kDefaultThreadCount; + std::atomic canStart(false); + std::atomic readyCount(0); + KStdVector threads; + constexpr int kException = 42; + ObjHeader* location = nullptr; + KStdVector stackLocations(kThreadCount, nullptr); + + for (size_t i = 0; i < kThreadCount; ++i) { + threads.emplace_back([this, i, &location, &stackLocations, &readyCount, &canStart]() { + ++readyCount; + while (!canStart) { + } + try { + InitSingleton(&location, i, &stackLocations[i]); + ASSERT_TRUE(false); // Cannot be reached. + } catch (int exception) { + EXPECT_THAT(exception, kException); + } + }); + } + + while (readyCount < kThreadCount) { + } + // Constructor is called exactly `kThreadCount` times. + EXPECT_CALL(constructor(), Call(_)).Times(kThreadCount).WillRepeatedly([]() { throw kException; }); + canStart = true; + for (auto& t : threads) { + t.join(); + } + testing::Mock::VerifyAndClearExpectations(&constructor()); + + EXPECT_THAT(location, nullptr); + EXPECT_THAT(stackLocations, testing::Each(nullptr)); +} diff --git a/kotlin-native/runtime/src/mm/cpp/Memory.cpp b/kotlin-native/runtime/src/mm/cpp/Memory.cpp index 0ea354c650f..f07c9bead4c 100644 --- a/kotlin-native/runtime/src/mm/cpp/Memory.cpp +++ b/kotlin-native/runtime/src/mm/cpp/Memory.cpp @@ -8,8 +8,11 @@ #include "Exceptions.h" #include "ExtraObjectData.hpp" #include "GlobalsRegistry.hpp" +#include "InitializationScheme.hpp" #include "KAssert.h" +#include "Natives.h" #include "Porting.h" +#include "ObjectOps.hpp" #include "StableRefRegistry.hpp" #include "ThreadData.hpp" #include "ThreadRegistry.hpp" @@ -111,8 +114,7 @@ extern "C" void RestoreMemory(MemoryState*) { extern "C" RUNTIME_NOTHROW OBJ_GETTER(AllocInstance, const TypeInfo* typeInfo) { auto* threadData = mm::ThreadRegistry::Instance().CurrentThreadData(); - auto* object = threadData->objectFactoryThreadQueue().CreateObject(typeInfo); - RETURN_OBJ(object); + RETURN_RESULT_OF(mm::AllocateObject, threadData, typeInfo); } extern "C" OBJ_GETTER(AllocArrayInstance, const TypeInfo* typeInfo, int32_t elements) { @@ -120,28 +122,84 @@ extern "C" OBJ_GETTER(AllocArrayInstance, const TypeInfo* typeInfo, int32_t elem ThrowIllegalArgumentException(); } auto* threadData = mm::ThreadRegistry::Instance().CurrentThreadData(); - auto* array = threadData->objectFactoryThreadQueue().CreateArray(typeInfo, static_cast(elements)); - // `ArrayHeader` and `ObjHeader` are expected to be compatible. - RETURN_OBJ(reinterpret_cast(array)); + RETURN_RESULT_OF(mm::AllocateArray, threadData, typeInfo, static_cast(elements)); } -extern "C" OBJ_GETTER(InitSingleton, ObjHeader** location, const TypeInfo* typeInfo, void (*ctor)(ObjHeader*)) { +extern "C" ALWAYS_INLINE OBJ_GETTER(InitThreadLocalSingleton, ObjHeader** location, const TypeInfo* typeInfo, void (*ctor)(ObjHeader*)) { auto* threadData = mm::ThreadRegistry::Instance().CurrentThreadData(); - // TODO: This should only be called if singleton is actually created here. It's possible that the - // singleton will be created on a different thread and here we should check that, instead of creating - // another one (and registering `location` twice). - mm::GlobalsRegistry::Instance().RegisterStorageForGlobal(threadData, location); - TODO(); + + RETURN_RESULT_OF(mm::InitThreadLocalSingleton, threadData, location, typeInfo, ctor); +} + +extern "C" ALWAYS_INLINE OBJ_GETTER(InitSingleton, ObjHeader** location, const TypeInfo* typeInfo, void (*ctor)(ObjHeader*)) { + auto* threadData = mm::ThreadRegistry::Instance().CurrentThreadData(); + + RETURN_RESULT_OF(mm::InitSingleton, threadData, location, typeInfo, ctor); } extern "C" RUNTIME_NOTHROW void InitAndRegisterGlobal(ObjHeader** location, const ObjHeader* initialValue) { auto* threadData = mm::ThreadRegistry::Instance().CurrentThreadData(); mm::GlobalsRegistry::Instance().RegisterStorageForGlobal(threadData, location); - TODO(); + mm::SetHeapRef(location, const_cast(initialValue)); } extern "C" const MemoryModel CurrentMemoryModel = MemoryModel::kExperimental; +extern "C" ALWAYS_INLINE RUNTIME_NOTHROW void SetStackRef(ObjHeader** location, const ObjHeader* object) { + mm::SetStackRef(location, const_cast(object)); +} + +extern "C" ALWAYS_INLINE RUNTIME_NOTHROW void SetHeapRef(ObjHeader** location, const ObjHeader* object) { + mm::SetHeapRef(location, const_cast(object)); +} + +extern "C" ALWAYS_INLINE RUNTIME_NOTHROW void ZeroHeapRef(ObjHeader** location) { + mm::SetHeapRef(location, nullptr); +} + +extern "C" RUNTIME_NOTHROW void ZeroArrayRefs(ArrayHeader* array) { + for (uint32_t index = 0; index < array->count_; ++index) { + ObjHeader** location = ArrayAddressOfElementAt(array, index); + mm::SetHeapRef(location, nullptr); + } +} + +extern "C" ALWAYS_INLINE RUNTIME_NOTHROW void ZeroStackRef(ObjHeader** location) { + mm::SetStackRef(location, nullptr); +} + +extern "C" ALWAYS_INLINE RUNTIME_NOTHROW void UpdateStackRef(ObjHeader** location, const ObjHeader* object) { + mm::SetStackRef(location, const_cast(object)); +} + +extern "C" ALWAYS_INLINE RUNTIME_NOTHROW void UpdateHeapRef(ObjHeader** location, const ObjHeader* object) { + mm::SetHeapRef(location, const_cast(object)); +} + +extern "C" ALWAYS_INLINE RUNTIME_NOTHROW void UpdateHeapRefIfNull(ObjHeader** location, const ObjHeader* object) { + if (object == nullptr) return; + ObjHeader* result = nullptr; // No need to store this value in a rootset. + mm::CompareAndSwapHeapRef(location, nullptr, const_cast(object), &result); +} + +extern "C" ALWAYS_INLINE RUNTIME_NOTHROW void UpdateReturnRef(ObjHeader** returnSlot, const ObjHeader* object) { + mm::SetStackRef(returnSlot, const_cast(object)); +} + +extern "C" ALWAYS_INLINE RUNTIME_NOTHROW OBJ_GETTER( + SwapHeapRefLocked, ObjHeader** location, ObjHeader* expectedValue, ObjHeader* newValue, int32_t* spinlock, int32_t* cookie) { + RETURN_RESULT_OF(mm::CompareAndSwapHeapRef, location, expectedValue, newValue); +} + +extern "C" ALWAYS_INLINE RUNTIME_NOTHROW void SetHeapRefLocked( + ObjHeader** location, ObjHeader* newValue, int32_t* spinlock, int32_t* cookie) { + mm::SetHeapRefAtomic(location, newValue); +} + +extern "C" ALWAYS_INLINE RUNTIME_NOTHROW OBJ_GETTER(ReadHeapRefLocked, ObjHeader** location, int32_t* spinlock, int32_t* cookie) { + RETURN_RESULT_OF(mm::ReadHeapRefAtomic, location); +} + extern "C" OBJ_GETTER(ReadHeapRefNoLock, ObjHeader* object, int32_t index) { // TODO: Remove when legacy MM is gone. ThrowNotImplementedError(); @@ -250,12 +308,15 @@ extern "C" RUNTIME_NOTHROW OBJ_GETTER(AdoptStablePointer, void* pointer) { auto* threadData = mm::ThreadRegistry::Instance().CurrentThreadData(); auto* node = static_cast(pointer); ObjHeader* object = **node; - UpdateReturnRef(OBJ_RESULT, object); + // Make sure `object` stays in the rootset: put it on the stack before removing it from `StableRefRegistry`. + mm::SetStackRef(OBJ_RESULT, object); mm::StableRefRegistry::Instance().UnregisterStableRef(threadData, node); return object; } extern "C" RUNTIME_NOTHROW void CheckLifetimesConstraint(ObjHeader* obj, ObjHeader* pointee) { + // TODO: Consider making it a `RuntimeCheck`. Probably all `RuntimeCheck`s and `RuntimeAssert`s should specify + // that their firing is a compiler bug and should be reported. if (!obj->local() && pointee != nullptr && pointee->local()) { konan::consolePrintf("Attempt to store a stack object %p into a heap object %p\n", pointee, obj); konan::consolePrintf("This is a compiler bug, please report it to https://kotl.in/issue\n"); diff --git a/kotlin-native/runtime/src/mm/cpp/ObjectFactory.hpp b/kotlin-native/runtime/src/mm/cpp/ObjectFactory.hpp index b28d093f149..9cc78bdc59b 100644 --- a/kotlin-native/runtime/src/mm/cpp/ObjectFactory.hpp +++ b/kotlin-native/runtime/src/mm/cpp/ObjectFactory.hpp @@ -140,6 +140,12 @@ public: owner_.AssertCorrectUnsafe(); } + void ClearForTests() noexcept { + // Since it's only for tests, no need to worry about stack overflows. + root_.reset(); + last_ = nullptr; + } + private: friend class ObjectFactoryStorage; @@ -259,6 +265,8 @@ public: void Publish() noexcept { producer_.Publish(); } + void ClearForTests() noexcept { producer_.ClearForTests(); } + private: Storage::Producer producer_; }; diff --git a/kotlin-native/runtime/src/mm/cpp/ObjectOps.cpp b/kotlin-native/runtime/src/mm/cpp/ObjectOps.cpp new file mode 100644 index 00000000000..539ef456138 --- /dev/null +++ b/kotlin-native/runtime/src/mm/cpp/ObjectOps.cpp @@ -0,0 +1,63 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the LICENSE file. + */ + +#include "ObjectOps.hpp" + +#include "Common.h" +#include "ThreadData.hpp" + +using namespace kotlin; + +// TODO: Memory barriers. + +ALWAYS_INLINE void mm::SetStackRef(ObjHeader** location, ObjHeader* value) noexcept { + *location = value; +} + +ALWAYS_INLINE void mm::SetHeapRef(ObjHeader** location, ObjHeader* value) noexcept { + *location = value; +} + +#pragma clang diagnostic push +// On 32-bit android arm clang warns of significant performance penalty because of large +// atomic operations. TODO: Consider using alternative ways of ordering memory operations if they +// turn out to be more efficient on these platforms. +#pragma clang diagnostic ignored "-Watomic-alignment" + +ALWAYS_INLINE void mm::SetHeapRefAtomic(ObjHeader** location, ObjHeader* value) noexcept { + __atomic_store_n(location, value, __ATOMIC_RELEASE); +} + +ALWAYS_INLINE OBJ_GETTER(mm::ReadHeapRefAtomic, ObjHeader** location) noexcept { + // TODO: Make this work with GCs that can stop thread at any point. + auto result = __atomic_load_n(location, __ATOMIC_ACQUIRE); + RETURN_OBJ(result); +} + +ALWAYS_INLINE OBJ_GETTER(mm::CompareAndSwapHeapRef, ObjHeader** location, ObjHeader* expected, ObjHeader* value) noexcept { + // TODO: Make this work with GCs that can stop thread at any point. + ObjHeader* actual = expected; + // TODO: Do we need this strong memory model? Do we need to use strong CAS? + // This intrinsic modifies `actual` non-atomically. + __atomic_compare_exchange_n(location, &actual, value, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); + // On success, we already have old value (== `expected`) in `actual`. + // On failure, we have the old value written into `actual`. + RETURN_OBJ(actual); +} + +#pragma clang diagnostic pop + +OBJ_GETTER(mm::AllocateObject, ThreadData* threadData, const TypeInfo* typeInfo) noexcept { + // TODO: Make this work with GCs that can stop thread at any point. + auto* object = threadData->objectFactoryThreadQueue().CreateObject(typeInfo); + RETURN_OBJ(object); +} + +OBJ_GETTER(mm::AllocateArray, ThreadData* threadData, const TypeInfo* typeInfo, uint32_t elements) noexcept { + // TODO: Make this work with GCs that can stop thread at any point. + auto* array = threadData->objectFactoryThreadQueue().CreateArray(typeInfo, static_cast(elements)); + // `ArrayHeader` and `ObjHeader` are expected to be compatible. + RETURN_OBJ(reinterpret_cast(array)); +} diff --git a/kotlin-native/runtime/src/mm/cpp/ObjectOps.hpp b/kotlin-native/runtime/src/mm/cpp/ObjectOps.hpp new file mode 100644 index 00000000000..2c20468ae97 --- /dev/null +++ b/kotlin-native/runtime/src/mm/cpp/ObjectOps.hpp @@ -0,0 +1,35 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the LICENSE file. + */ + +#ifndef RUNTIME_MM_OBJECT_OPS_H +#define RUNTIME_MM_OBJECT_OPS_H + +#include "Memory.h" + +namespace kotlin { +namespace mm { + +class ThreadData; + +// TODO: Make sure these operations work with any kind of thread stopping: safepoints and signals. + +// TODO: Consider adding some kind of an `Object` type (that wraps `ObjHeader*`) which +// will have these operations for a friendlier API. + +// TODO: `OBJ_GETTER` is used because the returned objects needs to be accessible via the rootset before the function +// returns. If we had a different way to efficiently keep the object in the roots, `OBJ_GETTER` can be removed. + +void SetStackRef(ObjHeader** location, ObjHeader* value) noexcept; +void SetHeapRef(ObjHeader** location, ObjHeader* value) noexcept; +void SetHeapRefAtomic(ObjHeader** location, ObjHeader* value) noexcept; +OBJ_GETTER(ReadHeapRefAtomic, ObjHeader** location) noexcept; +OBJ_GETTER(CompareAndSwapHeapRef, ObjHeader** location, ObjHeader* expected, ObjHeader* value) noexcept; +OBJ_GETTER(AllocateObject, ThreadData* threadData, const TypeInfo* typeInfo) noexcept; +OBJ_GETTER(AllocateArray, ThreadData* threadData, const TypeInfo* typeInfo, uint32_t elements) noexcept; + +} // namespace mm +} // namespace kotlin + +#endif // RUNTIME_MM_OBJECT_OPS_H diff --git a/kotlin-native/runtime/src/mm/cpp/Stubs.cpp b/kotlin-native/runtime/src/mm/cpp/Stubs.cpp index cf53f4f8b73..31214be2e4f 100644 --- a/kotlin-native/runtime/src/mm/cpp/Stubs.cpp +++ b/kotlin-native/runtime/src/mm/cpp/Stubs.cpp @@ -17,59 +17,6 @@ ALWAYS_INLINE bool isPermanentOrFrozen(const ObjHeader* obj) { extern "C" { -OBJ_GETTER(InitThreadLocalSingleton, ObjHeader** location, const TypeInfo* typeInfo, void (*ctor)(ObjHeader*)) { - TODO(); -} - -RUNTIME_NOTHROW void SetStackRef(ObjHeader** location, const ObjHeader* object) { - TODO(); -} - -RUNTIME_NOTHROW void SetHeapRef(ObjHeader** location, const ObjHeader* object) { - TODO(); -} - -RUNTIME_NOTHROW void ZeroHeapRef(ObjHeader** location) { - TODO(); -} - -RUNTIME_NOTHROW void ZeroArrayRefs(ArrayHeader* array) { - TODO(); -} - -RUNTIME_NOTHROW void ZeroStackRef(ObjHeader** location) { - TODO(); -} - -RUNTIME_NOTHROW void UpdateStackRef(ObjHeader** location, const ObjHeader* object) { - TODO(); -} - -RUNTIME_NOTHROW void UpdateHeapRef(ObjHeader** location, const ObjHeader* object) { - TODO(); -} - -RUNTIME_NOTHROW void UpdateHeapRefIfNull(ObjHeader** location, const ObjHeader* object) { - TODO(); -} - -RUNTIME_NOTHROW void UpdateReturnRef(ObjHeader** returnSlot, const ObjHeader* object) { - TODO(); -} - -RUNTIME_NOTHROW OBJ_GETTER( - SwapHeapRefLocked, ObjHeader** location, ObjHeader* expectedValue, ObjHeader* newValue, int32_t* spinlock, int32_t* cookie) { - TODO(); -} - -RUNTIME_NOTHROW void SetHeapRefLocked(ObjHeader** location, ObjHeader* newValue, int32_t* spinlock, int32_t* cookie) { - TODO(); -} - -RUNTIME_NOTHROW OBJ_GETTER(ReadHeapRefLocked, ObjHeader** location, int32_t* spinlock, int32_t* cookie) { - TODO(); -} - void MutationCheck(ObjHeader* obj) { TODO(); } diff --git a/kotlin-native/runtime/src/mm/cpp/ThreadData.hpp b/kotlin-native/runtime/src/mm/cpp/ThreadData.hpp index 07292b26237..1108c6adcf4 100644 --- a/kotlin-native/runtime/src/mm/cpp/ThreadData.hpp +++ b/kotlin-native/runtime/src/mm/cpp/ThreadData.hpp @@ -9,13 +9,16 @@ #include #include -#include "ObjectFactory.hpp" #include "GlobalsRegistry.hpp" +#include "ObjectFactory.hpp" #include "ShadowStack.hpp" #include "StableRefRegistry.hpp" #include "ThreadLocalStorage.hpp" -#include "Utils.hpp" #include "ThreadState.hpp" +#include "Types.h" +#include "Utils.hpp" + +struct ObjHeader; namespace kotlin { namespace mm { @@ -49,6 +52,8 @@ public: ShadowStack& shadowStack() noexcept { return shadowStack_; } + KStdVector>& initializingSingletons() noexcept { return initializingSingletons_; } + private: const pthread_t threadId_; GlobalsRegistry::ThreadQueue globalsThreadQueue_; @@ -57,6 +62,7 @@ private: std::atomic state_; ObjectFactory::ThreadQueue objectFactoryThreadQueue_; ShadowStack shadowStack_; + KStdVector> initializingSingletons_; }; } // namespace mm From fde107b181b3f6ac1d57adffdec120cfc6659ffa Mon Sep 17 00:00:00 2001 From: Roman Artemev Date: Thu, 24 Dec 2020 17:26:31 +0300 Subject: [PATCH 202/212] [KLIB] Adapt new klib io API in K/N (cherry picked from commit 70fabb6a9db83db5f5b26b54f2656655316ea31c) --- .../interop/gen/jvm/InteropLibraryCreation.kt | 15 +++++++++------ .../konan/library/impl/KonanLibraryWriterImpl.kt | 15 +++++++++------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/kotlin-native/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/jvm/InteropLibraryCreation.kt b/kotlin-native/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/jvm/InteropLibraryCreation.kt index 9aab4724226..4a0f66c84aa 100644 --- a/kotlin-native/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/jvm/InteropLibraryCreation.kt +++ b/kotlin-native/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/jvm/InteropLibraryCreation.kt @@ -5,15 +5,17 @@ package org.jetbrains.kotlin.native.interop.gen.jvm import kotlinx.metadata.* +import kotlinx.metadata.KmModuleFragment +import kotlinx.metadata.klib.fqName +import kotlinx.metadata.klib.className import kotlinx.metadata.klib.KlibModuleFragmentWriteStrategy import kotlinx.metadata.klib.KlibModuleMetadata -import kotlinx.metadata.klib.className -import kotlinx.metadata.klib.fqName import org.jetbrains.kotlin.backend.common.serialization.KlibIrVersion import org.jetbrains.kotlin.backend.common.serialization.metadata.KlibMetadataVersion import org.jetbrains.kotlin.konan.CURRENT import org.jetbrains.kotlin.konan.CompilerVersion import org.jetbrains.kotlin.konan.file.File +import org.jetbrains.kotlin.konan.library.impl.KonanLibraryLayoutForWriter import org.jetbrains.kotlin.konan.library.impl.KonanLibraryWriterImpl import org.jetbrains.kotlin.konan.target.KonanTarget import org.jetbrains.kotlin.library.KotlinLibraryVersioning @@ -21,7 +23,6 @@ import org.jetbrains.kotlin.library.KotlinAbiVersion import org.jetbrains.kotlin.library.KotlinLibrary import org.jetbrains.kotlin.library.SerializedMetadata import org.jetbrains.kotlin.library.impl.BuiltInsPlatform -import org.jetbrains.kotlin.util.removeSuffixIfPresent import java.util.* fun createInteropLibrary( @@ -43,16 +44,18 @@ fun createInteropLibrary( metadataVersion = KlibMetadataVersion.INSTANCE.toString(), irVersion = KlibIrVersion.INSTANCE.toString() ) - val outputPathWithoutExtension = outputPath.removeSuffixIfPresent(".klib") + val libFile = File(outputPath) + val unzippedDir = if (nopack) libFile else org.jetbrains.kotlin.konan.file.createTempDir(moduleName) + val layout = KonanLibraryLayoutForWriter(libFile, unzippedDir, target) KonanLibraryWriterImpl( - File(outputPathWithoutExtension), moduleName, version, target, BuiltInsPlatform.NATIVE, nopack = nopack, - shortName = shortName + shortName = shortName, + layout = layout ).apply { val serializedMetadata = metadata.write(ChunkingWriteStrategy()) addMetadata(SerializedMetadata(serializedMetadata.header, serializedMetadata.fragments, serializedMetadata.fragmentNames)) diff --git a/kotlin-native/shared/src/library/kotlin/org/jetbrains/kotlin/konan/library/impl/KonanLibraryWriterImpl.kt b/kotlin-native/shared/src/library/kotlin/org/jetbrains/kotlin/konan/library/impl/KonanLibraryWriterImpl.kt index 68dc8ede292..009c25ff286 100644 --- a/kotlin-native/shared/src/library/kotlin/org/jetbrains/kotlin/konan/library/impl/KonanLibraryWriterImpl.kt +++ b/kotlin-native/shared/src/library/kotlin/org/jetbrains/kotlin/konan/library/impl/KonanLibraryWriterImpl.kt @@ -16,15 +16,15 @@ import org.jetbrains.kotlin.library.* import org.jetbrains.kotlin.library.impl.* class KonanLibraryLayoutForWriter( - override val libDir: File, + libFile: File, + unzippedDir: File, override val target: KonanTarget -) : KonanLibraryLayout, KotlinLibraryLayoutForWriter(libDir) +) : KonanLibraryLayout, KotlinLibraryLayoutForWriter(libFile, unzippedDir) /** * Requires non-null [target]. */ class KonanLibraryWriterImpl( - libDir: File, moduleName: String, versions: KotlinLibraryVersioning, target: KonanTarget, @@ -32,7 +32,7 @@ class KonanLibraryWriterImpl( nopack: Boolean = false, shortName: String? = null, - val layout: KonanLibraryLayoutForWriter = KonanLibraryLayoutForWriter(libDir, target), + val layout: KonanLibraryLayoutForWriter, base: BaseWriter = BaseWriterImpl(layout, moduleName, versions, builtInsPlatform, listOf(target.visibleName), nopack, shortName), bitcode: BitcodeWriter = BitcodeWriterImpl(layout), @@ -57,14 +57,17 @@ fun buildLibrary( dataFlowGraph: ByteArray? ): KonanLibraryLayout { + val libFile = File(output) + val unzippedDir = if (nopack) libFile else org.jetbrains.kotlin.konan.file.createTempDir(moduleName) + val layout = KonanLibraryLayoutForWriter(libFile, unzippedDir, target) val library = KonanLibraryWriterImpl( - File(output), moduleName, versions, target, BuiltInsPlatform.NATIVE, nopack, - shortName + shortName, + layout ) library.addMetadata(metadata) From 3127da287f1c4427ba7e9f0dbf9822431fd471cf Mon Sep 17 00:00:00 2001 From: Roman Artemev Date: Thu, 24 Dec 2020 17:34:37 +0300 Subject: [PATCH 203/212] Add `klibOutputFileName(..)` into `OutputFiles.kt` (cherry picked from commit c4511b8b6b8e75f0d7b3f33007da3a75923bd61b) --- .../src/org/jetbrains/kotlin/backend/konan/OutputFiles.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/OutputFiles.kt b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/OutputFiles.kt index 17ab45185c5..14ba4aa8c31 100644 --- a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/OutputFiles.kt +++ b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/OutputFiles.kt @@ -24,6 +24,9 @@ class OutputFiles(outputPath: String?, target: KonanTarget, val produce: Compile val outputName = outputPath?.removeSuffixIfPresent(suffix) ?: produce.visibleName + fun klibOutputFileName(isPacked: Boolean): String = + if (isPacked) "$outputName$suffix" else outputName + /** * Header file for dynamic library. */ From 67fa7c779a01a1fe17f5291ae8e907ff4daa8508 Mon Sep 17 00:00:00 2001 From: Roman Artemev Date: Fri, 25 Dec 2020 10:57:22 +0300 Subject: [PATCH 204/212] Fix klib install gradle task (cherry picked from commit a36abd282efab4568fceb92f8102e13fcac359fd) --- .../org/jetbrains/kotlin/cli/klib/main.kt | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/kotlin-native/klib/src/main/kotlin/org/jetbrains/kotlin/cli/klib/main.kt b/kotlin-native/klib/src/main/kotlin/org/jetbrains/kotlin/cli/klib/main.kt index 591799bc1a8..53c993e74c7 100644 --- a/kotlin-native/klib/src/main/kotlin/org/jetbrains/kotlin/cli/klib/main.kt +++ b/kotlin-native/klib/src/main/kotlin/org/jetbrains/kotlin/cli/klib/main.kt @@ -11,7 +11,6 @@ import org.jetbrains.kotlin.config.LanguageVersion import org.jetbrains.kotlin.config.LanguageVersionSettingsImpl import org.jetbrains.kotlin.descriptors.impl.ModuleDescriptorImpl import org.jetbrains.kotlin.konan.file.File -import org.jetbrains.kotlin.library.KLIB_FILE_EXTENSION_WITH_DOT import org.jetbrains.kotlin.konan.target.Distribution import org.jetbrains.kotlin.konan.target.PlatformManager import org.jetbrains.kotlin.konan.util.DependencyProcessor @@ -27,8 +26,10 @@ import org.jetbrains.kotlin.library.metadata.KlibMetadataProtoBuf import org.jetbrains.kotlin.konan.library.KonanLibrary import org.jetbrains.kotlin.konan.library.resolverByName import org.jetbrains.kotlin.konan.util.KonanHomeProvider +import org.jetbrains.kotlin.library.KLIB_FILE_EXTENSION_WITH_DOT import org.jetbrains.kotlin.library.metadata.parseModuleHeader import org.jetbrains.kotlin.storage.LockBasedStorageManager +import org.jetbrains.kotlin.util.removeSuffixIfPresent import kotlin.system.exitProcess internal val KlibFactories = KlibMetadataFactories(::KonanBuiltIns, DynamicTypeDeserializer, PlatformDependentTypeTransformer.None) @@ -106,11 +107,11 @@ open class ModuleDeserializer(val library: ByteArray) { } -class Library(val name: String, val requestedRepository: String?, val target: String) { +class Library(val libraryNameOrPath: String, val requestedRepository: String?, val target: String) { val repository = requestedRepository?.File() ?: defaultRepository fun info() { - val library = libraryInRepoOrCurrentDir(repository, name) + val library = libraryInRepoOrCurrentDir(repository, libraryNameOrPath) val headerAbiVersion = library.versions.abiVersion val headerCompilerVersion = library.versions.compilerVersion val headerLibraryVersion = library.versions.libraryVersion @@ -139,20 +140,22 @@ class Library(val name: String, val requestedRepository: String?, val target: St repository.mkdirs() } - Library(File(name).name.removeSuffix(KLIB_FILE_EXTENSION_WITH_DOT), requestedRepository, target).remove(true) + val libraryTrueName = File(libraryNameOrPath).name.removeSuffixIfPresent(KLIB_FILE_EXTENSION_WITH_DOT) + val library = libraryInCurrentDir(libraryNameOrPath) - val library = libraryInCurrentDir(name) - val newLibDir = File(repository, library.libraryFile.name.removeSuffix(KLIB_FILE_EXTENSION_WITH_DOT)) + val installLibDir = File(repository, libraryTrueName) - library.libraryFile.unpackZippedKonanLibraryTo(newLibDir) + if (installLibDir.exists) installLibDir.deleteRecursively() + + library.libraryFile.unpackZippedKonanLibraryTo(installLibDir) } fun remove(blind: Boolean = false) { if (!repository.exists) error("Repository does not exist: $repository") val library = try { - val library = libraryInRepo(repository, name) - if (blind) warn("Removing The previously installed $name from $repository.") + val library = libraryInRepo(repository, libraryNameOrPath) + if (blind) warn("Removing The previously installed $libraryNameOrPath from $repository.") library } catch (e: Throwable) { @@ -180,7 +183,7 @@ class Library(val name: String, val requestedRepository: String?, val target: St private fun loadModule(): ModuleDescriptor { val storageManager = LockBasedStorageManager("klib") - val library = libraryInRepoOrCurrentDir(repository, name) + val library = libraryInRepoOrCurrentDir(repository, libraryNameOrPath) val versionSpec = LanguageVersionSettingsImpl(currentLanguageVersion, currentApiVersion) val module = KlibFactories.DefaultDeserializedDescriptorFactory.createDescriptorAndNewBuiltIns(library, versionSpec, storageManager, null) From 64445bb7939fe4dfcb4dbcd845d584508f60f2e5 Mon Sep 17 00:00:00 2001 From: Roman Artemev Date: Fri, 25 Dec 2020 10:57:38 +0300 Subject: [PATCH 205/212] Fix konan klib output setup (cherry picked from commit c75b32ed1a4b8de2801bfece680b6ef7778b6dd5) --- .../jetbrains/kotlin/backend/konan/CompilerOutput.kt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/CompilerOutput.kt b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/CompilerOutput.kt index 7b286069937..5e124b7e4d6 100644 --- a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/CompilerOutput.kt +++ b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/CompilerOutput.kt @@ -129,7 +129,8 @@ internal fun produceOutput(context: Context) { LLVMWriteBitcodeToFile(context.llvmModule!!, output) } CompilerOutputKind.LIBRARY -> { - val output = context.config.outputFiles.outputName + val nopack = config.getBoolean(KonanConfigKeys.NOPACK) + val output = context.config.outputFiles.klibOutputFileName(!nopack) val libraryName = context.config.moduleId val shortLibraryName = context.config.shortModuleName val neededLibraries = context.librariesWithDependencies @@ -146,9 +147,15 @@ internal fun produceOutput(context: Context) { irVersion = irVersion ) val target = context.config.target - val nopack = config.getBoolean(KonanConfigKeys.NOPACK) val manifestProperties = context.config.manifestProperties + if (!nopack) { + val suffix = context.config.outputFiles.produce.suffix(target) + if (!output.endsWith(suffix)) { + error("please specify correct output: packed: ${!nopack}, $output$suffix") + } + } + val library = buildLibrary( context.config.nativeLibraries, context.config.includeBinaries, From 58ea71cb0ef1ce539173b4fb2d139a3a7f3eb495 Mon Sep 17 00:00:00 2001 From: Alexander Gorshenev Date: Thu, 14 Jan 2021 05:23:05 +0300 Subject: [PATCH 206/212] Made test runner work with binary compatibility tests (cherry picked from commit e0b599a632b94e4b1303fc94275dcd5b6a7dfb6b) --- .../backend.native/tests/build.gradle | 1 + .../org/jetbrains/kotlin/KonanTest.groovy | 84 ++++++++++++++----- .../org/jetbrains/kotlin/TestDirectives.kt | 48 +++++++++-- 3 files changed, 102 insertions(+), 31 deletions(-) diff --git a/kotlin-native/backend.native/tests/build.gradle b/kotlin-native/backend.native/tests/build.gradle index b6103d957d6..12f3fdda098 100644 --- a/kotlin-native/backend.native/tests/build.gradle +++ b/kotlin-native/backend.native/tests/build.gradle @@ -220,6 +220,7 @@ def update_external_tests() { include 'compiler/codegen/box/**' include 'compiler/codegen/boxInline/**' include 'compiler/compileKotlinAgainstKotlin/**' + include 'compiler/binaryCompatibility/klibEvolution/**' exclude 'stdlib/**' } } diff --git a/kotlin-native/build-tools/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy b/kotlin-native/build-tools/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy index 749ee1436b3..87c7690c7da 100644 --- a/kotlin-native/build-tools/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy +++ b/kotlin-native/build-tools/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy @@ -22,6 +22,7 @@ import org.gradle.api.tasks.TaskAction import org.gradle.process.ExecResult import org.jetbrains.kotlin.utils.DFS +import java.io.File import java.nio.file.Paths import java.util.function.Function import java.util.function.UnaryOperator @@ -469,6 +470,59 @@ fun runTest() { } } + class MultiModuleCompilerInvocations { + String executablePath + Map modules + List flags + + MultiModuleCompilerInvocations(String executablePath, Map modules, List flags) { + this.executablePath = executablePath + this.modules = modules + this.flags = flags + } + + def libs = new HashSet() + + String moduleToKlibName(String moduleName, Integer version) { + def module = modules[moduleName] + // TODO: cleanup + def versionSuffix = module.hasVersions ? "_version${version}" : "" + return module.hasVersions ? "${executablePath}${versionSuffix}/${moduleName}.klib" : "${executablePath}.${moduleName}.klib" + } + + void produceLibrary(TestModule module, Integer moduleVersion, Integer dependencyVersion) { + def klibModulePath = moduleToKlibName(module.name, moduleVersion) + libs.addAll(module.dependencies) + def klibs = module.dependencies.collectMany { ["-l", moduleToKlibName(it, dependencyVersion)] }.toList() + def repos = ["-r", "${executablePath}_version${dependencyVersion}", "-r", project.file(executablePath).parentFile.absolutePath ] + + def friends = module.friends ? + module.friends.collectMany { + ["-friend-modules", "${executablePath}.${it}.klib"] + }.toList() : [] + runCompiler(module.versionFiles(moduleVersion).collect { it.path }, + klibModulePath, flags + ["-p", "library"/*, "-module-name", module.name*/] + repos + klibs + friends) + } + + void produceProgram(List compileList, Integer version) { + def compileMain = compileList.findAll { + it.module.isDefaultModule() || it.module == TestModule.support + } + compileMain.forEach { f -> + libs.addAll(f.module.dependencies) + } + def friends = compileMain.collectMany { it.module.friends }.toSet() + def repos = ["-r", "${executablePath}_version${version}", "-r", project.file(executablePath).parentFile.absolutePath] + + if (!compileMain.empty) { + runCompiler(compileMain.collect { it.path }, executablePath, flags + repos + + libs.collectMany { ["-l", moduleToKlibName(it, version)] }.toList() + + friends.collectMany { ["-friend-modules", "${executablePath}.${it}.klib"] }.toList() + ) + } + } + } + @TaskAction void executeTest() { createOutputDirectory() @@ -519,34 +573,18 @@ fun runTest() { List orderedModules = DFS.INSTANCE.topologicalOrder(modules.values()) { module -> module.dependencies.collect { modules[it] }.findAll { it != null } } - Set libs = new HashSet() + def compiler = new MultiModuleCompilerInvocations(executablePath(), modules, flags) + orderedModules.reverse().each { module -> if (!module.isDefaultModule()) { - def klibModulePath = "${executablePath()}.${module.name}.klib" - libs.addAll(module.dependencies) - def klibs = libs.collectMany { ["-l", "${executablePath()}.${it}.klib"] }.toList() - def friends = module.friends ? - module.friends.collectMany { - ["-friend-modules", "${executablePath()}.${it}.klib"] - }.toList() : [] - runCompiler(compileList.findAll { it.module == module }.collect { it.path }, - klibModulePath, flags + ["-p", "library"] + klibs + friends) + compiler.produceLibrary(module, 1, 1) + if (module.hasVersions) { + compiler.produceLibrary(module, 2, 1) + } } } - def compileMain = compileList.findAll { - it.module.isDefaultModule() || it.module == TestModule.support - } - compileMain.forEach { f -> - libs.addAll(f.module.dependencies) - } - def friends = compileMain.collectMany {it.module.friends }.toSet() - if (!compileMain.empty) { - runCompiler(compileMain.collect { it.path }, executablePath(), flags + - libs.collectMany { ["-l", "${executablePath()}.${it}.klib"] }.toList() + - friends.collectMany {["-friend-modules", "${executablePath()}.${it}.klib"]}.toList() - ) - } + compiler.produceProgram(compileList, 2) } } catch (Exception ex) { project.logger.quiet("ERROR: Compilation failed for test suite: $name with exception", ex) diff --git a/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/TestDirectives.kt b/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/TestDirectives.kt index 6621b68b42e..c604b49b009 100644 --- a/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/TestDirectives.kt +++ b/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/TestDirectives.kt @@ -5,15 +5,21 @@ package org.jetbrains.kotlin +import org.jetbrains.kotlin.TestModule.Companion.default +import org.jetbrains.kotlin.TestModule.Companion.support import java.nio.file.Path import java.nio.file.Paths +import java.util.regex.Matcher import java.util.regex.Pattern private const val MODULE_DELIMITER = ",\\s*" -// This pattern is a copy from the kotlin/compiler/tests-common/tests/org/jetbrains/kotlin/test/TestFiles.java +// These patterns are copies from +// kotlin/compiler/tests-common/tests/org/jetbrains/kotlin/test/TestFiles.java +// kotlin/compiler/tests-common/tests/org/jetbrains/kotlin/test/KotlinTestUtils.java private val FILE_OR_MODULE_PATTERN: Pattern = Pattern.compile("(?://\\s*MODULE:\\s*([^()\\n]+)(?:\\(([^()]+(?:" + "$MODULE_DELIMITER[^()]+)*)\\))?\\s*(?:\\(([^()]+(?:$MODULE_DELIMITER[^()]+)*)\\))?\\s*)?//\\s*FILE:\\s*(.*)$", Pattern.MULTILINE) +private val DIRECTIVE_PATTERN = Pattern.compile("^//\\s*[!]?([A-Z_]+)(:[ \\t]*(.*))?$", Pattern.MULTILINE) /** * Creates test files from the given source file that may contain different test directives. @@ -82,12 +88,16 @@ private fun String?.parseModuleList() = this * - [support] for a helper sources like Coroutines support. */ data class TestModule( - val name: String, - val dependencies: List, - val friends: List + val name: String, + val dependencies: List, + val friends: List ) { + val files = mutableListOf() fun isDefaultModule() = this == default || name.endsWith(".main") + val hasVersions get() = this.files.any { it.version != null } + fun versionFiles(version: Int) = this.files.filter { it.version == null || it.version == version } + companion object { val default = TestModule("default", emptyList(), emptyList()) val support = TestModule("support", emptyList(), emptyList()) @@ -97,11 +107,33 @@ data class TestModule( /** * Represent a single test file that belongs to the [module]. */ -data class TestFile(val name: String, - val path: String, - var text: String = "", - val module: TestModule = TestModule.default +data class TestFile( + val name: String, + val path: String, + var text: String = "", + val module: TestModule = TestModule.default ) { + init { + this.module.files.add(this) + } + + val directives: Map by lazy { + parseDirectives() + } + + val version: Int? get() = this.directives["VERSION"]?.toInt() + + fun parseDirectives(): Map { + val newDirectives = mutableMapOf() + val directiveMatcher: Matcher = DIRECTIVE_PATTERN.matcher(text) + while (directiveMatcher.find()) { + val name = directiveMatcher.group(1) + val value = directiveMatcher.group(3) + newDirectives.put(name, value) + } + return newDirectives + } + /** * Writes [text] to the file created from the [path]. */ From ec024cee53da7398a21a2462ea1ec848dcf654fb Mon Sep 17 00:00:00 2001 From: Alexander Gorshenev Date: Fri, 15 Jan 2021 00:48:21 +0300 Subject: [PATCH 207/212] Extracted multi-module compiler runner for external tests to a separate kotlin file. (cherry picked from commit 4fd88e4d33d8f80370b3ba4eee4c64869c1f1734) --- .../org/jetbrains/kotlin/KonanTest.groovy | 68 ++------------- .../org/jetbrains/kotlin/MultiModule.kt | 84 +++++++++++++++++++ 2 files changed, 90 insertions(+), 62 deletions(-) create mode 100644 kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/MultiModule.kt diff --git a/kotlin-native/build-tools/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy b/kotlin-native/build-tools/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy index 87c7690c7da..44c275bfe3f 100644 --- a/kotlin-native/build-tools/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy +++ b/kotlin-native/build-tools/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy @@ -22,14 +22,13 @@ import org.gradle.api.tasks.TaskAction import org.gradle.process.ExecResult import org.jetbrains.kotlin.utils.DFS -import java.io.File import java.nio.file.Paths import java.util.function.Function import java.util.function.UnaryOperator import java.util.regex.Pattern import java.util.stream.Collectors -class RunExternalTestGroup extends JavaExec { +class RunExternalTestGroup extends JavaExec implements CompilerRunner { def platformManager = project.rootProject.platformManager def target = platformManager.targetManager(project.testTarget).target def dist = UtilsKt.getKotlinNativeDist(project) @@ -75,7 +74,8 @@ class RunExternalTestGroup extends JavaExec { // configuration part at runCompiler. } - protected void runCompiler(List filesToCompile, String output, List moreArgs) { + @Override + void runCompiler(List filesToCompile, String output, List moreArgs) { def log = new ByteArrayOutputStream() try { classpath = project.fileTree("$dist.canonicalPath/konan/lib/") { @@ -470,59 +470,6 @@ fun runTest() { } } - class MultiModuleCompilerInvocations { - String executablePath - Map modules - List flags - - MultiModuleCompilerInvocations(String executablePath, Map modules, List flags) { - this.executablePath = executablePath - this.modules = modules - this.flags = flags - } - - def libs = new HashSet() - - String moduleToKlibName(String moduleName, Integer version) { - def module = modules[moduleName] - // TODO: cleanup - def versionSuffix = module.hasVersions ? "_version${version}" : "" - return module.hasVersions ? "${executablePath}${versionSuffix}/${moduleName}.klib" : "${executablePath}.${moduleName}.klib" - } - - void produceLibrary(TestModule module, Integer moduleVersion, Integer dependencyVersion) { - def klibModulePath = moduleToKlibName(module.name, moduleVersion) - libs.addAll(module.dependencies) - def klibs = module.dependencies.collectMany { ["-l", moduleToKlibName(it, dependencyVersion)] }.toList() - def repos = ["-r", "${executablePath}_version${dependencyVersion}", "-r", project.file(executablePath).parentFile.absolutePath ] - - def friends = module.friends ? - module.friends.collectMany { - ["-friend-modules", "${executablePath}.${it}.klib"] - }.toList() : [] - runCompiler(module.versionFiles(moduleVersion).collect { it.path }, - klibModulePath, flags + ["-p", "library"/*, "-module-name", module.name*/] + repos + klibs + friends) - } - - void produceProgram(List compileList, Integer version) { - def compileMain = compileList.findAll { - it.module.isDefaultModule() || it.module == TestModule.support - } - compileMain.forEach { f -> - libs.addAll(f.module.dependencies) - } - def friends = compileMain.collectMany { it.module.friends }.toSet() - def repos = ["-r", "${executablePath}_version${version}", "-r", project.file(executablePath).parentFile.absolutePath] - - if (!compileMain.empty) { - runCompiler(compileMain.collect { it.path }, executablePath, flags + repos + - libs.collectMany { ["-l", moduleToKlibName(it, version)] }.toList() + - friends.collectMany { ["-friend-modules", "${executablePath}.${it}.klib"] }.toList() - ) - } - } - } - @TaskAction void executeTest() { createOutputDirectory() @@ -573,18 +520,15 @@ fun runTest() { List orderedModules = DFS.INSTANCE.topologicalOrder(modules.values()) { module -> module.dependencies.collect { modules[it] }.findAll { it != null } } - def compiler = new MultiModuleCompilerInvocations(executablePath(), modules, flags) + def compiler = new MultiModuleCompilerInvocations(this, outputDirectory, executablePath(), modules, flags) orderedModules.reverse().each { module -> if (!module.isDefaultModule()) { - compiler.produceLibrary(module, 1, 1) - if (module.hasVersions) { - compiler.produceLibrary(module, 2, 1) - } + compiler.produceLibrary(module) } } - compiler.produceProgram(compileList, 2) + compiler.produceProgram(compileList) } } catch (Exception ex) { project.logger.quiet("ERROR: Compilation failed for test suite: $name with exception", ex) diff --git a/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/MultiModule.kt b/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/MultiModule.kt new file mode 100644 index 00000000000..6ee53cb13d3 --- /dev/null +++ b/kotlin-native/build-tools/src/main/kotlin/org/jetbrains/kotlin/MultiModule.kt @@ -0,0 +1,84 @@ +package org.jetbrains.kotlin + +interface CompilerRunner { + fun runCompiler(filesToCompile: List, output: String, moreArgs: List) +} + +// This class knows how to run the compiler for multi-module external tests. +// +// In addition it knows how to deal with multi-versioned modules. +// The versioned modules are used for binary compatibility testing. +// For such modules we produce two klibs: +// `version1/foo.klib` and `version2/foo.klib`. +// For un-versioned modules we still produce just `bar.klib` +// We link all klibs against `version1/foo.klib` and `bar.klib` +// We link the final executable against `version2/foo.klib` and `bar.klib`. + +class MultiModuleCompilerInvocations( + val konanTest: CompilerRunner, + val outputDirectory: String, + val executablePath: String, + val modules: Map, + val flags: List +) { + val libs = HashSet() + + fun moduleToKlibName(moduleName: String, version: Int): String { + val module = modules[moduleName] ?: error("Could not find module $moduleName") + + return if (module.hasVersions) { + val versionSuffix = "_version$version" + "$executablePath$versionSuffix/$moduleName.klib" + } else { + "$executablePath.$moduleName.klib" + } + } + + private fun produceLibrary(module: TestModule, moduleVersion: Int) { + val klibModulePath = moduleToKlibName(module.name, moduleVersion) + libs.addAll(module.dependencies) + + // When producing klibs link them against version 1 of multiversioned klibs. + val dependencyVersion = 1 + + val klibs = module.dependencies.flatMap { listOf("-l", moduleToKlibName(it, dependencyVersion)) } + val repos = listOf("-r", "${executablePath}_version$dependencyVersion", "-r", outputDirectory) + + val friends = module.friends.flatMap { + listOf("-friend-modules", "$executablePath.$it.klib") + } + konanTest.runCompiler(module.versionFiles(moduleVersion).map { it.path }, + klibModulePath, flags + listOf("-p", "library") + repos + klibs + friends) + } + + fun produceLibrary(module: TestModule) { + if (!module.hasVersions) { + produceLibrary(module, 1) + } else { + produceLibrary(module, 1) + produceLibrary(module, 2) + } + } + + fun produceProgram(compileList: List) { + val compileMain = compileList.filter { + it.module.isDefaultModule() || it.module === TestModule.support + } + compileMain.forEach { f -> + libs.addAll(f.module.dependencies) + } + + // When producing klibs link them against version 2 of multiversioned klibs. + val dependencyVersion = 2 + + val friends = compileMain.flatMap { it.module.friends }.toSet() + val repos = listOf("-r", "${executablePath}_version$dependencyVersion", "-r", outputDirectory) + + if (compileMain.isNotEmpty()) { + konanTest.runCompiler(compileMain.map { it.path }, executablePath, flags + repos + + libs.flatMap { listOf("-l", moduleToKlibName(it, dependencyVersion)) } + + friends.flatMap { listOf("-friend-modules", "${executablePath}.${it}.klib") } + ) + } + } +} From e63b405f58185b52c3a604c19fb8a4d8c3450b75 Mon Sep 17 00:00:00 2001 From: Abduqodiri Qurbonzoda Date: Fri, 16 Oct 2020 01:52:36 +0300 Subject: [PATCH 208/212] Commonize CharCategory and related functions #KT-39177 #KT-43216 #KT-39906 #KT-30652 (cherry picked from commit fc5c01b9a72498f9bd200817936a629689c0bff0) --- .../backend.native/tests/runtime/text/trim.kt | 2 +- kotlin-native/runtime/generator/build.gradle | 7 + .../runtime/src/main/cpp/KString.cpp | 429 ------------------ .../main/kotlin/generated/_CharCategories.kt | 184 ++++++++ .../src/main/kotlin/generated/_DigitChars.kt | 46 ++ .../src/main/kotlin/generated/_LetterChars.kt | 130 ++++++ .../main/kotlin/generated/_WhitespaceChars.kt | 31 ++ .../src/main/kotlin/kotlin/text/Char.kt | 128 +++++- .../main/kotlin/kotlin/text/CharCategory.kt | 18 +- 9 files changed, 512 insertions(+), 463 deletions(-) create mode 100644 kotlin-native/runtime/src/main/kotlin/generated/_CharCategories.kt create mode 100644 kotlin-native/runtime/src/main/kotlin/generated/_DigitChars.kt create mode 100644 kotlin-native/runtime/src/main/kotlin/generated/_LetterChars.kt create mode 100644 kotlin-native/runtime/src/main/kotlin/generated/_WhitespaceChars.kt diff --git a/kotlin-native/backend.native/tests/runtime/text/trim.kt b/kotlin-native/backend.native/tests/runtime/text/trim.kt index 0fd5c149139..9b61a870769 100644 --- a/kotlin-native/backend.native/tests/runtime/text/trim.kt +++ b/kotlin-native/backend.native/tests/runtime/text/trim.kt @@ -48,7 +48,7 @@ private fun trimWhitespaces() { assertEquals(expected = "String", actual = "\u0020 \u202FString\u2028\u2029".trim(), message = "Trim special whitespaces") - assertEquals(expected = "\u1FFFString", actual = "\u0085 \u1FFFString".trim(), + assertEquals(expected = "\u1FFFString", actual = "\u00A0 \u1FFFString".trim(), message = "Trim special whitespace but should left a unicode symbol") assertEquals(expected = "String\tSTR", actual = " \nString\tSTR ".trim(), message = "Trim newline") } diff --git a/kotlin-native/runtime/generator/build.gradle b/kotlin-native/runtime/generator/build.gradle index e5d2cfe32b8..33a21a1af2b 100644 --- a/kotlin-native/runtime/generator/build.gradle +++ b/kotlin-native/runtime/generator/build.gradle @@ -17,4 +17,11 @@ task run(type: JavaExec) { main 'generators.GenerateStandardLibKt' classpath configurations.generatorRuntime args = ["native", "${project(":runtime").projectDir}/src/main/kotlin/generated"] +} + +task generateUnicodeData(type: JavaExec) { + group 'application' + main 'generators.unicode.GenerateUnicodeDataKt' + classpath configurations.generatorRuntime + args = ["native", "${project(":runtime").projectDir}/src/main/kotlin/generated"] } \ No newline at end of file diff --git a/kotlin-native/runtime/src/main/cpp/KString.cpp b/kotlin-native/runtime/src/main/cpp/KString.cpp index 3f96007b706..63b37549675 100644 --- a/kotlin-native/runtime/src/main/cpp/KString.cpp +++ b/kotlin-native/runtime/src/main/cpp/KString.cpp @@ -79,198 +79,6 @@ OBJ_GETTER(utf8ToUtf16, const char* rawString, size_t rawStringLength) { RETURN_RESULT_OF(utf8ToUtf16Impl, rawString, end, charCount); } - -// Case conversion is derived work from Apache Harmony. -// Unicode 3.0.1 (same as Unicode 3.0.0) -enum CharacterClass { - /** - * Unicode category constant Cn. - */ - UNASSIGNED = 0, - /** - * Unicode category constant Lu. - */ - UPPERCASE_LETTER = 1, - /** - * Unicode category constant Ll. - */ - LOWERCASE_LETTER = 2, - /** - * Unicode category constant Lt. - */ - TITLECASE_LETTER = 3, - /** - * Unicode category constant Lm. - */ - MODIFIER_LETTER = 4, - /** - * Unicode category constant Lo. - */ - OTHER_LETTER = 5, - /** - * Unicode category constant Mn. - */ - NON_SPACING_MARK = 6, - /** - * Unicode category constant Me. - */ - ENCLOSING_MARK = 7, - /** - * Unicode category constant Mc. - */ - COMBINING_SPACING_MARK = 8, - /** - * Unicode category constant Nd. - */ - DECIMAL_DIGIT_NUMBER = 9, - /** - * Unicode category constant Nl. - */ - LETTER_NUMBER = 10, - /** - * Unicode category constant No. - */ - OTHER_NUMBER = 11, - /** - * Unicode category constant Zs. - */ - SPACE_SEPARATOR = 12, - /** - * Unicode category constant Zl. - */ - LINE_SEPARATOR = 13, - /** - * Unicode category constant Zp. - */ - PARAGRAPH_SEPARATOR = 14, - /** - * Unicode category constant Cc. - */ - CONTROL = 15, - /** - * Unicode category constant Cf. - */ - FORMAT = 16, - /** - * Unicode category constant Co. - */ - PRIVATE_USE = 18, - /** - * Unicode category constant Cs. - */ - SURROGATE = 19, - /** - * Unicode category constant Pd. - */ - DASH_PUNCTUATION = 20, - /** - * Unicode category constant Ps. - */ - START_PUNCTUATION = 21, - /** - * Unicode category constant Pe. - */ - END_PUNCTUATION = 22, - /** - * Unicode category constant Pc. - */ - CONNECTOR_PUNCTUATION = 23, - /** - * Unicode category constant Po. - */ - OTHER_PUNCTUATION = 24, - /** - * Unicode category constant Sm. - */ - MATH_SYMBOL = 25, - /** - * Unicode category constant Sc. - */ - CURRENCY_SYMBOL = 26, - /** - * Unicode category constant Sk. - */ - MODIFIER_SYMBOL = 27, - /** - * Unicode category constant So. - */ - OTHER_SYMBOL = 28, - /** - * Unicode category constant Pi. - */ - INITIAL_QUOTE_PUNCTUATION = 29, - /** - * Unicode category constant Pf. - */ - FINAL_QUOTE_PUNCTUATION = 30 -}; - -constexpr KByte typeValuesCache[] = { - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 12, 24, 24, 24, 26, 24, 24, 24, 21, 22, 24, 25, 24, 20, 24, 24, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 24, 24, 25, 25, 25, 24, - 24, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 21, 24, 22, 27, 23, - 27, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 21, 25, 22, 25, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 12, 24, 26, 26, 26, 26, 28, 28, 27, 28, 2, 29, 25, 16, 28, 27, - 28, 25, 11, 11, 27, 2, 28, 24, 27, 11, 2, 30, 11, 11, 11, 24, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 25, 1, 1, 1, 1, 1, 1, 1, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 25, 2, 2, 2, 2, 2, 2, 2, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1, - 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 2, - 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 1, 2, 2, 1, 1, - 1, 1, 2, 1, 1, 2, 1, 1, 1, 2, 2, 2, 1, 1, 2, 1, - 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, - 2, 1, 1, 1, 2, 1, 2, 1, 1, 2, 2, 5, 1, 2, 2, 2, - 5, 5, 5, 5, 1, 3, 2, 1, 3, 2, 1, 3, 2, 1, 2, 1, - 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 2, 1, 3, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 27, 27, 27, 27, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 4, 4, 4, 4, 4, 27, 27, 27, 27, 27, 27, 27, 27, 27, 4, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 0, 0, 0, 0, 0, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 0, 0, 0, 0, 27, 27, 0, 0, 0, 0, 4, 0, 0, 0, 24, 0, - 0, 0, 0, 0, 27, 27, 1, 24, 1, 1, 1, 0, 1, 0, 1, 1, - 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, - 2, 2, 1, 1, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, - 1, 2, 1, 2, 1, 2, 1, 2 -}; - constexpr KShort uppercaseValuesCache[] = { 924, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, @@ -436,143 +244,6 @@ constexpr KChar digitValues[] = { 0x1819, 0x1810, 0xff19, 0xff10, 0xff3a, 0xff17, 0xff5a, 0xff37 }; -constexpr KChar typeKeys[] = { - 0x0, 0x20, 0x22, 0x24, 0x26, 0x28, 0x2a, 0x2d, 0x2f, 0x31, 0x3a, 0x3c, 0x3f, 0x41, 0x5b, 0x5d, 0x5f, 0x61, 0x7b, 0x7d, - 0x7f, 0xa0, 0xa2, 0xa6, 0xa8, 0xaa, 0xac, 0xae, 0xb1, 0xb3, 0xb5, 0xb7, 0xb9, 0xbb, 0xbd, 0xbf, 0xc1, 0xd7, 0xd9, 0xdf, - 0xf7, 0xf9, 0x100, 0x138, 0x149, 0x179, 0x17f, 0x181, 0x183, 0x187, 0x18a, 0x18c, 0x18e, 0x192, 0x194, 0x197, 0x199, 0x19c, 0x19e, 0x1a0, - 0x1a7, 0x1ab, 0x1af, 0x1b2, 0x1b4, 0x1b8, 0x1ba, 0x1bc, 0x1be, 0x1c0, 0x1c4, 0x1c6, 0x1c8, 0x1ca, 0x1cc, 0x1dd, 0x1f0, 0x1f2, 0x1f4, 0x1f7, - 0x1f9, 0x222, 0x250, 0x2b0, 0x2b9, 0x2bb, 0x2c2, 0x2d0, 0x2d2, 0x2e0, 0x2e5, 0x2ee, 0x300, 0x360, 0x374, 0x37a, 0x37e, 0x384, 0x386, 0x389, - 0x38c, 0x38e, 0x390, 0x392, 0x3a3, 0x3ac, 0x3d0, 0x3d2, 0x3d5, 0x3da, 0x3f0, 0x400, 0x430, 0x460, 0x482, 0x484, 0x488, 0x48c, 0x4c1, 0x4c7, - 0x4cb, 0x4d0, 0x4f8, 0x531, 0x559, 0x55b, 0x561, 0x589, 0x591, 0x5a3, 0x5bb, 0x5be, 0x5c2, 0x5d0, 0x5f0, 0x5f3, 0x60c, 0x61b, 0x61f, 0x621, - 0x640, 0x642, 0x64b, 0x660, 0x66a, 0x670, 0x672, 0x6d4, 0x6d6, 0x6dd, 0x6df, 0x6e5, 0x6e7, 0x6e9, 0x6eb, 0x6f0, 0x6fa, 0x6fd, 0x700, 0x70f, - 0x711, 0x713, 0x730, 0x780, 0x7a6, 0x901, 0x903, 0x905, 0x93c, 0x93e, 0x941, 0x949, 0x94d, 0x950, 0x952, 0x958, 0x962, 0x964, 0x966, 0x970, - 0x981, 0x983, 0x985, 0x98f, 0x993, 0x9aa, 0x9b2, 0x9b6, 0x9bc, 0x9be, 0x9c1, 0x9c7, 0x9cb, 0x9cd, 0x9d7, 0x9dc, 0x9df, 0x9e2, 0x9e6, 0x9f0, - 0x9f2, 0x9f4, 0x9fa, 0xa02, 0xa05, 0xa0f, 0xa13, 0xa2a, 0xa32, 0xa35, 0xa38, 0xa3c, 0xa3e, 0xa41, 0xa47, 0xa4b, 0xa59, 0xa5e, 0xa66, 0xa70, - 0xa72, 0xa81, 0xa83, 0xa85, 0xa8d, 0xa8f, 0xa93, 0xaaa, 0xab2, 0xab5, 0xabc, 0xabe, 0xac1, 0xac7, 0xac9, 0xacb, 0xacd, 0xad0, 0xae0, 0xae6, - 0xb01, 0xb03, 0xb05, 0xb0f, 0xb13, 0xb2a, 0xb32, 0xb36, 0xb3c, 0xb3e, 0xb42, 0xb47, 0xb4b, 0xb4d, 0xb56, 0xb5c, 0xb5f, 0xb66, 0xb70, 0xb82, - 0xb85, 0xb8e, 0xb92, 0xb99, 0xb9c, 0xb9e, 0xba3, 0xba8, 0xbae, 0xbb7, 0xbbe, 0xbc0, 0xbc2, 0xbc6, 0xbca, 0xbcd, 0xbd7, 0xbe7, 0xbf0, 0xc01, - 0xc05, 0xc0e, 0xc12, 0xc2a, 0xc35, 0xc3e, 0xc41, 0xc46, 0xc4a, 0xc55, 0xc60, 0xc66, 0xc82, 0xc85, 0xc8e, 0xc92, 0xcaa, 0xcb5, 0xcbe, 0xcc1, - 0xcc6, 0xcc8, 0xcca, 0xccc, 0xcd5, 0xcde, 0xce0, 0xce6, 0xd02, 0xd05, 0xd0e, 0xd12, 0xd2a, 0xd3e, 0xd41, 0xd46, 0xd4a, 0xd4d, 0xd57, 0xd60, - 0xd66, 0xd82, 0xd85, 0xd9a, 0xdb3, 0xdbd, 0xdc0, 0xdca, 0xdcf, 0xdd2, 0xdd6, 0xdd8, 0xdf2, 0xdf4, 0xe01, 0xe31, 0xe33, 0xe35, 0xe3f, 0xe41, - 0xe46, 0xe48, 0xe4f, 0xe51, 0xe5a, 0xe81, 0xe84, 0xe87, 0xe8a, 0xe8d, 0xe94, 0xe99, 0xea1, 0xea5, 0xea7, 0xeaa, 0xead, 0xeb1, 0xeb3, 0xeb5, - 0xebb, 0xebd, 0xec0, 0xec6, 0xec8, 0xed0, 0xedc, 0xf00, 0xf02, 0xf04, 0xf13, 0xf18, 0xf1a, 0xf20, 0xf2a, 0xf34, 0xf3a, 0xf3e, 0xf40, 0xf49, - 0xf71, 0xf7f, 0xf81, 0xf85, 0xf87, 0xf89, 0xf90, 0xf99, 0xfbe, 0xfc6, 0xfc8, 0xfcf, 0x1000, 0x1023, 0x1029, 0x102c, 0x102e, 0x1031, 0x1036, 0x1038, - 0x1040, 0x104a, 0x1050, 0x1056, 0x1058, 0x10a0, 0x10d0, 0x10fb, 0x1100, 0x115f, 0x11a8, 0x1200, 0x1208, 0x1248, 0x124a, 0x1250, 0x1258, 0x125a, 0x1260, 0x1288, - 0x128a, 0x1290, 0x12b0, 0x12b2, 0x12b8, 0x12c0, 0x12c2, 0x12c8, 0x12d0, 0x12d8, 0x12f0, 0x1310, 0x1312, 0x1318, 0x1320, 0x1348, 0x1361, 0x1369, 0x1372, 0x13a0, - 0x1401, 0x166d, 0x166f, 0x1680, 0x1682, 0x169b, 0x16a0, 0x16eb, 0x16ee, 0x1780, 0x17b4, 0x17b7, 0x17be, 0x17c6, 0x17c8, 0x17ca, 0x17d4, 0x17db, 0x17e0, 0x1800, - 0x1806, 0x1808, 0x180b, 0x1810, 0x1820, 0x1843, 0x1845, 0x1880, 0x18a9, 0x1e00, 0x1e96, 0x1ea0, 0x1f00, 0x1f08, 0x1f10, 0x1f18, 0x1f20, 0x1f28, 0x1f30, 0x1f38, - 0x1f40, 0x1f48, 0x1f50, 0x1f59, 0x1f5b, 0x1f5d, 0x1f5f, 0x1f61, 0x1f68, 0x1f70, 0x1f80, 0x1f88, 0x1f90, 0x1f98, 0x1fa0, 0x1fa8, 0x1fb0, 0x1fb6, 0x1fb8, 0x1fbc, - 0x1fbe, 0x1fc0, 0x1fc2, 0x1fc6, 0x1fc8, 0x1fcc, 0x1fce, 0x1fd0, 0x1fd6, 0x1fd8, 0x1fdd, 0x1fe0, 0x1fe8, 0x1fed, 0x1ff2, 0x1ff6, 0x1ff8, 0x1ffc, 0x1ffe, 0x2000, - 0x200c, 0x2010, 0x2016, 0x2018, 0x201a, 0x201c, 0x201e, 0x2020, 0x2028, 0x202a, 0x202f, 0x2031, 0x2039, 0x203b, 0x203f, 0x2041, 0x2044, 0x2046, 0x2048, 0x206a, - 0x2070, 0x2074, 0x207a, 0x207d, 0x207f, 0x2081, 0x208a, 0x208d, 0x20a0, 0x20d0, 0x20dd, 0x20e1, 0x20e3, 0x2100, 0x2102, 0x2104, 0x2107, 0x2109, 0x210b, 0x210e, - 0x2110, 0x2113, 0x2115, 0x2117, 0x2119, 0x211e, 0x2124, 0x212b, 0x212e, 0x2130, 0x2132, 0x2134, 0x2136, 0x2139, 0x2153, 0x2160, 0x2190, 0x2195, 0x219a, 0x219c, - 0x21a0, 0x21a2, 0x21a5, 0x21a8, 0x21ae, 0x21b0, 0x21ce, 0x21d0, 0x21d2, 0x21d6, 0x2200, 0x2300, 0x2308, 0x230c, 0x2320, 0x2322, 0x2329, 0x232b, 0x237d, 0x2400, - 0x2440, 0x2460, 0x249c, 0x24ea, 0x2500, 0x25a0, 0x25b7, 0x25b9, 0x25c1, 0x25c3, 0x2600, 0x2619, 0x266f, 0x2671, 0x2701, 0x2706, 0x270c, 0x2729, 0x274d, 0x274f, - 0x2756, 0x2758, 0x2761, 0x2776, 0x2794, 0x2798, 0x27b1, 0x2800, 0x2e80, 0x2e9b, 0x2f00, 0x2ff0, 0x3000, 0x3002, 0x3004, 0x3006, 0x3008, 0x3012, 0x3014, 0x301c, - 0x301e, 0x3020, 0x3022, 0x302a, 0x3030, 0x3032, 0x3036, 0x3038, 0x303e, 0x3041, 0x3099, 0x309b, 0x309d, 0x30a1, 0x30fb, 0x30fd, 0x3105, 0x3131, 0x3190, 0x3192, - 0x3196, 0x31a0, 0x3200, 0x3220, 0x322a, 0x3260, 0x327f, 0x3281, 0x328a, 0x32c0, 0x32d0, 0x3300, 0x337b, 0x33e0, 0x3400, 0x4e00, 0xa000, 0xa490, 0xa4a4, 0xa4b5, - 0xa4c2, 0xa4c6, 0xac00, 0xd800, 0xe000, 0xf900, 0xfb00, 0xfb13, 0xfb1d, 0xfb20, 0xfb29, 0xfb2b, 0xfb38, 0xfb3e, 0xfb40, 0xfb43, 0xfb46, 0xfbd3, 0xfd3e, 0xfd50, - 0xfd92, 0xfdf0, 0xfe20, 0xfe30, 0xfe32, 0xfe34, 0xfe36, 0xfe49, 0xfe4d, 0xfe50, 0xfe54, 0xfe58, 0xfe5a, 0xfe5f, 0xfe62, 0xfe65, 0xfe68, 0xfe6b, 0xfe70, 0xfe74, - 0xfe76, 0xfeff, 0xff01, 0xff04, 0xff06, 0xff08, 0xff0a, 0xff0d, 0xff0f, 0xff11, 0xff1a, 0xff1c, 0xff1f, 0xff21, 0xff3b, 0xff3d, 0xff3f, 0xff41, 0xff5b, 0xff5d, - 0xff61, 0xff63, 0xff65, 0xff67, 0xff70, 0xff72, 0xff9e, 0xffa0, 0xffc2, 0xffca, 0xffd2, 0xffda, 0xffe0, 0xffe2, 0xffe4, 0xffe6, 0xffe8, 0xffea, 0xffed, 0xfff9, - 0xfffc -}; - -constexpr KChar typeValues[] = { - 0x1f, 0xf, 0x21, 0x180c, 0x23, 0x18, 0x25, 0x181a, 0x27, 0x18, 0x29, 0x1615, 0x2c, 0x1918, 0x2e, 0x1418, 0x30, 0x1809, 0x39, 0x9, - 0x3b, 0x18, 0x3e, 0x19, 0x40, 0x18, 0x5a, 0x1, 0x5c, 0x1518, 0x5e, 0x161b, 0x60, 0x171b, 0x7a, 0x2, 0x7c, 0x1519, 0x7e, 0x1619, - 0x9f, 0xf, 0xa1, 0x180c, 0xa5, 0x1a, 0xa7, 0x1c, 0xa9, 0x1c1b, 0xab, 0x1d02, 0xad, 0x1419, 0xb0, 0x1b1c, 0xb2, 0x190b, 0xb4, 0xb1b, - 0xb6, 0x21c, 0xb8, 0x181b, 0xba, 0xb02, 0xbc, 0x1e0b, 0xbe, 0xb, 0xc0, 0x1801, 0xd6, 0x1, 0xd8, 0x1901, 0xde, 0x1, 0xf6, 0x2, - 0xf8, 0x1902, 0xff, 0x2, 0x137, 0x201, 0x148, 0x102, 0x178, 0x201, 0x17e, 0x102, 0x180, 0x2, 0x182, 0x1, 0x186, 0x201, 0x189, 0x102, - 0x18b, 0x1, 0x18d, 0x2, 0x191, 0x1, 0x193, 0x102, 0x196, 0x201, 0x198, 0x1, 0x19b, 0x2, 0x19d, 0x1, 0x19f, 0x102, 0x1a6, 0x201, - 0x1aa, 0x102, 0x1ae, 0x201, 0x1b1, 0x102, 0x1b3, 0x1, 0x1b7, 0x102, 0x1b9, 0x201, 0x1bb, 0x502, 0x1bd, 0x201, 0x1bf, 0x2, 0x1c3, 0x5, - 0x1c5, 0x301, 0x1c7, 0x102, 0x1c9, 0x203, 0x1cb, 0x301, 0x1dc, 0x102, 0x1ef, 0x201, 0x1f1, 0x102, 0x1f3, 0x203, 0x1f6, 0x201, 0x1f8, 0x1, - 0x21f, 0x201, 0x233, 0x201, 0x2ad, 0x2, 0x2b8, 0x4, 0x2ba, 0x1b, 0x2c1, 0x4, 0x2cf, 0x1b, 0x2d1, 0x4, 0x2df, 0x1b, 0x2e4, 0x4, - 0x2ed, 0x1b, 0x2ee, 0x4, 0x34e, 0x6, 0x362, 0x6, 0x375, 0x1b, 0x37a, 0x4, 0x37e, 0x18, 0x385, 0x1b, 0x388, 0x1801, 0x38a, 0x1, - 0x38c, 0x1, 0x38f, 0x1, 0x391, 0x102, 0x3a1, 0x1, 0x3ab, 0x1, 0x3ce, 0x2, 0x3d1, 0x2, 0x3d4, 0x1, 0x3d7, 0x2, 0x3ef, 0x201, - 0x3f3, 0x2, 0x42f, 0x1, 0x45f, 0x2, 0x481, 0x201, 0x483, 0x61c, 0x486, 0x6, 0x489, 0x7, 0x4c0, 0x201, 0x4c4, 0x102, 0x4c8, 0x102, - 0x4cc, 0x102, 0x4f5, 0x201, 0x4f9, 0x201, 0x556, 0x1, 0x55a, 0x418, 0x55f, 0x18, 0x587, 0x2, 0x58a, 0x1814, 0x5a1, 0x6, 0x5b9, 0x6, - 0x5bd, 0x6, 0x5c1, 0x618, 0x5c4, 0x1806, 0x5ea, 0x5, 0x5f2, 0x5, 0x5f4, 0x18, 0x60c, 0x18, 0x61b, 0x1800, 0x61f, 0x1800, 0x63a, 0x5, - 0x641, 0x504, 0x64a, 0x5, 0x655, 0x6, 0x669, 0x9, 0x66d, 0x18, 0x671, 0x506, 0x6d3, 0x5, 0x6d5, 0x518, 0x6dc, 0x6, 0x6de, 0x7, - 0x6e4, 0x6, 0x6e6, 0x4, 0x6e8, 0x6, 0x6ea, 0x1c06, 0x6ed, 0x6, 0x6f9, 0x9, 0x6fc, 0x5, 0x6fe, 0x1c, 0x70d, 0x18, 0x710, 0x1005, - 0x712, 0x605, 0x72c, 0x5, 0x74a, 0x6, 0x7a5, 0x5, 0x7b0, 0x6, 0x902, 0x6, 0x903, 0x800, 0x939, 0x5, 0x93d, 0x506, 0x940, 0x8, - 0x948, 0x6, 0x94c, 0x8, 0x94d, 0x600, 0x951, 0x605, 0x954, 0x6, 0x961, 0x5, 0x963, 0x6, 0x965, 0x18, 0x96f, 0x9, 0x970, 0x18, - 0x982, 0x608, 0x983, 0x800, 0x98c, 0x5, 0x990, 0x5, 0x9a8, 0x5, 0x9b0, 0x5, 0x9b2, 0x5, 0x9b9, 0x5, 0x9bc, 0x6, 0x9c0, 0x8, - 0x9c4, 0x6, 0x9c8, 0x8, 0x9cc, 0x8, 0x9cd, 0x600, 0x9d7, 0x800, 0x9dd, 0x5, 0x9e1, 0x5, 0x9e3, 0x6, 0x9ef, 0x9, 0x9f1, 0x5, - 0x9f3, 0x1a, 0x9f9, 0xb, 0x9fa, 0x1c, 0xa02, 0x6, 0xa0a, 0x5, 0xa10, 0x5, 0xa28, 0x5, 0xa30, 0x5, 0xa33, 0x5, 0xa36, 0x5, - 0xa39, 0x5, 0xa3c, 0x6, 0xa40, 0x8, 0xa42, 0x6, 0xa48, 0x6, 0xa4d, 0x6, 0xa5c, 0x5, 0xa5e, 0x5, 0xa6f, 0x9, 0xa71, 0x6, - 0xa74, 0x5, 0xa82, 0x6, 0xa83, 0x800, 0xa8b, 0x5, 0xa8d, 0x500, 0xa91, 0x5, 0xaa8, 0x5, 0xab0, 0x5, 0xab3, 0x5, 0xab9, 0x5, - 0xabd, 0x506, 0xac0, 0x8, 0xac5, 0x6, 0xac8, 0x6, 0xac9, 0x800, 0xacc, 0x8, 0xacd, 0x600, 0xad0, 0x5, 0xae0, 0x5, 0xaef, 0x9, - 0xb02, 0x608, 0xb03, 0x800, 0xb0c, 0x5, 0xb10, 0x5, 0xb28, 0x5, 0xb30, 0x5, 0xb33, 0x5, 0xb39, 0x5, 0xb3d, 0x506, 0xb41, 0x608, - 0xb43, 0x6, 0xb48, 0x8, 0xb4c, 0x8, 0xb4d, 0x600, 0xb57, 0x806, 0xb5d, 0x5, 0xb61, 0x5, 0xb6f, 0x9, 0xb70, 0x1c, 0xb83, 0x806, - 0xb8a, 0x5, 0xb90, 0x5, 0xb95, 0x5, 0xb9a, 0x5, 0xb9c, 0x5, 0xb9f, 0x5, 0xba4, 0x5, 0xbaa, 0x5, 0xbb5, 0x5, 0xbb9, 0x5, - 0xbbf, 0x8, 0xbc1, 0x806, 0xbc2, 0x8, 0xbc8, 0x8, 0xbcc, 0x8, 0xbcd, 0x600, 0xbd7, 0x800, 0xbef, 0x9, 0xbf2, 0xb, 0xc03, 0x8, - 0xc0c, 0x5, 0xc10, 0x5, 0xc28, 0x5, 0xc33, 0x5, 0xc39, 0x5, 0xc40, 0x6, 0xc44, 0x8, 0xc48, 0x6, 0xc4d, 0x6, 0xc56, 0x6, - 0xc61, 0x5, 0xc6f, 0x9, 0xc83, 0x8, 0xc8c, 0x5, 0xc90, 0x5, 0xca8, 0x5, 0xcb3, 0x5, 0xcb9, 0x5, 0xcc0, 0x608, 0xcc4, 0x8, - 0xcc7, 0x806, 0xcc8, 0x8, 0xccb, 0x8, 0xccd, 0x6, 0xcd6, 0x8, 0xcde, 0x5, 0xce1, 0x5, 0xcef, 0x9, 0xd03, 0x8, 0xd0c, 0x5, - 0xd10, 0x5, 0xd28, 0x5, 0xd39, 0x5, 0xd40, 0x8, 0xd43, 0x6, 0xd48, 0x8, 0xd4c, 0x8, 0xd4d, 0x600, 0xd57, 0x800, 0xd61, 0x5, - 0xd6f, 0x9, 0xd83, 0x8, 0xd96, 0x5, 0xdb1, 0x5, 0xdbb, 0x5, 0xdbd, 0x500, 0xdc6, 0x5, 0xdca, 0x6, 0xdd1, 0x8, 0xdd4, 0x6, - 0xdd6, 0x6, 0xddf, 0x8, 0xdf3, 0x8, 0xdf4, 0x18, 0xe30, 0x5, 0xe32, 0x605, 0xe34, 0x506, 0xe3a, 0x6, 0xe40, 0x1a05, 0xe45, 0x5, - 0xe47, 0x604, 0xe4e, 0x6, 0xe50, 0x1809, 0xe59, 0x9, 0xe5b, 0x18, 0xe82, 0x5, 0xe84, 0x5, 0xe88, 0x5, 0xe8a, 0x5, 0xe8d, 0x500, - 0xe97, 0x5, 0xe9f, 0x5, 0xea3, 0x5, 0xea5, 0x500, 0xea7, 0x500, 0xeab, 0x5, 0xeb0, 0x5, 0xeb2, 0x605, 0xeb4, 0x506, 0xeb9, 0x6, - 0xebc, 0x6, 0xebd, 0x500, 0xec4, 0x5, 0xec6, 0x4, 0xecd, 0x6, 0xed9, 0x9, 0xedd, 0x5, 0xf01, 0x1c05, 0xf03, 0x1c, 0xf12, 0x18, - 0xf17, 0x1c, 0xf19, 0x6, 0xf1f, 0x1c, 0xf29, 0x9, 0xf33, 0xb, 0xf39, 0x61c, 0xf3d, 0x1615, 0xf3f, 0x8, 0xf47, 0x5, 0xf6a, 0x5, - 0xf7e, 0x6, 0xf80, 0x806, 0xf84, 0x6, 0xf86, 0x1806, 0xf88, 0x605, 0xf8b, 0x5, 0xf97, 0x6, 0xfbc, 0x6, 0xfc5, 0x1c, 0xfc7, 0x1c06, - 0xfcc, 0x1c, 0xfcf, 0x1c00, 0x1021, 0x5, 0x1027, 0x5, 0x102a, 0x5, 0x102d, 0x608, 0x1030, 0x6, 0x1032, 0x806, 0x1037, 0x6, 0x1039, 0x608, - 0x1049, 0x9, 0x104f, 0x18, 0x1055, 0x5, 0x1057, 0x8, 0x1059, 0x6, 0x10c5, 0x1, 0x10f6, 0x5, 0x10fb, 0x1800, 0x1159, 0x5, 0x11a2, 0x5, - 0x11f9, 0x5, 0x1206, 0x5, 0x1246, 0x5, 0x1248, 0x5, 0x124d, 0x5, 0x1256, 0x5, 0x1258, 0x5, 0x125d, 0x5, 0x1286, 0x5, 0x1288, 0x5, - 0x128d, 0x5, 0x12ae, 0x5, 0x12b0, 0x5, 0x12b5, 0x5, 0x12be, 0x5, 0x12c0, 0x5, 0x12c5, 0x5, 0x12ce, 0x5, 0x12d6, 0x5, 0x12ee, 0x5, - 0x130e, 0x5, 0x1310, 0x5, 0x1315, 0x5, 0x131e, 0x5, 0x1346, 0x5, 0x135a, 0x5, 0x1368, 0x18, 0x1371, 0x9, 0x137c, 0xb, 0x13f4, 0x5, - 0x166c, 0x5, 0x166e, 0x18, 0x1676, 0x5, 0x1681, 0x50c, 0x169a, 0x5, 0x169c, 0x1516, 0x16ea, 0x5, 0x16ed, 0x18, 0x16f0, 0xb, 0x17b3, 0x5, - 0x17b6, 0x8, 0x17bd, 0x6, 0x17c5, 0x8, 0x17c7, 0x806, 0x17c9, 0x608, 0x17d3, 0x6, 0x17da, 0x18, 0x17dc, 0x1a18, 0x17e9, 0x9, 0x1805, 0x18, - 0x1807, 0x1814, 0x180a, 0x18, 0x180e, 0x10, 0x1819, 0x9, 0x1842, 0x5, 0x1844, 0x405, 0x1877, 0x5, 0x18a8, 0x5, 0x18a9, 0x600, 0x1e95, 0x201, - 0x1e9b, 0x2, 0x1ef9, 0x201, 0x1f07, 0x2, 0x1f0f, 0x1, 0x1f15, 0x2, 0x1f1d, 0x1, 0x1f27, 0x2, 0x1f2f, 0x1, 0x1f37, 0x2, 0x1f3f, 0x1, - 0x1f45, 0x2, 0x1f4d, 0x1, 0x1f57, 0x2, 0x1f59, 0x100, 0x1f5b, 0x100, 0x1f5d, 0x100, 0x1f60, 0x102, 0x1f67, 0x2, 0x1f6f, 0x1, 0x1f7d, 0x2, - 0x1f87, 0x2, 0x1f8f, 0x3, 0x1f97, 0x2, 0x1f9f, 0x3, 0x1fa7, 0x2, 0x1faf, 0x3, 0x1fb4, 0x2, 0x1fb7, 0x2, 0x1fbb, 0x1, 0x1fbd, 0x1b03, - 0x1fbf, 0x1b02, 0x1fc1, 0x1b, 0x1fc4, 0x2, 0x1fc7, 0x2, 0x1fcb, 0x1, 0x1fcd, 0x1b03, 0x1fcf, 0x1b, 0x1fd3, 0x2, 0x1fd7, 0x2, 0x1fdb, 0x1, - 0x1fdf, 0x1b, 0x1fe7, 0x2, 0x1fec, 0x1, 0x1fef, 0x1b, 0x1ff4, 0x2, 0x1ff7, 0x2, 0x1ffb, 0x1, 0x1ffd, 0x1b03, 0x1ffe, 0x1b, 0x200b, 0xc, - 0x200f, 0x10, 0x2015, 0x14, 0x2017, 0x18, 0x2019, 0x1e1d, 0x201b, 0x1d15, 0x201d, 0x1e1d, 0x201f, 0x1d15, 0x2027, 0x18, 0x2029, 0xe0d, 0x202e, 0x10, - 0x2030, 0xc18, 0x2038, 0x18, 0x203a, 0x1d1e, 0x203e, 0x18, 0x2040, 0x17, 0x2043, 0x18, 0x2045, 0x1519, 0x2046, 0x16, 0x204d, 0x18, 0x206f, 0x10, - 0x2070, 0xb, 0x2079, 0xb, 0x207c, 0x19, 0x207e, 0x1516, 0x2080, 0x20b, 0x2089, 0xb, 0x208c, 0x19, 0x208e, 0x1516, 0x20af, 0x1a, 0x20dc, 0x6, - 0x20e0, 0x7, 0x20e2, 0x607, 0x20e3, 0x700, 0x2101, 0x1c, 0x2103, 0x1c01, 0x2106, 0x1c, 0x2108, 0x11c, 0x210a, 0x1c02, 0x210d, 0x1, 0x210f, 0x2, - 0x2112, 0x1, 0x2114, 0x21c, 0x2116, 0x11c, 0x2118, 0x1c, 0x211d, 0x1, 0x2123, 0x1c, 0x212a, 0x1c01, 0x212d, 0x1, 0x212f, 0x21c, 0x2131, 0x1, - 0x2133, 0x11c, 0x2135, 0x502, 0x2138, 0x5, 0x213a, 0x21c, 0x215f, 0xb, 0x2183, 0xa, 0x2194, 0x19, 0x2199, 0x1c, 0x219b, 0x19, 0x219f, 0x1c, - 0x21a1, 0x1c19, 0x21a4, 0x191c, 0x21a7, 0x1c19, 0x21ad, 0x1c, 0x21af, 0x1c19, 0x21cd, 0x1c, 0x21cf, 0x19, 0x21d1, 0x1c, 0x21d5, 0x1c19, 0x21f3, 0x1c, - 0x22f1, 0x19, 0x2307, 0x1c, 0x230b, 0x19, 0x231f, 0x1c, 0x2321, 0x19, 0x2328, 0x1c, 0x232a, 0x1516, 0x237b, 0x1c, 0x239a, 0x1c, 0x2426, 0x1c, - 0x244a, 0x1c, 0x249b, 0xb, 0x24e9, 0x1c, 0x24ea, 0xb, 0x2595, 0x1c, 0x25b6, 0x1c, 0x25b8, 0x191c, 0x25c0, 0x1c, 0x25c2, 0x191c, 0x25f7, 0x1c, - 0x2613, 0x1c, 0x266e, 0x1c, 0x2670, 0x191c, 0x2671, 0x1c00, 0x2704, 0x1c, 0x2709, 0x1c, 0x2727, 0x1c, 0x274b, 0x1c, 0x274d, 0x1c00, 0x2752, 0x1c, - 0x2756, 0x1c, 0x275e, 0x1c, 0x2767, 0x1c, 0x2793, 0xb, 0x2794, 0x1c, 0x27af, 0x1c, 0x27be, 0x1c, 0x28ff, 0x1c, 0x2e99, 0x1c, 0x2ef3, 0x1c, - 0x2fd5, 0x1c, 0x2ffb, 0x1c, 0x3001, 0x180c, 0x3003, 0x18, 0x3005, 0x41c, 0x3007, 0xa05, 0x3011, 0x1615, 0x3013, 0x1c, 0x301b, 0x1615, 0x301d, 0x1514, - 0x301f, 0x16, 0x3021, 0xa1c, 0x3029, 0xa, 0x302f, 0x6, 0x3031, 0x414, 0x3035, 0x4, 0x3037, 0x1c, 0x303a, 0xa, 0x303f, 0x1c, 0x3094, 0x5, - 0x309a, 0x6, 0x309c, 0x1b, 0x309e, 0x4, 0x30fa, 0x5, 0x30fc, 0x1704, 0x30fe, 0x4, 0x312c, 0x5, 0x318e, 0x5, 0x3191, 0x1c, 0x3195, 0xb, - 0x319f, 0x1c, 0x31b7, 0x5, 0x321c, 0x1c, 0x3229, 0xb, 0x3243, 0x1c, 0x327b, 0x1c, 0x3280, 0x1c0b, 0x3289, 0xb, 0x32b0, 0x1c, 0x32cb, 0x1c, - 0x32fe, 0x1c, 0x3376, 0x1c, 0x33dd, 0x1c, 0x33fe, 0x1c, 0x4db5, 0x5, 0x9fa5, 0x5, 0xa48c, 0x5, 0xa4a1, 0x1c, 0xa4b3, 0x1c, 0xa4c0, 0x1c, - 0xa4c4, 0x1c, 0xa4c6, 0x1c, 0xd7a3, 0x5, 0xdfff, 0x13, 0xf8ff, 0x12, 0xfa2d, 0x5, 0xfb06, 0x2, 0xfb17, 0x2, 0xfb1f, 0x506, 0xfb28, 0x5, - 0xfb2a, 0x1905, 0xfb36, 0x5, 0xfb3c, 0x5, 0xfb3e, 0x5, 0xfb41, 0x5, 0xfb44, 0x5, 0xfbb1, 0x5, 0xfd3d, 0x5, 0xfd3f, 0x1615, 0xfd8f, 0x5, - 0xfdc7, 0x5, 0xfdfb, 0x5, 0xfe23, 0x6, 0xfe31, 0x1418, 0xfe33, 0x1714, 0xfe35, 0x1517, 0xfe44, 0x1516, 0xfe4c, 0x18, 0xfe4f, 0x17, 0xfe52, 0x18, - 0xfe57, 0x18, 0xfe59, 0x1514, 0xfe5e, 0x1516, 0xfe61, 0x18, 0xfe64, 0x1419, 0xfe66, 0x19, 0xfe6a, 0x1a18, 0xfe6b, 0x1800, 0xfe72, 0x5, 0xfe74, 0x5, - 0xfefc, 0x5, 0xfeff, 0x1000, 0xff03, 0x18, 0xff05, 0x181a, 0xff07, 0x18, 0xff09, 0x1615, 0xff0c, 0x1918, 0xff0e, 0x1418, 0xff10, 0x1809, 0xff19, 0x9, - 0xff1b, 0x18, 0xff1e, 0x19, 0xff20, 0x18, 0xff3a, 0x1, 0xff3c, 0x1518, 0xff3e, 0x161b, 0xff40, 0x171b, 0xff5a, 0x2, 0xff5c, 0x1519, 0xff5e, 0x1619, - 0xff62, 0x1815, 0xff64, 0x1618, 0xff66, 0x1705, 0xff6f, 0x5, 0xff71, 0x504, 0xff9d, 0x5, 0xff9f, 0x4, 0xffbe, 0x5, 0xffc7, 0x5, 0xffcf, 0x5, - 0xffd7, 0x5, 0xffdc, 0x5, 0xffe1, 0x1a, 0xffe3, 0x1b19, 0xffe5, 0x1a1c, 0xffe6, 0x1a, 0xffe9, 0x191c, 0xffec, 0x19, 0xffee, 0x1c, 0xfffb, 0x10 -}; - -KInt getType(KChar ch) { - if (ch < 1000) { - return typeValuesCache[ch]; - } - int result = binarySearchRange(typeKeys, ARRAY_SIZE(typeKeys), ch); - int high = typeValues[result * 2]; - if (ch <= high) { - int code = typeValues[result * 2 + 1]; - if (code < 0x100) { - return code; - } - return (ch & 1) == 1 ? code >> 8 : code & 0xff; - } - return UNASSIGNED; -} - KChar towupper_Konan(KChar ch) { // Optimized case for ASCII. if ('a' <= ch && ch <= 'z') { @@ -636,72 +307,6 @@ KChar towlower_Konan(KChar ch) { return ch; } -int iswdigit_Konan(KChar ch) { - // Optimized case for ASCII. - if ('0' <= ch && ch <= '9') { - return true; - } - if (ch < 1632) { - return false; - } - return getType(ch) == DECIMAL_DIGIT_NUMBER; -} - -int iswalpha_Konan(KChar ch) { - if (('A' <= ch && ch <= 'Z') || ('a' <= ch && ch <= 'z')) { - return true; - } - if (ch < 128) { - return false; - } - int type = getType(ch); - return type >= UPPERCASE_LETTER && type <= OTHER_LETTER; -} - -int iswalnum_Konan(KChar ch) { - int type = getType(ch); - return (type >= UPPERCASE_LETTER && type <= OTHER_LETTER) - || type == DECIMAL_DIGIT_NUMBER; -} - -int iswspace_Konan(KChar ch) { - // FILE, GROUP, RECORD, UNIT separators, # Zs SPACE or # Cc CONTROLs - if ((ch >= 0x1c && ch <= 0x20) || (ch >= 0x9 && ch <= 0xd)) { - return true; - } - // not (# Zs OGHAM SPACE MARK or # Cc or # Zs NO-BREAK SPACE) - if (ch < 0x2000 && !(ch == 0x1680 || ch == 0x85 || ch == 0xA0)) { - return false; - } - // if # Zl LINE SEPARATOR or # Zp PARAGRAPH SEPARATOR or # Zs NARROW NO-BREAK SPACE - // or # Zs MEDIUM MATHEMATICAL SPACE or # Zs IDEOGRAPHIC SPACE - return ch < 0x200b || ch == 0x2028 || ch == 0x2029 || ch == 0x202F || ch == 0x205F || ch == 0x3000; -} - -int iswupper_Konan(KChar ch) { - // Optimized case for ASCII. - if ('A' <= ch && ch <= 'Z') { - return true; - } - if (ch < 128) { - return false; - } - - return getType(ch) == UPPERCASE_LETTER; -} - -int iswlower_Konan(KChar ch) { - // Optimized case for ASCII. - if ('a' <= ch && ch <= 'z') { - return true; - } - if (ch < 128) { - return false; - } - - return getType(ch) == LOWERCASE_LETTER; -} - } // namespace extern "C" { @@ -989,24 +594,6 @@ KBoolean Kotlin_String_regionMatches(KString thiz, KInt thizOffset, return true; } -KBoolean Kotlin_Char_isDefined(KChar ch) { - // TODO: fixme! - RuntimeAssert(false, "Kotlin_Char_isDefined() is not implemented"); - return true; -} - -KBoolean Kotlin_Char_isLetter(KChar ch) { - return iswalpha_Konan(ch) != 0; -} - -KBoolean Kotlin_Char_isLetterOrDigit(KChar ch) { - return iswalnum_Konan(ch) != 0; -} - -KBoolean Kotlin_Char_isDigit(KChar ch) { - return iswdigit_Konan(ch) != 0; -} - KBoolean Kotlin_Char_isIdentifierIgnorable(KChar ch) { RuntimeAssert(false, "Kotlin_Char_isIdentifierIgnorable() is not implemented"); return false; @@ -1024,18 +611,6 @@ KBoolean Kotlin_Char_isLowSurrogate(KChar ch) { return ((ch & 0xfc00) == 0xdc00); } -KBoolean Kotlin_Char_isWhitespace(KChar ch) { - return iswspace_Konan(ch) != 0; -} - -KBoolean Kotlin_Char_isLowerCase(KChar ch) { - return iswlower_Konan(ch) != 0; -} - -KBoolean Kotlin_Char_isUpperCase(KChar ch) { - return iswupper_Konan(ch) != 0; -} - KChar Kotlin_Char_toLowerCase(KChar ch) { return towlower_Konan(ch); } @@ -1044,10 +619,6 @@ KChar Kotlin_Char_toUpperCase(KChar ch) { return towupper_Konan(ch); } -KInt Kotlin_Char_getType(KChar ch) { - return getType(ch); -} - constexpr KInt digits[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1, -1, diff --git a/kotlin-native/runtime/src/main/kotlin/generated/_CharCategories.kt b/kotlin-native/runtime/src/main/kotlin/generated/_CharCategories.kt new file mode 100644 index 00000000000..541a012d5fd --- /dev/null +++ b/kotlin-native/runtime/src/main/kotlin/generated/_CharCategories.kt @@ -0,0 +1,184 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.text + +// +// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateUnicodeData.kt +// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib +// + +// 1343 ranges totally +@SharedImmutable +private val rangeStart = intArrayOf( + 0x0000, 0x0020, 0x0022, 0x0027, 0x002b, 0x002e, 0x0030, 0x003a, 0x003c, 0x003f, 0x0041, 0x005b, 0x005e, 0x0061, 0x007b, 0x007e, 0x007f, 0x00a0, 0x00a2, 0x00a6, + 0x00aa, 0x00ad, 0x00b0, 0x00b3, 0x00b6, 0x00b9, 0x00bd, 0x00c0, 0x00d7, 0x00d8, 0x00df, 0x00f7, 0x00f8, 0x00ff, 0x0138, 0x0149, 0x0179, 0x017f, 0x0182, 0x0184, + 0x018b, 0x018e, 0x0190, 0x0198, 0x019b, 0x01a0, 0x01a7, 0x01aa, 0x01ac, 0x01b3, 0x01b8, 0x01bb, 0x01bd, 0x01c0, 0x01c4, 0x01cc, 0x01dd, 0x01f0, 0x01f4, 0x01f8, + 0x0233, 0x0239, 0x0240, 0x0243, 0x0246, 0x024f, 0x0294, 0x0295, 0x02b0, 0x02c2, 0x02c6, 0x02d2, 0x02e0, 0x02e5, 0x02eb, 0x02ef, 0x0300, 0x0370, 0x0374, 0x0377, + 0x037a, 0x037d, 0x0380, 0x0384, 0x0386, 0x038a, 0x038f, 0x0391, 0x03a2, 0x03a3, 0x03ac, 0x03cd, 0x03d2, 0x03d5, 0x03d7, 0x03ef, 0x03f4, 0x03f9, 0x03fb, 0x03fd, + 0x0430, 0x045f, 0x0482, 0x0483, 0x0488, 0x048a, 0x04c1, 0x04cf, 0x0530, 0x0531, 0x0557, 0x055a, 0x0560, 0x0589, 0x058c, 0x058f, 0x0591, 0x05be, 0x05bf, 0x05c8, + 0x05d0, 0x05eb, 0x05ef, 0x05f3, 0x05f5, 0x0600, 0x0606, 0x0609, 0x060e, 0x0610, 0x061b, 0x061e, 0x0620, 0x0640, 0x0641, 0x064b, 0x0660, 0x066a, 0x066e, 0x0671, + 0x06d3, 0x06d6, 0x06dd, 0x06df, 0x06e4, 0x06e8, 0x06ea, 0x06ee, 0x06f0, 0x06fa, 0x06fc, 0x0700, 0x070e, 0x0711, 0x0712, 0x0730, 0x074b, 0x074d, 0x07a6, 0x07b1, + 0x07b2, 0x07c0, 0x07ca, 0x07eb, 0x07f4, 0x07f7, 0x07fa, 0x07fd, 0x0800, 0x0816, 0x081a, 0x081b, 0x0822, 0x0827, 0x0829, 0x082e, 0x0830, 0x083f, 0x0840, 0x0859, + 0x085c, 0x0860, 0x086b, 0x08a0, 0x08b5, 0x08b6, 0x08c8, 0x08d3, 0x08e2, 0x08e3, 0x0903, 0x0904, 0x093a, 0x093d, 0x093e, 0x0941, 0x0949, 0x094b, 0x0950, 0x0951, + 0x0958, 0x0962, 0x0964, 0x0966, 0x0970, 0x0972, 0x0981, 0x0984, 0x0985, 0x098c, 0x0990, 0x0993, 0x09a9, 0x09aa, 0x09b1, 0x09b5, 0x09b8, 0x09bb, 0x09be, 0x09c1, + 0x09c5, 0x09c8, 0x09cc, 0x09cf, 0x09d7, 0x09d8, 0x09db, 0x09e1, 0x09e4, 0x09e6, 0x09f0, 0x09f2, 0x09f4, 0x09fa, 0x09fd, 0x0a00, 0x0a03, 0x0a05, 0x0a0b, 0x0a0f, + 0x0a11, 0x0a13, 0x0a29, 0x0a2a, 0x0a2f, 0x0a3b, 0x0a3e, 0x0a41, 0x0a43, 0x0a46, 0x0a4a, 0x0a4d, 0x0a50, 0x0a52, 0x0a59, 0x0a5c, 0x0a5f, 0x0a66, 0x0a70, 0x0a73, + 0x0a76, 0x0a77, 0x0a81, 0x0a84, 0x0a85, 0x0a8c, 0x0a91, 0x0a93, 0x0aa9, 0x0aaa, 0x0aaf, 0x0ab5, 0x0aba, 0x0abd, 0x0abe, 0x0ac1, 0x0ac4, 0x0ac9, 0x0acd, 0x0ad0, + 0x0ad1, 0x0ae0, 0x0ae3, 0x0ae6, 0x0af0, 0x0af2, 0x0af9, 0x0afa, 0x0b00, 0x0b03, 0x0b05, 0x0b0c, 0x0b10, 0x0b13, 0x0b29, 0x0b2a, 0x0b2f, 0x0b35, 0x0b3a, 0x0b3d, + 0x0b3f, 0x0b43, 0x0b46, 0x0b4a, 0x0b4d, 0x0b4e, 0x0b55, 0x0b58, 0x0b5b, 0x0b61, 0x0b64, 0x0b66, 0x0b70, 0x0b72, 0x0b78, 0x0b81, 0x0b85, 0x0b8b, 0x0b8e, 0x0b8f, + 0x0b94, 0x0b97, 0x0b9a, 0x0b9f, 0x0ba2, 0x0ba5, 0x0ba8, 0x0bab, 0x0bae, 0x0bba, 0x0bbe, 0x0bc3, 0x0bc6, 0x0bc7, 0x0bcc, 0x0bcf, 0x0bd1, 0x0bd7, 0x0bd8, 0x0be6, + 0x0bf0, 0x0bf3, 0x0bf8, 0x0bfb, 0x0c00, 0x0c03, 0x0c05, 0x0c0b, 0x0c10, 0x0c12, 0x0c29, 0x0c2a, 0x0c3a, 0x0c3d, 0x0c40, 0x0c43, 0x0c46, 0x0c49, 0x0c4a, 0x0c4e, + 0x0c54, 0x0c58, 0x0c5b, 0x0c60, 0x0c63, 0x0c66, 0x0c70, 0x0c77, 0x0c78, 0x0c7f, 0x0c82, 0x0c85, 0x0c8b, 0x0c90, 0x0c92, 0x0ca9, 0x0caa, 0x0cb4, 0x0cb5, 0x0cba, + 0x0cbc, 0x0cc0, 0x0cc5, 0x0cc7, 0x0ccc, 0x0cce, 0x0cd5, 0x0cd7, 0x0cde, 0x0ce2, 0x0ce4, 0x0ce6, 0x0cf0, 0x0cf3, 0x0d00, 0x0d02, 0x0d04, 0x0d0b, 0x0d10, 0x0d12, + 0x0d3a, 0x0d3e, 0x0d41, 0x0d45, 0x0d47, 0x0d4c, 0x0d4f, 0x0d52, 0x0d55, 0x0d58, 0x0d5f, 0x0d62, 0x0d64, 0x0d66, 0x0d70, 0x0d79, 0x0d7a, 0x0d80, 0x0d83, 0x0d85, + 0x0d97, 0x0d9a, 0x0db2, 0x0db3, 0x0dbc, 0x0dc0, 0x0dc7, 0x0dc8, 0x0dcd, 0x0dd0, 0x0dd3, 0x0dd7, 0x0dd8, 0x0de0, 0x0de6, 0x0df0, 0x0df3, 0x0df5, 0x0e01, 0x0e2f, + 0x0e34, 0x0e3b, 0x0e3f, 0x0e40, 0x0e46, 0x0e47, 0x0e4f, 0x0e50, 0x0e5a, 0x0e5c, 0x0e80, 0x0e85, 0x0e86, 0x0e8b, 0x0e8c, 0x0ea3, 0x0ea7, 0x0eaf, 0x0eb4, 0x0ebd, + 0x0ec0, 0x0ec5, 0x0ec8, 0x0ece, 0x0ed0, 0x0eda, 0x0edc, 0x0ee0, 0x0f00, 0x0f01, 0x0f04, 0x0f13, 0x0f17, 0x0f1a, 0x0f20, 0x0f2a, 0x0f34, 0x0f3a, 0x0f3e, 0x0f40, + 0x0f48, 0x0f49, 0x0f6d, 0x0f71, 0x0f7f, 0x0f80, 0x0f83, 0x0f88, 0x0f8d, 0x0f98, 0x0f99, 0x0fbd, 0x0fbe, 0x0fc6, 0x0fc7, 0x0fcb, 0x0fd0, 0x0fd5, 0x0fd9, 0x0fdb, + 0x1000, 0x102b, 0x102d, 0x1031, 0x1032, 0x1036, 0x103c, 0x103f, 0x1040, 0x104a, 0x1050, 0x1056, 0x1059, 0x105c, 0x105f, 0x1062, 0x1065, 0x1067, 0x106e, 0x1071, + 0x1075, 0x1082, 0x1085, 0x1087, 0x108c, 0x1090, 0x109a, 0x109d, 0x10a0, 0x10c5, 0x10c8, 0x10cb, 0x10d0, 0x10fb, 0x10fd, 0x1100, 0x1249, 0x124a, 0x124e, 0x1250, + 0x1256, 0x125a, 0x125e, 0x1260, 0x1289, 0x128a, 0x128e, 0x1290, 0x12b1, 0x12b2, 0x12b6, 0x12b8, 0x12be, 0x12c2, 0x12c6, 0x12c8, 0x12d7, 0x12d8, 0x1311, 0x1312, + 0x1316, 0x1318, 0x135b, 0x135d, 0x1360, 0x1369, 0x137d, 0x1380, 0x1390, 0x139a, 0x13a0, 0x13f6, 0x13f8, 0x13fe, 0x1401, 0x166d, 0x166f, 0x1680, 0x1681, 0x169b, + 0x169d, 0x16a0, 0x16eb, 0x16ee, 0x16f1, 0x16f9, 0x1700, 0x170d, 0x170e, 0x1712, 0x1715, 0x1720, 0x1732, 0x1735, 0x1737, 0x1740, 0x1752, 0x1754, 0x1760, 0x176b, + 0x1770, 0x1772, 0x1774, 0x1780, 0x17b4, 0x17b7, 0x17be, 0x17c4, 0x17c9, 0x17d4, 0x17d5, 0x17da, 0x17dd, 0x17e0, 0x17ea, 0x17f0, 0x17fa, 0x1800, 0x1804, 0x1809, + 0x180c, 0x180f, 0x1810, 0x181a, 0x1820, 0x1843, 0x1844, 0x1879, 0x1880, 0x1885, 0x1887, 0x18a8, 0x18ab, 0x18b0, 0x18f6, 0x1900, 0x191f, 0x1922, 0x1925, 0x1928, + 0x192b, 0x192e, 0x1931, 0x1933, 0x1939, 0x193c, 0x193e, 0x1943, 0x1946, 0x1950, 0x196e, 0x1970, 0x1975, 0x1980, 0x19ac, 0x19b0, 0x19ca, 0x19d0, 0x19da, 0x19db, + 0x19de, 0x1a00, 0x1a17, 0x1a1a, 0x1a1d, 0x1a20, 0x1a55, 0x1a58, 0x1a5e, 0x1a61, 0x1a65, 0x1a6d, 0x1a73, 0x1a7c, 0x1a80, 0x1a8a, 0x1a90, 0x1a9a, 0x1aa0, 0x1aa7, + 0x1aa8, 0x1aae, 0x1ab0, 0x1abc, 0x1ac1, 0x1b00, 0x1b04, 0x1b05, 0x1b34, 0x1b36, 0x1b3a, 0x1b3d, 0x1b40, 0x1b45, 0x1b4c, 0x1b50, 0x1b5a, 0x1b61, 0x1b6b, 0x1b74, + 0x1b7d, 0x1b80, 0x1b83, 0x1ba1, 0x1ba4, 0x1ba7, 0x1bad, 0x1bb0, 0x1bba, 0x1be6, 0x1beb, 0x1bef, 0x1bf2, 0x1bf4, 0x1bfc, 0x1c00, 0x1c24, 0x1c2c, 0x1c34, 0x1c36, + 0x1c38, 0x1c3b, 0x1c40, 0x1c4a, 0x1c4d, 0x1c50, 0x1c5a, 0x1c78, 0x1c7e, 0x1c80, 0x1c89, 0x1c90, 0x1cbb, 0x1cbd, 0x1cc0, 0x1cc8, 0x1cd0, 0x1cd3, 0x1cd4, 0x1ce1, + 0x1ce2, 0x1ce9, 0x1ced, 0x1cee, 0x1cf2, 0x1cf7, 0x1cfa, 0x1cfb, 0x1d00, 0x1d2c, 0x1d6b, 0x1d78, 0x1d79, 0x1d9b, 0x1dc0, 0x1dfa, 0x1dfb, 0x1e00, 0x1e95, 0x1e9d, + 0x1eff, 0x1f08, 0x1f10, 0x1f16, 0x1f18, 0x1f1e, 0x1f20, 0x1f28, 0x1f30, 0x1f38, 0x1f40, 0x1f46, 0x1f48, 0x1f4e, 0x1f50, 0x1f58, 0x1f60, 0x1f68, 0x1f70, 0x1f7e, + 0x1f80, 0x1f88, 0x1f90, 0x1f98, 0x1fa0, 0x1fa8, 0x1fb0, 0x1fb3, 0x1fb8, 0x1fbc, 0x1fbf, 0x1fc2, 0x1fc3, 0x1fc8, 0x1fcc, 0x1fcf, 0x1fd2, 0x1fd5, 0x1fd8, 0x1fdc, + 0x1fdd, 0x1fe0, 0x1fe8, 0x1fed, 0x1ff0, 0x1ff3, 0x1ff8, 0x1ffc, 0x1fff, 0x2000, 0x200b, 0x2010, 0x2016, 0x2018, 0x201c, 0x2020, 0x2028, 0x202a, 0x202f, 0x2030, + 0x2039, 0x203b, 0x203e, 0x2042, 0x2045, 0x2047, 0x2052, 0x2055, 0x205f, 0x2060, 0x2065, 0x2066, 0x2070, 0x2072, 0x2074, 0x207a, 0x207d, 0x2080, 0x208a, 0x208d, + 0x2090, 0x209d, 0x20a0, 0x20c0, 0x20d0, 0x20dd, 0x20e1, 0x20e2, 0x20e5, 0x20f1, 0x2100, 0x2105, 0x210a, 0x210d, 0x2111, 0x2114, 0x2118, 0x2119, 0x211e, 0x2123, + 0x212a, 0x212e, 0x2130, 0x2134, 0x2135, 0x2139, 0x213d, 0x2140, 0x2145, 0x2146, 0x214a, 0x214d, 0x2150, 0x2160, 0x2183, 0x2185, 0x2189, 0x218c, 0x2190, 0x2195, + 0x219a, 0x219c, 0x219e, 0x21a7, 0x21ae, 0x21af, 0x21cd, 0x21d1, 0x21d5, 0x21f4, 0x2300, 0x2308, 0x230c, 0x2320, 0x2322, 0x2329, 0x232b, 0x237c, 0x237d, 0x239b, + 0x23b4, 0x23dc, 0x23e2, 0x2427, 0x2440, 0x244b, 0x2460, 0x249c, 0x24ea, 0x2500, 0x25b7, 0x25b8, 0x25c1, 0x25c2, 0x25f8, 0x2600, 0x266f, 0x2670, 0x2768, 0x2776, + 0x2794, 0x27c0, 0x27c5, 0x27c7, 0x27e6, 0x27f0, 0x2800, 0x2900, 0x2983, 0x2999, 0x29d8, 0x29dc, 0x29fc, 0x29fe, 0x2b00, 0x2b30, 0x2b45, 0x2b47, 0x2b4d, 0x2b74, + 0x2b76, 0x2b96, 0x2b97, 0x2c00, 0x2c2f, 0x2c30, 0x2c5e, 0x2c62, 0x2c65, 0x2c66, 0x2c6d, 0x2c71, 0x2c76, 0x2c7c, 0x2c7e, 0x2c80, 0x2ce3, 0x2ce5, 0x2ceb, 0x2cef, + 0x2cf2, 0x2cf4, 0x2cf9, 0x2cfb, 0x2d00, 0x2d25, 0x2d28, 0x2d2b, 0x2d30, 0x2d68, 0x2d6f, 0x2d71, 0x2d7f, 0x2d80, 0x2d97, 0x2da0, 0x2da7, 0x2da8, 0x2daf, 0x2db0, + 0x2db7, 0x2db8, 0x2dbf, 0x2dc0, 0x2dc7, 0x2dc8, 0x2dcf, 0x2dd0, 0x2dd7, 0x2dd8, 0x2ddf, 0x2de0, 0x2e00, 0x2e02, 0x2e06, 0x2e08, 0x2e0e, 0x2e15, 0x2e1b, 0x2e1f, + 0x2e22, 0x2e2a, 0x2e2f, 0x2e30, 0x2e3a, 0x2e3c, 0x2e40, 0x2e43, 0x2e4f, 0x2e53, 0x2e80, 0x2e9a, 0x2e9b, 0x2ef4, 0x2f00, 0x2fd6, 0x2ff0, 0x2ffc, 0x3000, 0x3003, + 0x3006, 0x3008, 0x3012, 0x3014, 0x301a, 0x301f, 0x3021, 0x302a, 0x302e, 0x3031, 0x3036, 0x3039, 0x303c, 0x303f, 0x3041, 0x3097, 0x309a, 0x309d, 0x30a0, 0x30a1, + 0x30fb, 0x30fe, 0x3100, 0x3105, 0x3130, 0x3131, 0x318f, 0x3192, 0x3196, 0x31a0, 0x31c0, 0x31e4, 0x31f0, 0x3200, 0x321f, 0x3220, 0x322a, 0x3248, 0x3250, 0x3251, + 0x3260, 0x3280, 0x328a, 0x32b1, 0x32c0, 0x3400, 0x4dc0, 0x4e00, 0x9ffd, 0xa000, 0xa015, 0xa016, 0xa48d, 0xa490, 0xa4c7, 0xa4d0, 0xa4f8, 0xa4fe, 0xa500, 0xa60c, + 0xa60d, 0xa610, 0xa620, 0xa62a, 0xa62c, 0xa640, 0xa66e, 0xa671, 0xa674, 0xa67e, 0xa680, 0xa69c, 0xa69e, 0xa6a0, 0xa6e6, 0xa6f0, 0xa6f2, 0xa6f8, 0xa700, 0xa717, + 0xa720, 0xa722, 0xa72f, 0xa731, 0xa770, 0xa771, 0xa778, 0xa77e, 0xa788, 0xa78b, 0xa78f, 0xa791, 0xa795, 0xa7aa, 0xa7af, 0xa7b0, 0xa7b4, 0xa7c0, 0xa7c2, 0xa7c6, + 0xa7ca, 0xa7cb, 0xa7f5, 0xa7f8, 0xa7fb, 0xa801, 0xa804, 0xa809, 0xa80c, 0xa823, 0xa826, 0xa828, 0xa82c, 0xa82d, 0xa830, 0xa836, 0xa83a, 0xa840, 0xa874, 0xa878, + 0xa880, 0xa882, 0xa8b4, 0xa8c4, 0xa8c6, 0xa8ce, 0xa8d0, 0xa8da, 0xa8e0, 0xa8f2, 0xa8f8, 0xa8fb, 0xa8ff, 0xa900, 0xa90a, 0xa926, 0xa92e, 0xa930, 0xa947, 0xa952, + 0xa954, 0xa95f, 0xa960, 0xa97d, 0xa980, 0xa983, 0xa984, 0xa9b3, 0xa9b6, 0xa9ba, 0xa9bc, 0xa9be, 0xa9c1, 0xa9ce, 0xa9d0, 0xa9da, 0xa9de, 0xa9e0, 0xa9e5, 0xa9e7, + 0xa9f0, 0xa9fa, 0xa9ff, 0xaa00, 0xaa29, 0xaa2e, 0xaa32, 0xaa35, 0xaa37, 0xaa40, 0xaa43, 0xaa44, 0xaa4c, 0xaa4e, 0xaa50, 0xaa5a, 0xaa5c, 0xaa60, 0xaa70, 0xaa71, + 0xaa77, 0xaa7a, 0xaa7d, 0xaa7e, 0xaab0, 0xaab4, 0xaab7, 0xaab9, 0xaabd, 0xaac2, 0xaac3, 0xaadb, 0xaade, 0xaae0, 0xaaeb, 0xaaef, 0xaaf2, 0xaaf5, 0xaaf7, 0xab01, + 0xab07, 0xab09, 0xab0f, 0xab11, 0xab17, 0xab20, 0xab27, 0xab28, 0xab2f, 0xab30, 0xab5b, 0xab5c, 0xab60, 0xab69, 0xab6c, 0xab70, 0xabc0, 0xabe3, 0xabeb, 0xabee, + 0xabf0, 0xabfa, 0xac00, 0xd7a4, 0xd7b0, 0xd7c7, 0xd7cb, 0xd7fc, 0xd800, 0xe000, 0xf900, 0xfa6e, 0xfa70, 0xfada, 0xfb00, 0xfb07, 0xfb13, 0xfb18, 0xfb1d, 0xfb1f, + 0xfb29, 0xfb2a, 0xfb37, 0xfb38, 0xfb3d, 0xfb3e, 0xfb46, 0xfbb2, 0xfbc2, 0xfbd3, 0xfd3e, 0xfd40, 0xfd50, 0xfd90, 0xfd92, 0xfdc8, 0xfdf0, 0xfdfc, 0xfdfe, 0xfe00, + 0xfe10, 0xfe16, 0xfe1a, 0xfe20, 0xfe30, 0xfe33, 0xfe35, 0xfe45, 0xfe48, 0xfe4b, 0xfe4e, 0xfe51, 0xfe56, 0xfe59, 0xfe5f, 0xfe62, 0xfe66, 0xfe68, 0xfe6c, 0xfe70, + 0xfe75, 0xfe76, 0xfefd, 0xff01, 0xff02, 0xff07, 0xff0b, 0xff0e, 0xff10, 0xff1a, 0xff1c, 0xff1f, 0xff21, 0xff3b, 0xff3e, 0xff41, 0xff5b, 0xff5e, 0xff5f, 0xff64, + 0xff66, 0xff70, 0xff71, 0xff9e, 0xffa0, 0xffbf, 0xffc2, 0xffc8, 0xffca, 0xffd0, 0xffd2, 0xffd7, 0xffdb, 0xffde, 0xffe1, 0xffe4, 0xffe7, 0xffe9, 0xffed, 0xffef, + 0xfff9, 0xfffc, 0xfffe, +) + +@SharedImmutable +private val rangeCategory = intArrayOf( + 0x000f, 0x030c, 0x6b18, 0x5ab8, 0x5319, 0x0018, 0x0009, 0x0018, 0x0019, 0x0018, 0x0001, 0x5b15, 0x02fb, 0x0002, 0x5b35, 0x0019, 0x000f, 0x030c, 0x001a, 0x6f1c, + 0x67a5, 0x6f90, 0x2f3c, 0x0b6b, 0x6f18, 0x78ab, 0x616b, 0x0001, 0x0019, 0x0001, 0x0002, 0x0019, 0x0002, 0x0022, 0x0022, 0x0022, 0x0041, 0x0442, 0x0041, 0x0441, + 0x0841, 0x0001, 0x0821, 0x0841, 0x0422, 0x0041, 0x0041, 0x0002, 0x0441, 0x0041, 0x0841, 0x0025, 0x0002, 0x0005, 0x0861, 0x0022, 0x0022, 0x0c22, 0x0441, 0x0041, + 0x0002, 0x0422, 0x0022, 0x0001, 0x0041, 0x0002, 0x0005, 0x0002, 0x0004, 0x001b, 0x0004, 0x001b, 0x0004, 0x001b, 0x009b, 0x001b, 0x0006, 0x0041, 0x0764, 0x4622, + 0x0844, 0x0702, 0x0011, 0x001b, 0x0701, 0x0221, 0x0041, 0x0001, 0x0011, 0x0001, 0x0002, 0x0442, 0x0001, 0x0002, 0x0022, 0x0002, 0x6441, 0x0001, 0x0002, 0x0001, + 0x0002, 0x0022, 0x001c, 0x0006, 0x0007, 0x0041, 0x0041, 0x0022, 0x0011, 0x0001, 0x1231, 0x0018, 0x0002, 0x4698, 0x7391, 0x023a, 0x0006, 0x0014, 0x1b06, 0x0011, + 0x0005, 0x0011, 0x0005, 0x0018, 0x0011, 0x0010, 0x0019, 0x6b18, 0x001c, 0x0006, 0x4618, 0x0018, 0x0005, 0x0004, 0x0005, 0x0006, 0x0009, 0x0018, 0x18a5, 0x0005, + 0x0305, 0x0006, 0x0390, 0x0006, 0x1086, 0x0386, 0x0006, 0x0005, 0x0009, 0x0005, 0x7385, 0x0018, 0x1611, 0x0006, 0x0005, 0x0006, 0x0011, 0x0005, 0x0006, 0x0005, + 0x0011, 0x0009, 0x0005, 0x0006, 0x7084, 0x0018, 0x4624, 0x6b46, 0x0005, 0x0006, 0x0004, 0x0006, 0x10c6, 0x0086, 0x0006, 0x0011, 0x0018, 0x0011, 0x0005, 0x0006, + 0x6231, 0x0005, 0x0011, 0x0005, 0x0011, 0x0005, 0x0011, 0x0006, 0x0010, 0x0006, 0x0008, 0x0005, 0x0106, 0x0005, 0x0008, 0x0006, 0x0008, 0x1908, 0x0005, 0x0006, + 0x0005, 0x0006, 0x0018, 0x0009, 0x0098, 0x0005, 0x2106, 0x0011, 0x0005, 0x4625, 0x4625, 0x0005, 0x0011, 0x0005, 0x44b1, 0x14b1, 0x44a5, 0x14d1, 0x0008, 0x0006, + 0x2231, 0x4628, 0x14c8, 0x0011, 0x0008, 0x0011, 0x14b1, 0x18c5, 0x0011, 0x0009, 0x0005, 0x001a, 0x000b, 0x175c, 0x44d8, 0x18d1, 0x0228, 0x0005, 0x0011, 0x0005, + 0x0011, 0x0005, 0x0011, 0x0005, 0x44a5, 0x00d1, 0x0008, 0x0006, 0x0011, 0x18d1, 0x18d1, 0x4626, 0x00d1, 0x0011, 0x0005, 0x0225, 0x0011, 0x0009, 0x14c6, 0x18a5, + 0x0018, 0x0011, 0x20c6, 0x0011, 0x0005, 0x44a5, 0x0225, 0x0005, 0x0011, 0x0005, 0x44a5, 0x0005, 0x1a31, 0x0005, 0x0008, 0x0006, 0x44c6, 0x2228, 0x4626, 0x0005, + 0x0011, 0x18a5, 0x4626, 0x0009, 0x0358, 0x0011, 0x0005, 0x0006, 0x20d1, 0x0228, 0x0005, 0x4625, 0x4625, 0x0005, 0x0011, 0x0005, 0x44a5, 0x0005, 0x1a31, 0x0105, + 0x1906, 0x44c6, 0x2111, 0x2111, 0x0006, 0x0011, 0x20c6, 0x0011, 0x14b1, 0x18c5, 0x0011, 0x0009, 0x00bc, 0x000b, 0x0011, 0x14d1, 0x0005, 0x0011, 0x0005, 0x44a5, + 0x44a5, 0x1631, 0x0225, 0x4625, 0x14b1, 0x0011, 0x0005, 0x0011, 0x0005, 0x0011, 0x1908, 0x0011, 0x0008, 0x4508, 0x44c8, 0x00b1, 0x0011, 0x0008, 0x0011, 0x0009, + 0x000b, 0x001c, 0x035c, 0x0011, 0x2106, 0x00c8, 0x0005, 0x44a5, 0x0225, 0x0005, 0x0011, 0x0005, 0x0011, 0x18c5, 0x2106, 0x4508, 0x0006, 0x0011, 0x0006, 0x0011, + 0x18d1, 0x0005, 0x0011, 0x18a5, 0x4626, 0x0009, 0x0011, 0x0018, 0x000b, 0x18bc, 0x6108, 0x0005, 0x44a5, 0x0225, 0x0005, 0x0011, 0x0005, 0x0011, 0x0005, 0x0011, + 0x20a6, 0x0008, 0x00d1, 0x4508, 0x0006, 0x0011, 0x0008, 0x0011, 0x1625, 0x0006, 0x0011, 0x0009, 0x14b1, 0x0011, 0x0006, 0x0008, 0x0005, 0x44a5, 0x0225, 0x0005, + 0x18c5, 0x0008, 0x0006, 0x0111, 0x4508, 0x14c8, 0x463c, 0x1631, 0x20a5, 0x000b, 0x0005, 0x0006, 0x0011, 0x0009, 0x000b, 0x001c, 0x0005, 0x20d1, 0x0228, 0x0005, + 0x0011, 0x0005, 0x0011, 0x0005, 0x44b1, 0x0005, 0x0011, 0x1a31, 0x2231, 0x1908, 0x44c6, 0x0011, 0x0008, 0x0011, 0x0009, 0x2231, 0x0308, 0x0011, 0x0005, 0x18a5, + 0x0006, 0x0011, 0x001a, 0x0005, 0x0004, 0x0006, 0x0018, 0x0009, 0x0018, 0x0011, 0x14b1, 0x0011, 0x0005, 0x0011, 0x0005, 0x0225, 0x0005, 0x18a5, 0x0006, 0x4625, + 0x0005, 0x0091, 0x0006, 0x0011, 0x0009, 0x0011, 0x0005, 0x0011, 0x0005, 0x001c, 0x0018, 0x731c, 0x18dc, 0x001c, 0x0009, 0x000b, 0x00dc, 0x02d5, 0x0008, 0x0005, + 0x0011, 0x0005, 0x0011, 0x0006, 0x0008, 0x0006, 0x60c6, 0x0005, 0x0006, 0x0011, 0x0006, 0x0011, 0x001c, 0x0006, 0x001c, 0x479c, 0x0018, 0x001c, 0x0018, 0x0011, + 0x0005, 0x0008, 0x0006, 0x0008, 0x0006, 0x20c6, 0x18c8, 0x0005, 0x0009, 0x0018, 0x0005, 0x1908, 0x14a6, 0x18a5, 0x14c6, 0x0008, 0x0005, 0x0008, 0x0005, 0x0006, + 0x0005, 0x2106, 0x0006, 0x0008, 0x14c8, 0x0009, 0x0008, 0x7386, 0x0001, 0x0221, 0x0011, 0x0631, 0x0002, 0x0098, 0x0002, 0x0005, 0x0011, 0x0005, 0x0011, 0x0005, + 0x0225, 0x0005, 0x0011, 0x0005, 0x0011, 0x0005, 0x0011, 0x0005, 0x0011, 0x0005, 0x0011, 0x0005, 0x0225, 0x0005, 0x0011, 0x0005, 0x0011, 0x0005, 0x0011, 0x0005, + 0x0011, 0x0005, 0x0011, 0x0006, 0x0018, 0x000b, 0x0011, 0x0005, 0x001c, 0x0011, 0x0001, 0x0011, 0x0002, 0x5231, 0x0005, 0x031c, 0x0005, 0x000c, 0x0005, 0x02d5, + 0x0011, 0x0005, 0x0018, 0x000a, 0x0005, 0x0011, 0x0005, 0x0011, 0x0005, 0x0006, 0x0011, 0x0005, 0x0006, 0x0018, 0x0011, 0x0005, 0x0006, 0x0011, 0x0005, 0x44a5, + 0x0225, 0x0006, 0x0011, 0x0005, 0x20c6, 0x0006, 0x0008, 0x1908, 0x0006, 0x0018, 0x1318, 0x1758, 0x4626, 0x0009, 0x0011, 0x000b, 0x0011, 0x0018, 0x5318, 0x1b18, + 0x40c6, 0x0011, 0x0009, 0x0011, 0x0005, 0x0004, 0x0005, 0x0011, 0x0005, 0x0006, 0x0005, 0x00c5, 0x0011, 0x0005, 0x0011, 0x0005, 0x18d1, 0x2106, 0x1908, 0x2106, + 0x4628, 0x2231, 0x00c8, 0x0008, 0x0006, 0x0011, 0x7231, 0x6311, 0x0009, 0x0005, 0x0011, 0x0005, 0x0011, 0x0005, 0x0011, 0x0005, 0x0011, 0x0009, 0x000b, 0x0011, + 0x001c, 0x0005, 0x20c6, 0x44c8, 0x6311, 0x0005, 0x00c8, 0x0006, 0x0226, 0x20c8, 0x0006, 0x0008, 0x0006, 0x4626, 0x0009, 0x0011, 0x0009, 0x0011, 0x0018, 0x0004, + 0x0018, 0x0011, 0x0006, 0x1cc6, 0x0011, 0x0006, 0x0008, 0x0005, 0x0106, 0x0006, 0x0106, 0x0008, 0x1908, 0x0005, 0x0011, 0x0009, 0x0018, 0x001c, 0x0006, 0x001c, + 0x0011, 0x20c6, 0x0005, 0x18c8, 0x20c6, 0x18c8, 0x14a6, 0x0009, 0x0005, 0x1906, 0x1908, 0x0006, 0x0008, 0x0011, 0x0018, 0x0005, 0x0008, 0x0006, 0x0008, 0x0006, + 0x0011, 0x0018, 0x0009, 0x0011, 0x0005, 0x0009, 0x0005, 0x0004, 0x0018, 0x0002, 0x0011, 0x0001, 0x0011, 0x0001, 0x0018, 0x0011, 0x0006, 0x0018, 0x0006, 0x0008, + 0x0006, 0x0005, 0x0006, 0x0005, 0x18a5, 0x18c8, 0x0005, 0x0011, 0x0002, 0x0004, 0x0002, 0x0004, 0x0002, 0x0004, 0x0006, 0x0011, 0x0006, 0x0041, 0x0002, 0x0022, + 0x0002, 0x0001, 0x0002, 0x0011, 0x0001, 0x0011, 0x0002, 0x0001, 0x0002, 0x0001, 0x0002, 0x0011, 0x0001, 0x0011, 0x0002, 0x0031, 0x0002, 0x0001, 0x0002, 0x0011, + 0x0002, 0x0003, 0x0002, 0x0003, 0x0002, 0x0003, 0x0002, 0x4442, 0x0001, 0x0b63, 0x001b, 0x0002, 0x4442, 0x0001, 0x6f63, 0x085b, 0x4442, 0x0851, 0x0001, 0x0011, + 0x001b, 0x0002, 0x0001, 0x001b, 0x0a31, 0x4442, 0x0001, 0x6f63, 0x0011, 0x000c, 0x0010, 0x0014, 0x0018, 0x57dd, 0x57dd, 0x0018, 0x01cd, 0x0010, 0x000c, 0x0018, + 0x03dd, 0x0018, 0x5ef8, 0x6718, 0x02d5, 0x0018, 0x5f19, 0x0018, 0x000c, 0x0010, 0x0011, 0x0010, 0x008b, 0x0011, 0x000b, 0x0019, 0x12d5, 0x000b, 0x0019, 0x46d5, + 0x0004, 0x0011, 0x001a, 0x0011, 0x0006, 0x0007, 0x0006, 0x0007, 0x0006, 0x0011, 0x079c, 0x079c, 0x0422, 0x0841, 0x0821, 0x703c, 0x0019, 0x0001, 0x001c, 0x003c, + 0x0001, 0x005c, 0x0001, 0x0002, 0x0005, 0x7382, 0x0422, 0x0019, 0x0001, 0x0002, 0x033c, 0x005c, 0x000b, 0x000a, 0x0041, 0x000a, 0x738b, 0x0011, 0x0019, 0x001c, + 0x0019, 0x001c, 0x679c, 0x001c, 0x0019, 0x001c, 0x673c, 0x033c, 0x001c, 0x0019, 0x001c, 0x02d5, 0x001c, 0x0019, 0x001c, 0x02d5, 0x001c, 0x0019, 0x001c, 0x0019, + 0x001c, 0x0019, 0x001c, 0x0011, 0x001c, 0x0011, 0x000b, 0x001c, 0x000b, 0x001c, 0x0019, 0x001c, 0x0019, 0x001c, 0x0019, 0x001c, 0x0019, 0x001c, 0x02d5, 0x000b, + 0x001c, 0x0019, 0x02d5, 0x0019, 0x02d5, 0x0019, 0x001c, 0x0019, 0x02d5, 0x0019, 0x02d5, 0x0019, 0x02d5, 0x0019, 0x001c, 0x0019, 0x001c, 0x0019, 0x001c, 0x0011, + 0x001c, 0x0011, 0x001c, 0x0001, 0x0011, 0x0002, 0x0622, 0x0001, 0x0002, 0x0022, 0x0001, 0x0822, 0x0002, 0x0004, 0x0001, 0x0041, 0x0002, 0x001c, 0x0041, 0x0006, + 0x0041, 0x0011, 0x0018, 0x2f18, 0x0002, 0x0222, 0x0011, 0x0a31, 0x0005, 0x0011, 0x0304, 0x0011, 0x0006, 0x0005, 0x0011, 0x0005, 0x0011, 0x0005, 0x0011, 0x0005, + 0x0011, 0x0005, 0x0011, 0x0005, 0x0011, 0x0005, 0x0011, 0x0005, 0x0011, 0x0005, 0x0011, 0x0006, 0x0018, 0x03dd, 0x0018, 0x7bb8, 0x0018, 0x5318, 0x7bb8, 0x7bb8, + 0x02d5, 0x0018, 0x0004, 0x0018, 0x0014, 0x0018, 0x5714, 0x0018, 0x7398, 0x0011, 0x001c, 0x0011, 0x001c, 0x0011, 0x001c, 0x0011, 0x001c, 0x0011, 0x630c, 0x1398, + 0x0145, 0x02d5, 0x001c, 0x02d5, 0x52d5, 0x0396, 0x000a, 0x0006, 0x5108, 0x0004, 0x2b9c, 0x114a, 0x7305, 0x023c, 0x0005, 0x1a31, 0x6f66, 0x1484, 0x0014, 0x0005, + 0x1098, 0x00a4, 0x0011, 0x0005, 0x0011, 0x0005, 0x7391, 0x000b, 0x001c, 0x0005, 0x001c, 0x0011, 0x0005, 0x001c, 0x0011, 0x000b, 0x001c, 0x000b, 0x001c, 0x000b, + 0x001c, 0x000b, 0x001c, 0x000b, 0x001c, 0x0005, 0x001c, 0x0005, 0x0011, 0x0005, 0x0004, 0x0005, 0x0011, 0x001c, 0x0011, 0x0005, 0x0004, 0x0018, 0x0005, 0x0004, + 0x0018, 0x0005, 0x0009, 0x0005, 0x0011, 0x0041, 0x1cc5, 0x60e7, 0x0006, 0x0098, 0x0041, 0x0004, 0x0006, 0x0005, 0x000a, 0x0006, 0x0018, 0x0011, 0x001b, 0x0004, + 0x001b, 0x0041, 0x0002, 0x0022, 0x0004, 0x0002, 0x0022, 0x0041, 0x6f64, 0x0041, 0x0025, 0x0822, 0x0022, 0x0001, 0x0002, 0x0001, 0x0041, 0x0011, 0x0441, 0x0821, + 0x0002, 0x0011, 0x1441, 0x0884, 0x0005, 0x00c5, 0x18a5, 0x18a5, 0x0005, 0x1908, 0x0106, 0x001c, 0x0006, 0x0011, 0x000b, 0x6b9c, 0x0011, 0x0005, 0x0018, 0x0011, + 0x0008, 0x0005, 0x0008, 0x0006, 0x0011, 0x0018, 0x0009, 0x0011, 0x0006, 0x0005, 0x0018, 0x1705, 0x0006, 0x0009, 0x0005, 0x0006, 0x0018, 0x0005, 0x0006, 0x0008, + 0x0011, 0x0018, 0x0005, 0x0011, 0x0006, 0x0008, 0x0005, 0x2106, 0x0006, 0x0008, 0x0006, 0x0008, 0x0018, 0x0091, 0x0009, 0x0011, 0x0018, 0x0005, 0x0086, 0x0005, + 0x0009, 0x0005, 0x0011, 0x0005, 0x0006, 0x2106, 0x2106, 0x0006, 0x0011, 0x0005, 0x0006, 0x0005, 0x0106, 0x0011, 0x0009, 0x0011, 0x0018, 0x0005, 0x0004, 0x0005, + 0x001c, 0x1905, 0x0008, 0x0005, 0x18a6, 0x14a6, 0x0006, 0x0005, 0x18c5, 0x0005, 0x0011, 0x10a5, 0x0018, 0x0005, 0x18c8, 0x6308, 0x1085, 0x00c8, 0x0011, 0x0005, + 0x0011, 0x0005, 0x0011, 0x0005, 0x0011, 0x0005, 0x0011, 0x0005, 0x0011, 0x0002, 0x001b, 0x0004, 0x0002, 0x6f64, 0x0011, 0x0002, 0x0005, 0x1908, 0x1918, 0x0011, + 0x0009, 0x0011, 0x0005, 0x0011, 0x0005, 0x0011, 0x0005, 0x0011, 0x0013, 0x0012, 0x0005, 0x0011, 0x0005, 0x0011, 0x0002, 0x0011, 0x0002, 0x0011, 0x00c5, 0x0005, + 0x0019, 0x0005, 0x0011, 0x0005, 0x0011, 0x1625, 0x0005, 0x001b, 0x0011, 0x0005, 0x02b6, 0x0011, 0x0005, 0x0011, 0x0005, 0x0011, 0x0005, 0x039a, 0x0011, 0x0006, + 0x0018, 0x5ab8, 0x0011, 0x0006, 0x5298, 0x0017, 0x02d5, 0x5718, 0x6316, 0x5f18, 0x62f7, 0x4718, 0x5318, 0x02d5, 0x0018, 0x6699, 0x0239, 0x6358, 0x0011, 0x0005, + 0x0011, 0x0005, 0x4231, 0x0018, 0x6b18, 0x5ab8, 0x5319, 0x0018, 0x0009, 0x0018, 0x0019, 0x0018, 0x0001, 0x5b15, 0x02fb, 0x0002, 0x5b35, 0x0019, 0x62d5, 0x0018, + 0x0005, 0x0004, 0x0005, 0x0004, 0x0005, 0x0011, 0x0005, 0x0011, 0x0005, 0x0011, 0x0005, 0x4625, 0x44a5, 0x6a31, 0x6f3a, 0x6b5c, 0x0391, 0x0019, 0x001c, 0x0011, + 0x0010, 0x001c, 0x0011, +) + + +private fun categoryValueFrom(code: Int, ch: Int): Int { + return when { + code < 0x20 -> code + code < 0x400 -> if ((ch and 1) == 1) code shr 5 else code and 0x1f + else -> + when (ch % 3) { + 2 -> code shr 10 + 1 -> (code shr 5) and 0x1f + else -> code and 0x1f + } + } +} + +/** + * Returns the Unicode general category of this character as an Int. + */ +internal fun Char.getCategoryValue(): Int { + val ch = this.toInt() + + val index = binarySearchRange(rangeStart, ch) + val start = rangeStart[index] + val code = rangeCategory[index] + val value = categoryValueFrom(code, ch - start) + + return if (value == 17) CharCategory.UNASSIGNED.value else value +} diff --git a/kotlin-native/runtime/src/main/kotlin/generated/_DigitChars.kt b/kotlin-native/runtime/src/main/kotlin/generated/_DigitChars.kt new file mode 100644 index 00000000000..ac793a85af0 --- /dev/null +++ b/kotlin-native/runtime/src/main/kotlin/generated/_DigitChars.kt @@ -0,0 +1,46 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.text + +// +// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateUnicodeData.kt +// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib +// + +// 37 ranges totally +@SharedImmutable +private val rangeStart = intArrayOf( + 0x0030, 0x0660, 0x06f0, 0x07c0, 0x0966, 0x09e6, 0x0a66, 0x0ae6, 0x0b66, 0x0be6, 0x0c66, 0x0ce6, 0x0d66, 0x0de6, 0x0e50, 0x0ed0, 0x0f20, 0x1040, 0x1090, 0x17e0, + 0x1810, 0x1946, 0x19d0, 0x1a80, 0x1a90, 0x1b50, 0x1bb0, 0x1c40, 0x1c50, 0xa620, 0xa8d0, 0xa900, 0xa9d0, 0xa9f0, 0xaa50, 0xabf0, 0xff10, +) + +internal fun binarySearchRange(array: IntArray, needle: Int): Int { + var bottom = 0 + var top = array.size - 1 + var middle = -1 + var value = 0 + while (bottom <= top) { + middle = (bottom + top) / 2 + value = array[middle] + if (needle > value) + bottom = middle + 1 + else if (needle == value) + return middle + else + top = middle - 1 + } + return middle - (if (needle < value) 1 else 0) +} + +/** + * Returns `true` if this character is a digit. + */ +internal fun Char.isDigitImpl(): Boolean { + val ch = this.toInt() + val index = binarySearchRange(rangeStart, ch) + val high = rangeStart[index] + 9 + return ch <= high +} diff --git a/kotlin-native/runtime/src/main/kotlin/generated/_LetterChars.kt b/kotlin-native/runtime/src/main/kotlin/generated/_LetterChars.kt new file mode 100644 index 00000000000..c18debca831 --- /dev/null +++ b/kotlin-native/runtime/src/main/kotlin/generated/_LetterChars.kt @@ -0,0 +1,130 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.text + +// +// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateUnicodeData.kt +// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib +// + +// 222 ranges totally +@SharedImmutable +private val rangeStart = intArrayOf( + 0x0041, 0x0061, 0x00aa, 0x00ba, 0x00c0, 0x00d8, 0x00df, 0x00f8, 0x00ff, 0x0138, 0x0149, 0x0172, 0x0181, 0x0190, 0x019f, 0x01ae, 0x01bd, 0x01cc, 0x01dd, 0x01e9, + 0x01f8, 0x0231, 0x0240, 0x024f, 0x0294, 0x02a3, 0x02b2, 0x02ec, 0x0370, 0x037f, 0x038e, 0x039d, 0x03ac, 0x03c8, 0x03d7, 0x03ee, 0x03fd, 0x0430, 0x045f, 0x048a, + 0x04c1, 0x04cf, 0x0531, 0x0559, 0x0560, 0x05d0, 0x066e, 0x06e5, 0x06ff, 0x074d, 0x07f4, 0x081a, 0x0840, 0x08b6, 0x0950, 0x0985, 0x09aa, 0x09bd, 0x09df, 0x0a05, + 0x0a2a, 0x0a39, 0x0a72, 0x0a93, 0x0ab5, 0x0ae0, 0x0b0f, 0x0b32, 0x0b5c, 0x0b83, 0x0b92, 0x0ba3, 0x0bd0, 0x0c12, 0x0c58, 0x0c85, 0x0caa, 0x0cde, 0x0d04, 0x0d3d, + 0x0d5f, 0x0d9a, 0x0dc0, 0x0e40, 0x0e86, 0x0ea7, 0x0ec0, 0x0f00, 0x0f88, 0x1050, 0x1065, 0x108e, 0x10a0, 0x10bf, 0x10d0, 0x10f1, 0x1100, 0x124a, 0x125a, 0x1290, + 0x12c0, 0x12d8, 0x1380, 0x13a0, 0x13f8, 0x1401, 0x166f, 0x16f1, 0x1720, 0x176e, 0x17dc, 0x1887, 0x1900, 0x1980, 0x1a20, 0x1b45, 0x1bba, 0x1c5a, 0x1c80, 0x1c90, + 0x1cbd, 0x1ce9, 0x1cfa, 0x1d00, 0x1d2c, 0x1d6a, 0x1d79, 0x1d9b, 0x1e00, 0x1e95, 0x1e9d, 0x1f00, 0x1f0f, 0x1f20, 0x1f2f, 0x1f3e, 0x1f4d, 0x1f5d, 0x1f6c, 0x1f7b, + 0x1f8a, 0x1f99, 0x1fa8, 0x1fae, 0x1fbe, 0x1fd0, 0x1fe0, 0x1ff2, 0x2071, 0x2102, 0x210f, 0x2124, 0x2131, 0x2145, 0x2183, 0x2c00, 0x2c30, 0x2c60, 0x2c6f, 0x2c7e, + 0x2c80, 0x2ce4, 0x2cf3, 0x2d00, 0x2d27, 0x2d36, 0x2da0, 0x2db8, 0x2dd0, 0x3005, 0x3041, 0x30fc, 0x31a0, 0x3400, 0x4e00, 0xa000, 0xa4d0, 0xa610, 0xa640, 0xa66e, + 0xa680, 0xa69c, 0xa722, 0xa731, 0xa770, 0xa77f, 0xa78e, 0xa79d, 0xa7ac, 0xa7bb, 0xa7ca, 0xa7f5, 0xa804, 0xa840, 0xa8fb, 0xa930, 0xa9cf, 0xa9fa, 0xaa44, 0xaa7e, + 0xaab9, 0xaadb, 0xab01, 0xab20, 0xab30, 0xab5c, 0xab70, 0xabc0, 0xd7b0, 0xf900, 0xfa70, 0xfb00, 0xfb13, 0xfb22, 0xfb3e, 0xfb4d, 0xfd50, 0xfe70, 0xff21, 0xff41, + 0xff66, 0xffd2, +) + +@SharedImmutable +private val rangeLength = intArrayOf( + 0x001a, 0x001a, 0x000c, 0x0001, 0x0017, 0x0007, 0x0018, 0x0007, 0x0039, 0x0011, 0x0029, 0x000f, 0x000f, 0x000f, 0x000f, 0x000f, 0x000f, 0x0011, 0x000c, 0x000f, + 0x0039, 0x000f, 0x000f, 0x0045, 0x000f, 0x000f, 0x0033, 0x0003, 0x000e, 0x000e, 0x000f, 0x000f, 0x001c, 0x000f, 0x0017, 0x000f, 0x0033, 0x002f, 0x0023, 0x0037, + 0x000e, 0x0061, 0x0026, 0x0001, 0x0029, 0x007b, 0x0068, 0x0018, 0x0031, 0x009e, 0x0022, 0x000f, 0x0075, 0x0088, 0x0031, 0x0024, 0x0010, 0x0021, 0x001e, 0x0024, + 0x000f, 0x0026, 0x0020, 0x0021, 0x001c, 0x002d, 0x0022, 0x000c, 0x0016, 0x000e, 0x000e, 0x0017, 0x0041, 0x002c, 0x0029, 0x0024, 0x0014, 0x0015, 0x0037, 0x001a, + 0x0038, 0x0024, 0x0074, 0x0045, 0x0020, 0x0017, 0x0020, 0x006d, 0x00b8, 0x0012, 0x001d, 0x0001, 0x001f, 0x000f, 0x0021, 0x000f, 0x0149, 0x000f, 0x0034, 0x002f, + 0x0017, 0x0083, 0x0010, 0x0056, 0x0006, 0x026c, 0x007c, 0x0021, 0x004d, 0x006a, 0x00a9, 0x006f, 0x0075, 0x0097, 0x0114, 0x006b, 0x0096, 0x0024, 0x0009, 0x002b, + 0x0003, 0x000e, 0x0001, 0x002c, 0x003e, 0x000f, 0x0022, 0x0025, 0x0095, 0x0008, 0x0063, 0x000f, 0x000f, 0x000f, 0x000f, 0x000f, 0x000f, 0x000f, 0x000f, 0x000f, + 0x000f, 0x000f, 0x0006, 0x000f, 0x000f, 0x000c, 0x000d, 0x000b, 0x002c, 0x000d, 0x000f, 0x000d, 0x000f, 0x000a, 0x0002, 0x002f, 0x002f, 0x000f, 0x000f, 0x0002, + 0x0064, 0x000f, 0x0001, 0x0026, 0x000f, 0x0061, 0x0017, 0x0017, 0x0060, 0x0038, 0x00ba, 0x0093, 0x0060, 0x19c0, 0x51fd, 0x048d, 0x013d, 0x001c, 0x002e, 0x0012, + 0x001c, 0x0084, 0x000f, 0x003f, 0x000f, 0x000f, 0x000f, 0x000f, 0x000f, 0x000f, 0x0001, 0x000f, 0x001f, 0x00b8, 0x002b, 0x0083, 0x0021, 0x0049, 0x0037, 0x0039, + 0x000a, 0x001a, 0x0016, 0x000f, 0x002b, 0x000e, 0x0050, 0x2be4, 0x004c, 0x016e, 0x006a, 0x0007, 0x000f, 0x001b, 0x000f, 0x01f1, 0x00ac, 0x008d, 0x001a, 0x001a, + 0x006a, 0x000b, +) + +@SharedImmutable +private val rangeCategory = intArrayOf( + 0x0006, 0x0005, 0x1400003, 0x0007, 0x0006, 0x0006, 0x0005, 0x0005, 0x0019, 0x0019, 0x0019, 0x5599a666, 0x696a699a, 0x5a56a69a, 0x5966999a, 0x6d699a9a, 0x79e7bfd5, 0x0019, 0x0019, 0x699e5999, + 0x0016, 0x5a695559, 0x66666a99, 0x0005, 0x55555557, 0x7d555555, 0x70c0840, 0x0013, 0x15706366, 0x18a88002, 0x6aaaaa9a, 0x6aaaa2aa, 0x0005, 0x56a59555, 0x0019, 0x56986556, 0x0006, 0x0005, 0x0019, 0x0016, + 0x0016, 0x0019, 0x0006, 0x0007, 0x0005, 0x1684086c, 0xe30208, 0x5020e08, 0x812004, 0xc011764, 0x2810808, 0x1811204, 0x1a8b0e64, 0x1b67848, 0x78a0e04, 0x1020420, 0x181021c, 0x6812004, 0x5021c0c, 0x1020818, + 0x73cf3fff, 0x843e04, 0x89200c, 0x870258, 0x9010614, 0x5812e08, 0x960408, 0x1850208, 0x7830208, 0x1860204, 0x1f33c0ff, 0x1830608, 0x886804, 0x190025c, 0xf020a0c, 0x830220, 0x1850228, 0x7820204, 0x830224, 0x2812004, + 0x286300c, 0x890260, 0xb0741c, 0x82741c, 0x980214, 0x4820228, 0xa810214, 0x887e04, 0xa2be614, 0x1840818, 0x2030e08, 0x0007, 0x0006, 0x60022aaa, 0x0005, 0x55c55555, 0x0007, 0x870410, 0xa90410, 0x1040284, + 0x1040204, 0x10402e4, 0x0007, 0x0006, 0x0005, 0x0007, 0x29a0244, 0x8d0e20, 0x7121c48, 0x11b41e0c, 0x3d98604, 0x2810288, 0x11e627c, 0x1b1a08b0, 0x2e81a4d4, 0x69e6e1c, 0x14a434b0, 0x0007, 0x0005, 0x0006, + 0x0006, 0x860210, 0x0007, 0x0005, 0x0007, 0x75555557, 0x0005, 0x0007, 0x0016, 0x0005, 0x0019, 0x6aaa5555, 0x6aa81556, 0x6aaa5555, 0x6aa95556, 0x6aa0555a, 0x62155542, 0x6a955562, 0x555555aa, 0x7d555415, + 0x75555fff, 0x55557fff, 0x0007, 0x7aa5155f, 0x7aa51501, 0x1aa5055, 0x6aa5555, 0x7aa515, 0x8011a04, 0x5a90802, 0x6aa021a9, 0x64aa222, 0x6941ff6a, 0x140156, 0x0016, 0x0006, 0x0005, 0x699996a6, 0x7d55659a, 0x0006, + 0x0016, 0x60198001, 0x0005, 0x0005, 0x7ffc1001, 0x8010ec8, 0x87021c, 0x87021c, 0x2807021c, 0x2855408, 0x830d58, 0xab0a10, 0x6080, 0x0007, 0x0007, 0x0007, 0x04b8, 0x1440, 0x0016, 0x2004, + 0x0016, 0x18c60408, 0x56666666, 0x0019, 0x69995557, 0x660d9999, 0x6666566d, 0x69999999, 0x6666aa6a, 0x66a98199, 0x0005, 0x73fff7f6, 0x840208, 0x1f321cd0, 0x5820204, 0x39d325c, 0x852004, 0xba90214, 0x1972820, 0x18102c8, + 0x810414, 0x38b040c, 0x1060418, 0x021c, 0x0005, 0x1d5555ff, 0x0005, 0x3a8c, 0x085c, 0x0007, 0x0007, 0x0005, 0x7f300155, 0x8d021c, 0x7fff3cf3, 0x4394, 0x14360500, 0x0214, 0x0006, 0x0005, + 0x1060764, 0x0418, +) + + +/** + * Returns `true` if this character is a letter. + */ +internal fun Char.isLetterImpl(): Boolean { + return getLetterType() != 0 +} + +/** + * Returns `true` if this character is a lower case letter. + */ +internal fun Char.isLowerCaseImpl(): Boolean { + return getLetterType() == 1 +} + +/** + * Returns `true` if this character is an upper case letter. + */ +internal fun Char.isUpperCaseImpl(): Boolean { + return getLetterType() == 2 +} + +/** + * Returns + * - `1` if the character is a lower case letter, + * - `2` if the character is an upper case letter, + * - `3` if the character is a letter but not a lower or upper case letter, + * - `0` otherwise. + */ +private fun Char.getLetterType(): Int { + val ch = this.toInt() + val index = binarySearchRange(rangeStart, ch) + + val rangeStart = rangeStart[index] + val rangeEnd = rangeStart + rangeLength[index] - 1 + val code = rangeCategory[index] + + if (ch > rangeEnd) { + return 0 + } + + val lastTwoBits = code and 0x3 + + if (lastTwoBits == 0) { // gap pattern + var shift = 2 + var threshold = rangeStart + for (i in 0..1) { + threshold += (code shr shift) and 0x7f + if (threshold > ch) { + return 3 + } + shift += 7 + threshold += (code shr shift) and 0x7f + if (threshold > ch) { + return 0 + } + shift += 7 + } + return 3 + } + + if (code <= 0x7) { + return lastTwoBits + } + + val distance = (ch - rangeStart) + val shift = if (code <= 0x1F) distance % 2 else distance + return (code shr (2 * shift)) and 0x3 +} diff --git a/kotlin-native/runtime/src/main/kotlin/generated/_WhitespaceChars.kt b/kotlin-native/runtime/src/main/kotlin/generated/_WhitespaceChars.kt new file mode 100644 index 00000000000..fe55745b8bd --- /dev/null +++ b/kotlin-native/runtime/src/main/kotlin/generated/_WhitespaceChars.kt @@ -0,0 +1,31 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package kotlin.text + +// +// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateUnicodeData.kt +// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib +// + +// 9 ranges totally +/** + * Returns `true` if this character is a whitespace. + */ +internal fun Char.isWhitespaceImpl(): Boolean { + val ch = this.toInt() + return ch in 0x0009..0x000d + || ch in 0x001c..0x0020 + || ch == 0x00a0 + || ch > 0x1000 && ( + ch == 0x1680 + || ch in 0x2000..0x200a + || ch == 0x2028 + || ch == 0x2029 + || ch == 0x202f + || ch == 0x205f + || ch == 0x3000 + ) +} diff --git a/kotlin-native/runtime/src/main/kotlin/kotlin/text/Char.kt b/kotlin-native/runtime/src/main/kotlin/kotlin/text/Char.kt index b8b11f70b2d..b787df5e3d4 100644 --- a/kotlin-native/runtime/src/main/kotlin/kotlin/text/Char.kt +++ b/kotlin-native/runtime/src/main/kotlin/kotlin/text/Char.kt @@ -9,27 +9,69 @@ import kotlin.IllegalArgumentException /** * Returns `true` if this character (Unicode code point) is defined in Unicode. + * + * A character is considered to be defined in Unicode if its [category] is not [CharCategory.UNASSIGNED]. */ -@SymbolName("Kotlin_Char_isDefined") -external public fun Char.isDefined(): Boolean +public actual fun Char.isDefined(): Boolean { + if (this < '\u0080') { + return true + } + return getCategoryValue() != CharCategory.UNASSIGNED.value +} /** * Returns `true` if this character is a letter. + * + * A character is considered to be a letter if its [category] is [CharCategory.UPPERCASE_LETTER], + * [CharCategory.LOWERCASE_LETTER], [CharCategory.TITLECASE_LETTER], [CharCategory.MODIFIER_LETTER], or [CharCategory.OTHER_LETTER]. + * + * @sample samples.text.Chars.isLetter */ -@SymbolName("Kotlin_Char_isLetter") -external public fun Char.isLetter(): Boolean +public actual fun Char.isLetter(): Boolean { + if (this in 'a'..'z' || this in 'A'..'Z') { + return true + } + if (this < '\u0080') { + return false + } + return isLetterImpl() +} /** * Returns `true` if this character is a letter or digit. + * + * @see isLetter + * @see isDigit + * + * @sample samples.text.Chars.isLetterOrDigit */ -@SymbolName("Kotlin_Char_isLetterOrDigit") -external public fun Char.isLetterOrDigit(): Boolean +public actual fun Char.isLetterOrDigit(): Boolean { + if (this in 'a'..'z' || this in 'A'..'Z' || this in '0'..'9') { + return true + } + if (this < '\u0080') { + return false + } + + return isDigit() || isLetter() +} /** - * Returns `true` if this character (Unicode code point) is a digit. + * Returns `true` if this character is a digit. + * + * A character is considered to be a digit if its [category] is [CharCategory.DECIMAL_DIGIT_NUMBER]. + * + * @sample samples.text.Chars.isDigit */ -@SymbolName("Kotlin_Char_isDigit") -external public fun Char.isDigit(): Boolean +public actual fun Char.isDigit(): Boolean { + if (this in '0'..'9') { + return true + } + if (this < '\u0080') { + return false + } + return isDigitImpl() +} /** * Returns `true` if this character (Unicode code point) should be regarded as an ignorable @@ -40,28 +82,69 @@ external public fun Char.isIdentifierIgnorable(): Boolean /** * Returns `true` if this character is an ISO control character. + * + * A character is considered to be an ISO control character if its code is in the range `'\u0000'..'\u001F'` or in the range `'\u007F'..'\u009F'`. + * + * @sample samples.text.Chars.isISOControl */ @SymbolName("Kotlin_Char_isISOControl") -external public fun Char.isISOControl(): Boolean +external public actual fun Char.isISOControl(): Boolean /** * Determines whether a character is whitespace according to the Unicode standard. * Returns `true` if the character is whitespace. + * + * @sample samples.text.Chars.isWhitespace */ -@SymbolName("Kotlin_Char_isWhitespace") -external public actual fun Char.isWhitespace(): Boolean +public actual fun Char.isWhitespace(): Boolean = isWhitespaceImpl() /** - * Returns `true` if this character is upper case. + * Returns `true` if this character is an upper case letter. + * + * A character is considered to be an upper case letter if its [category] is [CharCategory.UPPERCASE_LETTER]. + * + * @sample samples.text.Chars.isUpperCase */ -@SymbolName("Kotlin_Char_isUpperCase") -external public fun Char.isUpperCase(): Boolean +public actual fun Char.isUpperCase(): Boolean { + if (this in 'A'..'Z') { + return true + } + if (this < '\u0080') { + return false + } + return isUpperCaseImpl() +} /** - * Returns `true` if this character is lower case. + * Returns `true` if this character is a lower case letter. + * + * A character is considered to be a lower case letter if its [category] is [CharCategory.LOWERCASE_LETTER]. + * + * @sample samples.text.Chars.isLowerCase */ -@SymbolName("Kotlin_Char_isLowerCase") -external public fun Char.isLowerCase(): Boolean +public actual fun Char.isLowerCase(): Boolean { + if (this in 'a'..'z') { + return true + } + if (this < '\u0080') { + return false + } + return isLowerCaseImpl() +} + +/** + * Returns `true` if this character is a title case letter. + * + * A character is considered to be a title case letter if its [category] is [CharCategory.TITLECASE_LETTER]. + * + * @sample samples.text.Chars.isTitleCase + */ +public actual fun Char.isTitleCase(): Boolean { + if (this < '\u0080') { + return false + } + return getCategoryValue() == CharCategory.TITLECASE_LETTER.value +} /** * Converts this character to upper case using Unicode mapping rules of the invariant locale. @@ -152,13 +235,10 @@ internal actual fun digitOf(char: Char, radix: Int): Int = digitOfChecked(char, external internal fun digitOfChecked(char: Char, radix: Int): Int /** - * Returns a value indicating a character's general category. + * Returns the Unicode general category of this character. */ -public val Char.category: CharCategory get() = CharCategory.valueOf(getType()) - -/** Retrun a Unicode category of the character as an Int. */ -@SymbolName("Kotlin_Char_getType") -external internal fun Char.getType(): Int +public actual val Char.category: CharCategory + get() = CharCategory.valueOf(getCategoryValue()) /** * Checks whether the given [radix] is valid radix for string to number and number to string conversion. diff --git a/kotlin-native/runtime/src/main/kotlin/kotlin/text/CharCategory.kt b/kotlin-native/runtime/src/main/kotlin/kotlin/text/CharCategory.kt index 3bdd766f5df..c7def3375de 100644 --- a/kotlin-native/runtime/src/main/kotlin/kotlin/text/CharCategory.kt +++ b/kotlin-native/runtime/src/main/kotlin/kotlin/text/CharCategory.kt @@ -1,13 +1,13 @@ /* - * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license - * that can be found in the LICENSE file. + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ package kotlin.text /** * Represents the character general category in the Unicode specification. */ -public enum class CharCategory(public val value: Int, public val code: String) { +public actual enum class CharCategory(public val value: Int, public actual val code: String) { /** * General category "Cn" in the Unicode specification. */ @@ -161,14 +161,14 @@ public enum class CharCategory(public val value: Int, public val code: String) { /** * Returns `true` if [char] character belongs to this category. */ - public operator fun contains(char: Char): Boolean = char.getType() == this.value + public actual operator fun contains(char: Char): Boolean = char.getCategoryValue() == this.value public companion object { public fun valueOf(category: Int): CharCategory = - when { - category >=0 && category <= 16 -> values()[category] - category >= 18 && category <= 30 -> values()[category - 1] - else -> throw IllegalArgumentException("Category #$category is not defined.") - } + when (category) { + in 0..16 -> values()[category] + in 18..30 -> values()[category - 1] + else -> throw IllegalArgumentException("Category #$category is not defined.") + } } } \ No newline at end of file From 8b2f0d644b20b647b4bbf34533e35122173251c0 Mon Sep 17 00:00:00 2001 From: Vasily Levchenko Date: Wed, 27 Jan 2021 15:18:17 +0100 Subject: [PATCH 209/212] [build] kotlin.*Compile: -Xskip-prerelease-check (cherry picked from commit 57172ac6ead928b565fefaf49d8405a07c856e25) --- kotlin-native/Interop/Indexer/build.gradle | 1 + kotlin-native/Interop/Runtime/build.gradle | 2 +- kotlin-native/backend.native/build.gradle | 6 +++++- kotlin-native/backend.native/tests/build.gradle | 4 ++++ .../groovy/org/jetbrains/kotlin/NativeInteropPlugin.groovy | 1 + kotlin-native/klib/build.gradle | 4 ++++ kotlin-native/shared/build.gradle.kts | 1 + .../tools/kotlin-native-gradle-plugin/build.gradle | 4 ++++ 8 files changed, 21 insertions(+), 2 deletions(-) diff --git a/kotlin-native/Interop/Indexer/build.gradle b/kotlin-native/Interop/Indexer/build.gradle index 93d3ae019fd..a9b94b00d74 100644 --- a/kotlin-native/Interop/Indexer/build.gradle +++ b/kotlin-native/Interop/Indexer/build.gradle @@ -144,6 +144,7 @@ kotlinNativeInterop { compileKotlin { kotlinOptions { allWarningsAsErrors=true + kotlinOptions.freeCompilerArgs = ["-Xskip-prerelease-check"] } } diff --git a/kotlin-native/Interop/Runtime/build.gradle b/kotlin-native/Interop/Runtime/build.gradle index 273e3b2e962..c90aa241156 100644 --- a/kotlin-native/Interop/Runtime/build.gradle +++ b/kotlin-native/Interop/Runtime/build.gradle @@ -76,7 +76,7 @@ sourceSets.main.kotlin.srcDirs += "src/jvm/kotlin" compileKotlin { kotlinOptions { freeCompilerArgs = ['-Xuse-experimental=kotlin.ExperimentalUnsignedTypes', '-Xuse-experimental=kotlin.Experimental', - '-Xopt-in=kotlin.RequiresOptIn', "-XXLanguage:+InlineClasses"] + '-Xopt-in=kotlin.RequiresOptIn', "-XXLanguage:+InlineClasses", "-Xskip-prerelease-check"] allWarningsAsErrors=true } } diff --git a/kotlin-native/backend.native/build.gradle b/kotlin-native/backend.native/build.gradle index e5da6cc46e9..be75830d275 100644 --- a/kotlin-native/backend.native/build.gradle +++ b/kotlin-native/backend.native/build.gradle @@ -57,7 +57,11 @@ compileCompilerKotlin { dependsOn('generateCompilerProto') kotlinOptions.jvmTarget = "1.8" kotlinOptions.allWarningsAsErrors=true - kotlinOptions.freeCompilerArgs += ['-Xopt-in=kotlin.RequiresOptIn', '-Xopt-in=org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI'] + kotlinOptions.freeCompilerArgs += ['-Xopt-in=kotlin.RequiresOptIn', '-Xopt-in=org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI', '-Xskip-prerelease-check'] +} + +compileCli_bcKotlin { + kotlinOptions.freeCompilerArgs += ['-Xskip-prerelease-check'] } compileCompilerJava { diff --git a/kotlin-native/backend.native/tests/build.gradle b/kotlin-native/backend.native/tests/build.gradle index 12f3fdda098..60ea4d33b1a 100644 --- a/kotlin-native/backend.native/tests/build.gradle +++ b/kotlin-native/backend.native/tests/build.gradle @@ -5023,6 +5023,10 @@ sourceSets { } } +compileNopPluginKotlin { + kotlinOptions.freeCompilerArgs += ['-Xskip-prerelease-check'] +} + Task pluginTest(String name, String pluginName, Closure configureClosure) { def jarTask = project.tasks.register("jar-$pluginName", Jar) { it.dependsOn("compile${pluginName.capitalize()}Kotlin") diff --git a/kotlin-native/build-tools/src/main/groovy/org/jetbrains/kotlin/NativeInteropPlugin.groovy b/kotlin-native/build-tools/src/main/groovy/org/jetbrains/kotlin/NativeInteropPlugin.groovy index 5db18fb4552..84125a01689 100644 --- a/kotlin-native/build-tools/src/main/groovy/org/jetbrains/kotlin/NativeInteropPlugin.groovy +++ b/kotlin-native/build-tools/src/main/groovy/org/jetbrains/kotlin/NativeInteropPlugin.groovy @@ -183,6 +183,7 @@ class NamedNativeInteropConfig implements Named { configuration = project.configurations.create(interopStubs.name) project.tasks.getByName(interopStubs.getTaskName("compile", "Kotlin")) { dependsOn genTask + kotlinOptions.freeCompilerArgs = ["-Xskip-prerelease-check"] } interopStubs.kotlin.srcDirs generatedSrcDir diff --git a/kotlin-native/klib/build.gradle b/kotlin-native/klib/build.gradle index 817e8e2fed5..0279bb779f6 100644 --- a/kotlin-native/klib/build.gradle +++ b/kotlin-native/klib/build.gradle @@ -37,6 +37,10 @@ konanArtifacts { } } +compileKotlin { + kotlinOptions.freeCompilerArgs += ['-Xskip-prerelease-check'] +} + repositories { maven { url buildKotlinCompilerRepo diff --git a/kotlin-native/shared/build.gradle.kts b/kotlin-native/shared/build.gradle.kts index c083af8e4f3..742198563b4 100644 --- a/kotlin-native/shared/build.gradle.kts +++ b/kotlin-native/shared/build.gradle.kts @@ -54,6 +54,7 @@ sourceSets["main"].withConvention(KotlinSourceSet::class) { tasks.withType { dependsOn(generateCompilerVersion) kotlinOptions.jvmTarget = "1.8" + kotlinOptions.freeCompilerArgs = listOf("-Xskip-prerelease-check") } tasks.clean { diff --git a/kotlin-native/tools/kotlin-native-gradle-plugin/build.gradle b/kotlin-native/tools/kotlin-native-gradle-plugin/build.gradle index c1c0a85232c..9dc3962f52d 100644 --- a/kotlin-native/tools/kotlin-native-gradle-plugin/build.gradle +++ b/kotlin-native/tools/kotlin-native-gradle-plugin/build.gradle @@ -67,6 +67,10 @@ configurations { testImplementation.extendsFrom bundleDependencies } +tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { + kotlinOptions.freeCompilerArgs = ["-Xskip-prerelease-check"] +} + dependencies { shadow "org.jetbrains.kotlin:kotlin-stdlib:1.3.0" From 29f68fe7ae7d23706c4c4881e55cfdb1669406da Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Thu, 28 Jan 2021 10:35:59 +0300 Subject: [PATCH 210/212] Temporary remove all -Werror flags This is needed for transational period of migrating kotlin repository to compiler with version 1.5 (cherry picked from commit 2836a17952dd47b5b8fe176a0b0374c23567b2ff) --- kotlin-native/Interop/Indexer/build.gradle | 4 ++-- kotlin-native/Interop/Runtime/build.gradle | 2 +- kotlin-native/Interop/StubGenerator/build.gradle | 2 +- kotlin-native/backend.native/build.gradle | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/kotlin-native/Interop/Indexer/build.gradle b/kotlin-native/Interop/Indexer/build.gradle index a9b94b00d74..97b112c3b9d 100644 --- a/kotlin-native/Interop/Indexer/build.gradle +++ b/kotlin-native/Interop/Indexer/build.gradle @@ -143,8 +143,8 @@ kotlinNativeInterop { compileKotlin { kotlinOptions { - allWarningsAsErrors=true - kotlinOptions.freeCompilerArgs = ["-Xskip-prerelease-check"] +// allWarningsAsErrors=true + freeCompilerArgs = ["-Xskip-prerelease-check"] } } diff --git a/kotlin-native/Interop/Runtime/build.gradle b/kotlin-native/Interop/Runtime/build.gradle index c90aa241156..06a0a6663a6 100644 --- a/kotlin-native/Interop/Runtime/build.gradle +++ b/kotlin-native/Interop/Runtime/build.gradle @@ -77,7 +77,7 @@ compileKotlin { kotlinOptions { freeCompilerArgs = ['-Xuse-experimental=kotlin.ExperimentalUnsignedTypes', '-Xuse-experimental=kotlin.Experimental', '-Xopt-in=kotlin.RequiresOptIn', "-XXLanguage:+InlineClasses", "-Xskip-prerelease-check"] - allWarningsAsErrors=true +// allWarningsAsErrors=true } } diff --git a/kotlin-native/Interop/StubGenerator/build.gradle b/kotlin-native/Interop/StubGenerator/build.gradle index d4b8b3e9d08..1dfc3680a27 100644 --- a/kotlin-native/Interop/StubGenerator/build.gradle +++ b/kotlin-native/Interop/StubGenerator/build.gradle @@ -47,6 +47,6 @@ dependencies { compileKotlin { kotlinOptions { freeCompilerArgs = ['-Xopt-in=kotlin.ExperimentalUnsignedTypes', '-Xskip-metadata-version-check'] - allWarningsAsErrors=true +// allWarningsAsErrors=true } } diff --git a/kotlin-native/backend.native/build.gradle b/kotlin-native/backend.native/build.gradle index be75830d275..9b4ef1a25dd 100644 --- a/kotlin-native/backend.native/build.gradle +++ b/kotlin-native/backend.native/build.gradle @@ -56,7 +56,7 @@ compileCompilerKotlin { // but not for Kotlin. dependsOn('generateCompilerProto') kotlinOptions.jvmTarget = "1.8" - kotlinOptions.allWarningsAsErrors=true +// kotlinOptions.allWarningsAsErrors=true kotlinOptions.freeCompilerArgs += ['-Xopt-in=kotlin.RequiresOptIn', '-Xopt-in=org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI', '-Xskip-prerelease-check'] } @@ -323,4 +323,4 @@ publishing { from components.java } } -} \ No newline at end of file +} From c4dcdff6461bace03158a21fdae3a6d4fc8d56e3 Mon Sep 17 00:00:00 2001 From: Vasily Levchenko Date: Fri, 29 Jan 2021 19:01:48 +0100 Subject: [PATCH 211/212] [kotlin compiler][update] 1.5.20-dev-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 482e217b5e9 - (tag: build-1.5.20-dev-7) JVM IR: Fix inline class mangling for calls to internal functions (5 hours ago) * 6747084fe23 - (tag: build-1.5.20-dev-2) FIR TEST: perform more accurate check on file identity (6 hours ago) * 338aad98eb8 - FIR: run diagnostic "with stdlib" tests also in light tree mode (6 hours ago) * 7d4eaefd368 - FIR: report UNSAFE_CALL on dot when possible (6 hours ago) * 0ee4f1f3934 - FIR: more exact nullability determination in potential UNSAFE_CALL check (6 hours ago) * e72ddbcbfeb - FIR checker: differentiate UNSAFE_CALL from INAPPLICABLE_CANDIDATE (6 hours ago) * 4b823eca21a - Fix test data (FIR_IDENTICAL) (6 hours ago) * 3e1fabd46c5 - (tag: build-1.5.0-dev-2278, tag: build-1.5.0-M1-7, origin/1.5.0-M1, origin/1.5.0) Set ANDROID_SDK_ROOT for android box tests (7 hours ago) * 4a50dc90745 - (tag: build-1.5.0-dev-2269, tag: build-1.5.0-M1-6) Add workaround for problem with initialization of :tools:kotlinp (8 hours ago) * e8068b5576a - Update testdata of maven plugin tests (8 hours ago) * 0a47b1c32b5 - Remove incorrectly added dependency on experimental coroutines (8 hours ago) * 0769157a161 - Revert "Revert "Build: enable -Werror in stdlib/core/compiler/plugins modules"" (8 hours ago) * 7e3802bde30 - Advance bootstrap to 1.5.0-dev-2205 (8 hours ago) * c5baf3fdd21 - (tag: build-1.5.0-dev-2267) Upgrade gradle plugin to 4.1. and build tools to 29.0.3 for android box tests (9 hours ago) * 9459f8113f6 - Set ANDROID_HOME/ANDROID_SDK_ROOT for android box tests (9 hours ago) * fd29fab971d - [Gradle, JS] Update tool versions (9 hours ago) * 9efac8f68b3 - Propagate all annotations during creating simple functional types (10 hours ago) * 5d7dc5fa396 - (tag: build-1.5.0-dev-2264) JVM_IR indy-SAM conversions: minor updates (10 hours ago) * f34224eceec - JVM_IR indy-SAM conversions: tests for function references equality (10 hours ago) * f0abd8bc68c - JVM_IR indy-SAM conversions: prohibit in crossinline lambdas (10 hours ago) * ad1d80d7008 - JVM_IR indy-SAM conversions: add more tests (10 hours ago) * 98b0c07b186 - JVM_IR indy-SAM conversions: inline funs and lambdas (10 hours ago) * 4da2f3d9d49 - JVM_IR indy-SAM conversions: use old scheme for suspend funs (10 hours ago) * 1f16b967965 - JVM_IR indy-SAM conversions: inline classes (10 hours ago) * f30e25aa524 - JVM_IR indy-SAM conversions: more cases (10 hours ago) * 3140cca0503 - JVM_IR indy-SAM conversions, 1st passing tests (10 hours ago) * c13949d322b - (tag: build-1.5.0-dev-2261) [Gradle, JS] Move incremental test into non-ir js tests and add module name into 2js plugin (11 hours ago) * 7e6abffb625 - (tag: build-1.5.0-dev-2255) FIR: Fix incorrectly serialized type (13 hours ago) * 1e0d9f4075f - FIR2IR: Do not add implicit casts for types with different nullability (13 hours ago) * 5c62ee4ba89 - FIR2IR: Fix complex cases of smart cast expressions used as dispatch receiver (13 hours ago) * b3b1eb57ae6 - FIR2IR: Simplify Fir2IrImplicitCastInserter::convertToImplicitCastExpression (13 hours ago) * 71596a08b3a - FIR2IR: Simplify Fir2IrImplicitCastInserter (13 hours ago) * aab85121e2f - Minor. Add clarification comment to MainFunctionDetector (13 hours ago) * b1b89e6f5f8 - FIR2IR: Fix smart-cast approximation implicit receiver (13 hours ago) * d9f45fdf9e8 - FIR2IR: Fix incorrect fake override structure for delegated member in supertype (13 hours ago) * 844d2572e5c - Don't run dx test in emulator (13 hours ago) * 1c612376dd3 - (tag: build-1.5.0-dev-2235) Disable some android box test (27 hours ago) * 0ad24f53460 - (tag: build-1.5.0-dev-2233) Enable Android box test (27 hours ago) * b16b1b3b782 - Test for obsolete KT-26360 (27 hours ago) * bea29d0de52 - Add test for KT-44074 (27 hours ago) * 5fa9acc17ac - (tag: build-1.5.0-dev-2227) [JS IR] Add additional exported declarations inside dce loop (28 hours ago) * d88d1d048e0 - [JS IR] Context to NameTables for stable names in additional exported declarations (28 hours ago) * f1860471011 - [JS IR] Add additional exported declarations with exported stub to dce (28 hours ago) * 6e98b81f3ab - [JS IR] Use recursive isExported for stable name detection (28 hours ago) * 977781fa498 - [JS IR] Add tests with export all file and export nested class (28 hours ago) * 1b68f35f7ca - (tag: build-1.5.0-dev-2217) FIR: create new ConeTypeCheckerContext on every supertypes calculation (32 hours ago) * 1c80c5610dd - (tag: build-1.5.0-dev-2205, origin/mg/performance-check-1) FIR: fix serialization of accessor with source-level annotations (34 hours ago) * 72b07c727b4 - fixup! Add runtime dependency on experimental coroutines to :kotlin-scripting-compiler-impl (34 hours ago) * 4389cc77879 - Update testdata of maven plugin tests (34 hours ago) * 8b892a46c9d - Update testdata of maven plugin test (34 hours ago) * f740e4141c9 - Temporary force building all libraries with old backend (34 hours ago) * 71d8b842fde - Add runtime dependency on experimental coroutines to :kotlin-scripting-compiler-impl (34 hours ago) * 17230397e65 - [Test] Update or drop some IDE tests about experimental coroutines (34 hours ago) * bc3b791cd83 - [TMP] Remove :kotlin-coroutines-experimental-compat module (34 hours ago) * 1300ec3e453 - Revert "Build: enable -Werror in stdlib/core/compiler/plugins modules" (34 hours ago) * f3364ec602f - [TD] Update testdata according to KT-44546 (34 hours ago) * 299272fa6df - [Test] Update diagnostics testdata according to allowed suspend fun interfaces (34 hours ago) * a253b9508ee - Mute some ultra light classes tests according to KT-44472 (34 hours ago) * c0bc4920299 - Mute some script tests according to KT-44471 (34 hours ago) * 95aa8dc85a0 - Fix detecting of non-physical files in ClassFileFactory (34 hours ago) * 3b97835b742 - Disable `-Werror` for :compiler:cli module (34 hours ago) * 2c3031f981d - [Test] Mute IC with circular dependencies with JVM IR backend (34 hours ago) * ba44ad1aa31 - Approximate anonymous return types for private inline functions to explicit supertype or Any (KT-33917) (34 hours ago) * 670f029bdf2 - Allow passing non-spread arrays into a vararg parameter after sam properly, through propagating vararg element type to a sam adapter from the original parameter descriptor (34 hours ago) * af3eaf5d710 - Add explicit disabling `ProhibitVarargAsArrayAfterSamArgument` feature in tests as it's enabled by default in 1.5 (34 hours ago) * e39bbcd937c - Unmute test which checks the evaluation order of value arguments with varargs. (34 hours ago) * 4f8b12c96fd - [Test] Fix various tests according to switching to kotlin 1.5 (34 hours ago) * 64100eec07e - [Test] Add workaround for KT-44359 (34 hours ago) * ffc585ad5ca - [Debugger] Fix compiler option for disabling IR backend in tests (34 hours ago) * cd93b2f39be - Use old backend in script compilation context (34 hours ago) * ee1aff10128 - [Test] Update different testdata according to changes in sealed classes (34 hours ago) * 81fd8b59409 - [IR] Fix undeterministic order in signature clash reporting (34 hours ago) * 6a2796b067c - [Test] Fix source maps in testdata according to KT-37704 (34 hours ago) * a6600cef474 - [Test] Remove some outdated tests from LocalInspectionTestGenerated (34 hours ago) * a9ef8bb32f8 - [IDE] Update SuperClassNotInitialized to relaxed restrictions on sealed classes (34 hours ago) * 16e0c0b8200 - [Test] Update testdata of quickfix tests related to sealed classes (34 hours ago) * 7632c117456 - Enforce using old backend in JvmCliReplShellExtension (34 hours ago) * c6039d76d39 - Enforce using old backend in JvmAbiAnalysisHandlerExtension (34 hours ago) * f350e9dacb1 - Fix rendering of metadata of multifile facades in classFilesComparison.kt (34 hours ago) * 1deb317e0d6 - Update and regenerate incremental compilation tests for 1.5 (34 hours ago) * 4dff7e648fd - Minor, restore abiStabilityUnstableWithOldBackend CLI test (34 hours ago) * d87d0cceae4 - JVM IR: report all sources as outputs for .kotlin_module file (34 hours ago) * f3393eae1bb - [Test] Update testdata of CompileKotlinAgainstCustomBinariesTest (34 hours ago) * 9b80a552e91 - [Test] Update testdata of spec tests (34 hours ago) * 73e6d422242 - [Test] Update CLI tests according to new default language version (34 hours ago) * 5122e748c18 - Add workaround for KT-44316 (34 hours ago) * facc52fe49c - Introduce ApiVersion.KOTLIN_1_5 (34 hours ago) * f14bd87ecc2 - [Test] Update testdata of diagnostic tests during to change language to 1.5 (34 hours ago) * d7cfd9c188c - Switch latest stable version to 1.5 (34 hours ago) * 5098eb84af0 - Switch IS_PRE_RELEASE flag to true (34 hours ago) * 836261ba6ee - (tag: build-1.5.0-dev-2201, tag: build-1.5.0-dev-2195) [Test] Ignore test infrastucture sources in debugging tests (2 days ago) * 46b7a774b55 - (tag: build-1.5.0-dev-2182, tag: build-1.5.0-dev-2180) Commonize CharCategory and related functions #KT-39177 #KT-43216 #KT-39906 #KT-30652 (2 days ago) * 9b429fb535f - (tag: build-1.5.0-dev-2171) FIR IDE: update testdata (2 days ago) * 1d167e4bc5c - FIR: enable inline classes support in kotlin.compiler.fir.tree module (2 days ago) * c53d6ed5d2b - FIR: remove SymbolProviderCache as it is unused now (2 days ago) * 9f5b46cc76d - FIR: use MutableMap in JavaSymbolProvider.parentClassTypeParameterStackCache as temp solution (2 days ago) * 6a83b8b5a4f - FIR: migrate FirDependenciesSymbolProviderImpl to FirCachesFactory (2 days ago) * 6543429b9a5 - FIR: use FirCachesFactory for package parts cache in KotlinDeserializedJvmSymbolsProvider (2 days ago) * 32ae395e055 - FIR: use FirCachesFactory for package type alias in KotlinDeserializedJvmSymbolsProvider (2 days ago) * b270d66f682 - FIR: use FirCachesFactory for class cache in KotlinDeserializedJvmSymbolsProvider (2 days ago) * 3cee5e848a5 - FIR: encapsulate annotation loading in KotlinDeserializedJvmSymbolsProvider.knownClassNamesInPackage into class (2 days ago) * 169134655a1 - FIR: encapsulate KotlinDeserializedJvmSymbolsProvider.knownClassNamesInPackage into class (2 days ago) * 7284acc9f9a - FIR IDE: use FirCaches in JavaSymbolProvider (2 days ago) * 1fef5859e31 - FIR IDE: implement thread safe fir caches for IDE (2 days ago) * 191a948ffe7 - FIR: introduce caches factory (2 days ago) * 2f12b8f87fe - FIR: refactoring, move class Java class building to separate fun (2 days ago) * 93436c1341f - (tag: build-1.5.0-dev-2170) FIR: optimize / simplify member checkers (2 days ago) * 97241599bf5 - FIR checker: add support diagnostic: EXPECTED_PRIVATE_DECLARATION (2 days ago) * 57c8dd86a09 - FIR checker: introduce top-level property checkers (2 days ago) * f9378a3ab72 - FIR checker: add diagnostic EXPECTED_DECLARATION_WITH_BODY (2 days ago) * 9341ca3004f - FIR checker: introduce top-level function checker (2 days ago) * df68f319bc0 - FIR LT: simplify defaultValue() search (2 days ago) * 8b4f2b269c1 - FIR checker: introduce PARAMETER_* positioning strategies (2 days ago) * 33b7c68a21f - (tag: build-1.5.0-dev-2161) Add FIR_IDENTICAL to kt44440.kt test (2 days ago) * 977ac7cbe73 - (tag: build-1.5.0-dev-2150) Propagate nullness flexibility into the result type from type variables in other constraints during result type finding, to prevent variable fixation to less flexible type (2 days ago) * ce1f9882dfb - (tag: build-1.5.0-dev-2140) FIR2IR: Fix mapping for intersection overrides of deserialized functions (2 days ago) * 4bde884844d - (tag: build-1.5.0-dev-2138) [JS IR] Use non-persistent IR for non-dce-driven mode (2 days ago) * 02615ec569c - [JS IR] Fix: Use proper parameter in ExportedDefaultParameterStub (2 days ago) * 75ed1675664 - (tag: build-1.5.0-dev-2117, minamoto/composite-build-fix) FIR IDE: Use `FirModuleResolveState` instead of `TowerDataContextProvider` (3 days ago) * dd91ebf1eae - FIR IDE: Collect TowerDataContext only for block-level expressions (3 days ago) * b51b8b59b1d - FIR IDE: Collect scopes in `FirDesignatedImplicitTypesTransformerForIDE` (3 days ago) * 445edf8e282 - FIR IDE: Mark `FirTowerDataContextCollector` as `ThreadSafeMutableState` (3 days ago) * 11564d79506 - FIR: Collect all scopes in `FirModuleResolveStateImpl` (3 days ago) * 8bc7866f016 - (tag: build-1.5.0-dev-2110) [KLIB] Fix klib IO when accessing parent file (3 days ago) * 6118d1cf23f - (tag: build-1.5.0-dev-2096, tag: build-1.5.0-dev-2086) [Commonizer] Fix commonizer build (3 days ago) * b0adcffed92 - [JS IR] Fix transitive dependency resolve (3 days ago) * 75016bf54db - [Gradle, JS] Fix bridge between Gradle and Js IR CLI (3 days ago) * 350ff8033d5 - [IC KLIB] Replace JS IR build log with KLIB build log for klib compialtion (3 days ago) * 5c25ef62e26 - [JVM IR] Fix jvm test runner (3 days ago) * b4ed7110dd6 - [IC TEST] Fix IC multi module tests for gradle (3 days ago) * 04777d2ff20 - [IC TEST] Generate legacy js multi module IC tests (3 days ago) * 898c0470dc6 - [IC TEST] Implement legacy js multi module gradle-like test infra (3 days ago) * 43022a292d3 - [IC TEST] Abstract multi module test runner from klib (3 days ago) * 5b1c70a4309 - [KLIB IC] Generate multi module klib IC tests (3 days ago) * 10d8e95df7a - [IC TEST] Support multi module IC tests for klibs (3 days ago) * 9aeda12b99c - [KLIB IC] Produce .klib file instead of directory in test (3 days ago) * 37c7f60ae7e - [KLIB] Fix issues between directory and .klib modes (3 days ago) * 939da9dbc82 - [KLIB] Take into account *.klib rebuild similar to *.jar (3 days ago) * daf1da1c70a - [KLIB IC] Fix klib IC test data (3 days ago) * 380225e0cb7 - [KLIB IC] Support special klib-build.log in IC test infrastructure (3 days ago) * 96ba3b873e9 - [IC] Add in-module tests for incremental compilation (3 days ago) * 697d4675a29 - [KLIB] Improve klib debugging implementing `KotlinLibrary.toString()` (3 days ago) * 2daf0cc11c2 - [JS IR] Support additional repositories in CLI (cli part) (3 days ago) * cd9e341fa96 - [JS IR] Support additional repositories in CLI (compiler part) (3 days ago) * e22711d17f5 - (tag: build-1.5.0-dev-2085) [FIR] Reuse empty scopes (3 days ago) * 67267518f03 - [FIR] Optimize tower group comparisons (3 days ago) * 4530cdefe5a - [FIR] Implement proper equals/hashCode for TowerGroupKind.WithDepth (3 days ago) * a4dd47daab6 - (tag: build-1.5.0-dev-2080, origin/master-for-ide) Update ReadMe.md (3 days ago) * 8019dbe06c2 - (tag: build-1.5.0-dev-2076) Do not leak LowMemoryWatcher on plugin unload (3 days ago) * 76c2288e211 - (tag: build-1.5.0-dev-2073) IrInterpreter: interpret IrGetField properly (3 days ago) * b311e95487e - FIR2IR: don't generate IR getter for const library properties (3 days ago) * e2521718dde - (tag: build-1.5.0-dev-2069) Kapt: Add flag to keep KDoc comments in stubs (3 days ago) * dcda47b502f - (tag: build-1.5.0-dev-2067) Ensure that Decompiler and IDE agree on rendered function types with parameterized annotations (3 days ago) * 122d04b9faa - (tag: build-1.5.0-dev-2065) Returned support for generic serializers in @UseSerializers (#4055) (3 days ago) * 1a4b3272107 - (tag: build-1.5.0-dev-2053) FIR2IR: fix smart casts in case field is accessed (3 days ago) * 1c9064836e2 - FIR2IR: fix intersection type smart cast when synthetic property accessed (3 days ago) * 504bdfc2835 - (tag: build-1.5.0-dev-2038) testData for binary compatibility tests on klib library evolution (4 days ago) * 3704b2a5af2 - (tag: build-1.5.0-dev-2031) Fix testJvmKtAppDependsOnMppTestRuntime after 3b0f4f31 (4 days ago) * d4965b1e6e2 - (tag: build-1.5.0-dev-2029) Avoid resolving deprecated configurations in tests (#3970) (4 days ago) * 3b0f4f31641 - (tag: build-1.5.0-dev-2028) Set canBeConsumed = false on the deprecated configurations like compile (4 days ago) * 3e820ff3b16 - (tag: build-1.5.0-dev-2023) JVM: Take inline class mangling state into account for default methods (4 days ago) * f85263ca7f9 - (tag: build-1.5.0-dev-2018) [JS IR] Add fast path to JsCodeOutliningLowering (4 days ago) * cb3b1f8ae28 - [JS IR] Fix referencing Kotin variables in inline JS code (4 days ago) * 708e6914bd4 - (tag: build-1.5.0-dev-2012, tag: build-1.5.0-dev-2006) JVM JVM_IR hide sealed class constructors (4 days ago) * ca3bb02897c - (tag: build-1.5.0-dev-2004) [TD] Update spec testdata after f06a5321 (4 days ago) * f61a318c9d8 - [Test] Migrate AbstractBytecodeTextTest to new test infrastructure (4 days ago) * e928448e006 - [Test] Fix default jps `[JSP] Fast FIR tests` run configuration (4 days ago) * 663d5026d81 - [Test] Migrate FIR diagnostic spec tests to new infrastructure (4 days ago) * 0b45139b34e - [Test] Fix OutOfMemoryError during extracting meta info from test (4 days ago) * fd8795de996 - [Test] Fix FirIdenticalChecker and update some FIR_IDENTICAL testdata (4 days ago) * 98c22f9e592 - [TD] Add forgotten bytecode dump (4 days ago) * 5c0cfa87bad - [Test] Support some jvm codegen specific configuration directives (4 days ago) * 7d4adaba21f - [Test] Add ability to simply declaring mapping between directives and configuration keys (4 days ago) * 5490689fea4 - [Test] Add ability to disable specific handler if there was an error from previous one (4 days ago) * 42f9442728f - [Test] Handle any Throwable from test instead of AssertionError (4 days ago) * c111c339508 - (tag: build-1.5.0-dev-2001) Fix failing tests after 8bd78064be4f2bfb671e5e0c6c04b216ff55e16a (4 days ago) * 1654dfb3bf4 - (tag: build-1.5.0-dev-1999) Upgrade Apache Ant dependency to 1.10.7 (4 days ago) * aa1e23d9b01 - (tag: build-1.5.0-dev-1993) [JS IR] Use origins for bridge with and without stable names (4 days ago) * 57fdabdacee - [JS IR] Add BRIDGE origin as ignore for stabitility of names (4 days ago) * a89fe90043a - [JS IR] Add test on exportable overriden method (4 days ago) * f06a5321a62 - (tag: build-1.5.0-dev-1991, tag: build-1.5.0-M1-4, tag: build-1.5.0-M1-2, tag: build-1.5.0-M1-1) Approximate definitely not-null types for type parameter's types if they are already not-null (has not-null upper bounds) (4 days ago) * f2c1608c2bb - (tag: build-1.5.0-dev-1988) Update testData (4 days ago) * 9548caf6ea5 - (tag: build-1.5.0-dev-1982) FIR2IR: Use TEST ClassBuilderFactory in for tests (4 days ago) * 8c30adc3011 - FIR2IR: Unwrap intersection overrides for intersection types (4 days ago) * 3a3d2ee3e9d - FIR2IR: Fix mapping for intersection overrides of deserialized properties (4 days ago) * fdf0934adea - Don't generate txt dump for `buildFlexibleEnhancement.kt` diagnostic test (4 days ago) * 8bd78064be4 - Do substitution of a type enhancement, not only lower and upper bounds (4 days ago) * 83c93aca2e1 - Build type enhancement properly, by taking into account both bounds of the original flexible type (5 days ago) --- kotlin-native/gradle.properties | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/kotlin-native/gradle.properties b/kotlin-native/gradle.properties index 1016992cd84..f7ec45389f1 100644 --- a/kotlin-native/gradle.properties +++ b/kotlin-native/gradle.properties @@ -15,15 +15,15 @@ # # A version of the Kotlin compiler that is used to build Kotlin/Native. -buildKotlinVersion=1.4.20-dev-2167 -buildKotlinCompilerRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_KotlinPublic_Compiler),number:1.4.20-dev-2167,branch:default:any,pinned:true/artifacts/content/maven +buildKotlinVersion=1.5.0-dev-2205 +buildKotlinCompilerRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_KotlinPublic_Compiler),number:1.5.0-dev-2205,branch:default:any,pinned:true/artifacts/content/maven remoteRoot=konan_tests -kotlinCompilerRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_KotlinPublic_Compiler),number:1.5.0-dev-1963,branch:default:any,pinned:true/artifacts/content/maven -kotlinVersion=1.5.0-dev-1963 -kotlinStdlibRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_KotlinPublic_Compiler),number:1.5.0-dev-1963,branch:default:any,pinned:true/artifacts/content/maven -kotlinStdlibVersion=1.5.0-dev-1963 -kotlinStdlibTestsVersion=1.5.0-dev-1963 -testKotlinCompilerVersion=1.5.0-dev-1963 +kotlinCompilerRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_KotlinPublic_Compiler),number:1.5.20-dev-7,branch:default:any,pinned:true/artifacts/content/maven +kotlinVersion=1.5.20-dev-7 +kotlinStdlibRepo=https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(id:Kotlin_KotlinPublic_Compiler),number:1.5.20-dev-7,branch:default:any,pinned:true/artifacts/content/maven +kotlinStdlibVersion=1.5.20-dev-7 +kotlinStdlibTestsVersion=1.5.20-dev-7 +testKotlinCompilerVersion=1.5.20-dev-7 konanVersion=1.5.0 # A version of Xcode required to build the Kotlin/Native compiler. From 40959c756d04514e370921c80388ef1da7b4420a Mon Sep 17 00:00:00 2001 From: Vasily Levchenko Date: Fri, 29 Jan 2021 19:02:07 +0100 Subject: [PATCH 212/212] Revert "Temporary remove all -Werror flags" This reverts commit 89c09214eeed951684405c10c233304834a89beb. --- kotlin-native/Interop/Indexer/build.gradle | 4 ++-- kotlin-native/Interop/Runtime/build.gradle | 2 +- kotlin-native/Interop/StubGenerator/build.gradle | 2 +- kotlin-native/backend.native/build.gradle | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/kotlin-native/Interop/Indexer/build.gradle b/kotlin-native/Interop/Indexer/build.gradle index 97b112c3b9d..a9b94b00d74 100644 --- a/kotlin-native/Interop/Indexer/build.gradle +++ b/kotlin-native/Interop/Indexer/build.gradle @@ -143,8 +143,8 @@ kotlinNativeInterop { compileKotlin { kotlinOptions { -// allWarningsAsErrors=true - freeCompilerArgs = ["-Xskip-prerelease-check"] + allWarningsAsErrors=true + kotlinOptions.freeCompilerArgs = ["-Xskip-prerelease-check"] } } diff --git a/kotlin-native/Interop/Runtime/build.gradle b/kotlin-native/Interop/Runtime/build.gradle index 06a0a6663a6..c90aa241156 100644 --- a/kotlin-native/Interop/Runtime/build.gradle +++ b/kotlin-native/Interop/Runtime/build.gradle @@ -77,7 +77,7 @@ compileKotlin { kotlinOptions { freeCompilerArgs = ['-Xuse-experimental=kotlin.ExperimentalUnsignedTypes', '-Xuse-experimental=kotlin.Experimental', '-Xopt-in=kotlin.RequiresOptIn', "-XXLanguage:+InlineClasses", "-Xskip-prerelease-check"] -// allWarningsAsErrors=true + allWarningsAsErrors=true } } diff --git a/kotlin-native/Interop/StubGenerator/build.gradle b/kotlin-native/Interop/StubGenerator/build.gradle index 1dfc3680a27..d4b8b3e9d08 100644 --- a/kotlin-native/Interop/StubGenerator/build.gradle +++ b/kotlin-native/Interop/StubGenerator/build.gradle @@ -47,6 +47,6 @@ dependencies { compileKotlin { kotlinOptions { freeCompilerArgs = ['-Xopt-in=kotlin.ExperimentalUnsignedTypes', '-Xskip-metadata-version-check'] -// allWarningsAsErrors=true + allWarningsAsErrors=true } } diff --git a/kotlin-native/backend.native/build.gradle b/kotlin-native/backend.native/build.gradle index 9b4ef1a25dd..be75830d275 100644 --- a/kotlin-native/backend.native/build.gradle +++ b/kotlin-native/backend.native/build.gradle @@ -56,7 +56,7 @@ compileCompilerKotlin { // but not for Kotlin. dependsOn('generateCompilerProto') kotlinOptions.jvmTarget = "1.8" -// kotlinOptions.allWarningsAsErrors=true + kotlinOptions.allWarningsAsErrors=true kotlinOptions.freeCompilerArgs += ['-Xopt-in=kotlin.RequiresOptIn', '-Xopt-in=org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI', '-Xskip-prerelease-check'] } @@ -323,4 +323,4 @@ publishing { from components.java } } -} +} \ No newline at end of file