diff --git a/.github/workflows/generate-alpha-tag.yaml b/.github/workflows/generate-alpha-tag.yaml index a2f978aff..91f1a80d4 100644 --- a/.github/workflows/generate-alpha-tag.yaml +++ b/.github/workflows/generate-alpha-tag.yaml @@ -14,12 +14,12 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Java - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'temurin' java-version: '17' @@ -38,13 +38,13 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 token: ${{ secrets.TOKEN_GITHUB_ACTION }} - name: Set up Java - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'temurin' java-version: '17' @@ -56,4 +56,4 @@ jobs: run: git push --follow-tags - name: Stop Gradle daemons - run: ./gradlew --stop \ No newline at end of file + run: ./gradlew --stop diff --git a/.github/workflows/generate-tag.yaml b/.github/workflows/generate-tag.yaml index af2d04153..c659be8d7 100644 --- a/.github/workflows/generate-tag.yaml +++ b/.github/workflows/generate-tag.yaml @@ -35,12 +35,12 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Java - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'temurin' java-version: '17' @@ -59,13 +59,13 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 token: ${{ secrets.TOKEN_GITHUB_ACTION }} - name: Set up Java - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'temurin' java-version: '17' @@ -77,4 +77,4 @@ jobs: run: git push --follow-tags - name: Stop Gradle daemons - run: ./gradlew --stop \ No newline at end of file + run: ./gradlew --stop diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a74996caa..329d3ac50 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -32,11 +32,11 @@ jobs: analysis-version: ${{ steps.get-analysis-version.outputs.analysis-version }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: actions/setup-java@v3 + - uses: actions/setup-java@v4 with: distribution: 'temurin' java-version: '17' @@ -53,9 +53,9 @@ jobs: echo "::set-output name=analysis-version::$(head -n 1 build/semver/version.txt)" - name: Upload reports - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: 'reports-${{ matrix.os }}' + name: 'reports-${{ matrix.os }}-${{ strategy.job-index }}' path: '**/build/reports/**' - name: Stop Gradle daemons @@ -77,9 +77,9 @@ jobs: runs-on: macos-11 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: actions/setup-java@v3 + - uses: actions/setup-java@v4 with: distribution: 'temurin' java-version: '17' @@ -107,9 +107,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - uses: actions/setup-java@v3 + - uses: actions/setup-java@v4 with: distribution: 'temurin' java-version: '17' diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 4a564453c..74f1838b0 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -17,11 +17,11 @@ jobs: jvm_target: [ '1.8', '11', '17' ] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: actions/setup-java@v3 + - uses: actions/setup-java@v4 with: distribution: 'temurin' java-version: '17' @@ -32,9 +32,9 @@ jobs: arguments: -PjvmTargetVersion=${{ matrix.jvm_target }} build --scan --stacktrace -x apiCheck - name: Upload reports - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: 'reports-${{ matrix.os }}' + name: 'reports-${{ matrix.os }}-${{ strategy.job-index }}' path: '**/build/reports/**' update_api: @@ -42,7 +42,7 @@ jobs: timeout-minutes: 20 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 @@ -64,7 +64,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: "Create API Doc and validate, step 1" run: ./gradlew buildMetaDoc diff --git a/gradle.properties b/gradle.properties index 7ff33e951..8d06dadbe 100644 --- a/gradle.properties +++ b/gradle.properties @@ -24,3 +24,5 @@ kotlin.mpp.stability.nowarn=true # Kotlin Test configuration #Parallelism needs to be set to 1 since the concurrent tests in arrow-effects become flaky otherwise kotlintest.parallelism=1 + +org.jetbrains.dokka.experimental.gradle.pluginMode=V2EnabledWithHelpers diff --git a/gradle/projects.libs.versions.toml b/gradle/projects.libs.versions.toml index 6d1d29f9b..20695e33e 100644 --- a/gradle/projects.libs.versions.toml +++ b/gradle/projects.libs.versions.toml @@ -1,18 +1,18 @@ [versions] -arrow = "1.2.0-RC" -arrowGradleConfig = "0.12.0-rc.3" +arrow = "2.0.1" +arrowGradleConfig = "0.12.0-rc.26" assertj = "3.24.2" classgraph = "4.8.157" -dokka = "1.8.10" +dokka = "2.0.0" intellijOpenApi = "7.0.3" javaAssist = "3.29.2-GA" junit = "5.9.2" -kotlin = "1.9.21" -kotlinCompileTesting = "0.4.0" +kotlin = "2.1.10" +kotlinCompileTesting = "0.7.0" javaCompileTesting = "0.21.0" -kotlinBinaryCompatibilityValidator = "0.13.0" +kotlinBinaryCompatibilityValidator = "0.17.0" detekt = "1.22.0" -ksp = "1.9.21-1.0.15" +ksp = "2.1.0-1.0.29" [libraries] arrowCore = { module = "io.arrow-kt:arrow-core", version.ref = "arrow" } diff --git a/libs/arrow-meta/api/arrow-meta.api b/libs/arrow-meta/api/arrow-meta.api index c18813c5c..3dc07c4a1 100644 --- a/libs/arrow-meta/api/arrow-meta.api +++ b/libs/arrow-meta/api/arrow-meta.api @@ -700,80 +700,60 @@ public abstract interface class arrow/meta/phases/codegen/ir/IRGeneration : arro public abstract fun generate (Larrow/meta/phases/CompilerContext;Lorg/jetbrains/kotlin/ir/declarations/IrModuleFragment;Lorg/jetbrains/kotlin/backend/common/extensions/IrPluginContext;)V } -public final class arrow/meta/phases/codegen/ir/IrUtils : org/jetbrains/kotlin/ir/declarations/IrFactory, org/jetbrains/kotlin/ir/types/IrTypeSystemContext, org/jetbrains/kotlin/ir/util/ReferenceSymbolTable { +public final class arrow/meta/phases/codegen/ir/IrUtils : org/jetbrains/kotlin/ir/types/IrTypeSystemContext, org/jetbrains/kotlin/ir/util/ReferenceSymbolTable { public fun (Lorg/jetbrains/kotlin/backend/common/extensions/IrPluginContext;Larrow/meta/phases/CompilerContext;Lorg/jetbrains/kotlin/ir/declarations/IrModuleFragment;)V public fun anySuperTypeConstructor (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;Lkotlin/jvm/functions/Function1;)Z public fun anyType ()Lorg/jetbrains/kotlin/ir/types/IrSimpleType; public synthetic fun anyType ()Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker; public fun areEqualTypeConstructors (Lorg/jetbrains/kotlin/types/model/TypeConstructorMarker;Lorg/jetbrains/kotlin/types/model/TypeConstructorMarker;)Z public fun argumentsCount (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)I - public fun arrayType (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker; - public fun asArgumentList (Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker;)Lorg/jetbrains/kotlin/ir/types/IrSimpleType; - public synthetic fun asArgumentList (Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker;)Lorg/jetbrains/kotlin/types/model/TypeArgumentListMarker; + public fun arrayType (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Lorg/jetbrains/kotlin/ir/types/IrSimpleType; + public synthetic fun arrayType (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker; + public fun asArgumentList (Lorg/jetbrains/kotlin/types/model/RigidTypeMarker;)Lorg/jetbrains/kotlin/ir/types/IrSimpleType; + public synthetic fun asArgumentList (Lorg/jetbrains/kotlin/types/model/RigidTypeMarker;)Lorg/jetbrains/kotlin/types/model/TypeArgumentListMarker; + public fun asCapturedType (Lorg/jetbrains/kotlin/types/model/CapturedTypeMarker;)Lorg/jetbrains/kotlin/types/model/CapturedTypeMarker; public fun asCapturedType (Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker;)Lorg/jetbrains/kotlin/types/model/CapturedTypeMarker; - public fun asDefinitelyNotNullType (Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker;)Lorg/jetbrains/kotlin/types/model/DefinitelyNotNullTypeMarker; + public fun asCapturedTypeUnwrappingDnn (Lorg/jetbrains/kotlin/types/model/CapturedTypeMarker;)Lorg/jetbrains/kotlin/types/model/CapturedTypeMarker; + public fun asCapturedTypeUnwrappingDnn (Lorg/jetbrains/kotlin/types/model/RigidTypeMarker;)Lorg/jetbrains/kotlin/types/model/CapturedTypeMarker; + public fun asDefinitelyNotNullType (Lorg/jetbrains/kotlin/types/model/DefinitelyNotNullTypeMarker;)Lorg/jetbrains/kotlin/types/model/DefinitelyNotNullTypeMarker; + public fun asDefinitelyNotNullType (Lorg/jetbrains/kotlin/types/model/RigidTypeMarker;)Lorg/jetbrains/kotlin/types/model/DefinitelyNotNullTypeMarker; + public fun asDynamicType (Lorg/jetbrains/kotlin/types/model/DynamicTypeMarker;)Lorg/jetbrains/kotlin/types/model/DynamicTypeMarker; public fun asDynamicType (Lorg/jetbrains/kotlin/types/model/FlexibleTypeMarker;)Lorg/jetbrains/kotlin/ir/types/IrDynamicType; public synthetic fun asDynamicType (Lorg/jetbrains/kotlin/types/model/FlexibleTypeMarker;)Lorg/jetbrains/kotlin/types/model/DynamicTypeMarker; + public fun asFlexibleType (Lorg/jetbrains/kotlin/types/model/FlexibleTypeMarker;)Lorg/jetbrains/kotlin/types/model/FlexibleTypeMarker; public fun asFlexibleType (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Lorg/jetbrains/kotlin/types/model/FlexibleTypeMarker; - public fun asSimpleType (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker; + public synthetic fun asRigidType (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Lorg/jetbrains/kotlin/types/model/RigidTypeMarker; + public fun asRigidType (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker; + public fun asRigidType (Lorg/jetbrains/kotlin/types/model/RigidTypeMarker;)Lorg/jetbrains/kotlin/types/model/RigidTypeMarker; public fun asTypeArgument (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Lorg/jetbrains/kotlin/ir/types/IrTypeArgument; public synthetic fun asTypeArgument (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Lorg/jetbrains/kotlin/types/model/TypeArgumentMarker; public fun canHaveUndefinedNullability (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Z - public fun captureFromArguments (Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker;Lorg/jetbrains/kotlin/types/model/CaptureStatus;)Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker; + public fun captureFromArguments (Lorg/jetbrains/kotlin/types/model/RigidTypeMarker;Lorg/jetbrains/kotlin/types/model/CaptureStatus;)Lorg/jetbrains/kotlin/ir/types/IrSimpleType; + public synthetic fun captureFromArguments (Lorg/jetbrains/kotlin/types/model/RigidTypeMarker;Lorg/jetbrains/kotlin/types/model/CaptureStatus;)Lorg/jetbrains/kotlin/types/model/RigidTypeMarker; public fun captureFromExpression (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker; public fun captureStatus (Lorg/jetbrains/kotlin/types/model/CapturedTypeMarker;)Lorg/jetbrains/kotlin/types/model/CaptureStatus; - public fun createAnonymousInitializer (IILorg/jetbrains/kotlin/ir/declarations/IrDeclarationOrigin;Lorg/jetbrains/kotlin/ir/symbols/IrAnonymousInitializerSymbol;Z)Lorg/jetbrains/kotlin/ir/declarations/IrAnonymousInitializer; - public fun createBlockBody (II)Lorg/jetbrains/kotlin/ir/expressions/IrBlockBody; - public synthetic fun createBlockBody (IILjava/util/List;)Lorg/jetbrains/kotlin/ir/expressions/IrBlockBody; - public synthetic fun createBlockBody (IILkotlin/jvm/functions/Function1;)Lorg/jetbrains/kotlin/ir/expressions/IrBlockBody; - public synthetic fun createClass (IILorg/jetbrains/kotlin/ir/declarations/IrDeclarationOrigin;Lorg/jetbrains/kotlin/ir/symbols/IrClassSymbol;Lorg/jetbrains/kotlin/name/Name;Lorg/jetbrains/kotlin/descriptors/ClassKind;Lorg/jetbrains/kotlin/descriptors/DescriptorVisibility;Lorg/jetbrains/kotlin/descriptors/Modality;ZZZZZZZLorg/jetbrains/kotlin/descriptors/SourceElement;)Lorg/jetbrains/kotlin/ir/declarations/IrClass; - public fun createClass (IILorg/jetbrains/kotlin/ir/declarations/IrDeclarationOrigin;Lorg/jetbrains/kotlin/name/Name;Lorg/jetbrains/kotlin/descriptors/DescriptorVisibility;Lorg/jetbrains/kotlin/ir/symbols/IrClassSymbol;Lorg/jetbrains/kotlin/descriptors/ClassKind;Lorg/jetbrains/kotlin/descriptors/Modality;ZZZZZZZLorg/jetbrains/kotlin/descriptors/SourceElement;)Lorg/jetbrains/kotlin/ir/declarations/IrClass; - public synthetic fun createConstructor (IILorg/jetbrains/kotlin/ir/declarations/IrDeclarationOrigin;Lorg/jetbrains/kotlin/ir/symbols/IrConstructorSymbol;Lorg/jetbrains/kotlin/name/Name;Lorg/jetbrains/kotlin/descriptors/DescriptorVisibility;Lorg/jetbrains/kotlin/ir/types/IrType;ZZZZLorg/jetbrains/kotlin/serialization/deserialization/descriptors/DeserializedContainerSource;)Lorg/jetbrains/kotlin/ir/declarations/IrConstructor; - public fun createConstructor (IILorg/jetbrains/kotlin/ir/declarations/IrDeclarationOrigin;Lorg/jetbrains/kotlin/name/Name;Lorg/jetbrains/kotlin/descriptors/DescriptorVisibility;ZZLorg/jetbrains/kotlin/ir/types/IrType;Lorg/jetbrains/kotlin/ir/symbols/IrConstructorSymbol;ZZLorg/jetbrains/kotlin/serialization/deserialization/descriptors/DeserializedContainerSource;)Lorg/jetbrains/kotlin/ir/declarations/IrConstructor; public fun createEmptySubstitutor ()Lorg/jetbrains/kotlin/types/model/TypeSubstitutorMarker; - public synthetic fun createEnumEntry (IILorg/jetbrains/kotlin/ir/declarations/IrDeclarationOrigin;Lorg/jetbrains/kotlin/ir/symbols/IrEnumEntrySymbol;Lorg/jetbrains/kotlin/name/Name;)Lorg/jetbrains/kotlin/ir/declarations/IrEnumEntry; - public fun createEnumEntry (IILorg/jetbrains/kotlin/ir/declarations/IrDeclarationOrigin;Lorg/jetbrains/kotlin/name/Name;Lorg/jetbrains/kotlin/ir/symbols/IrEnumEntrySymbol;)Lorg/jetbrains/kotlin/ir/declarations/IrEnumEntry; - public fun createErrorDeclaration (IILorg/jetbrains/kotlin/descriptors/DeclarationDescriptor;)Lorg/jetbrains/kotlin/ir/declarations/IrErrorDeclaration; - public fun createErrorType (Ljava/lang/String;)Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker; - public fun createExpressionBody (IILorg/jetbrains/kotlin/ir/expressions/IrExpression;)Lorg/jetbrains/kotlin/ir/expressions/IrExpressionBody; - public synthetic fun createExpressionBody (Lorg/jetbrains/kotlin/ir/expressions/IrExpression;)Lorg/jetbrains/kotlin/ir/expressions/IrExpressionBody; - public synthetic fun createField (IILorg/jetbrains/kotlin/ir/declarations/IrDeclarationOrigin;Lorg/jetbrains/kotlin/ir/symbols/IrFieldSymbol;Lorg/jetbrains/kotlin/name/Name;Lorg/jetbrains/kotlin/ir/types/IrType;Lorg/jetbrains/kotlin/descriptors/DescriptorVisibility;ZZZ)Lorg/jetbrains/kotlin/ir/declarations/IrField; - public fun createField (IILorg/jetbrains/kotlin/ir/declarations/IrDeclarationOrigin;Lorg/jetbrains/kotlin/name/Name;Lorg/jetbrains/kotlin/descriptors/DescriptorVisibility;Lorg/jetbrains/kotlin/ir/symbols/IrFieldSymbol;Lorg/jetbrains/kotlin/ir/types/IrType;ZZZ)Lorg/jetbrains/kotlin/ir/declarations/IrField; - public fun createFlexibleType (Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker;Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker;)Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker; - public synthetic fun createFunction (IILorg/jetbrains/kotlin/ir/declarations/IrDeclarationOrigin;Lorg/jetbrains/kotlin/ir/symbols/IrSimpleFunctionSymbol;Lorg/jetbrains/kotlin/name/Name;Lorg/jetbrains/kotlin/descriptors/DescriptorVisibility;Lorg/jetbrains/kotlin/descriptors/Modality;Lorg/jetbrains/kotlin/ir/types/IrType;ZZZZZZZZLorg/jetbrains/kotlin/serialization/deserialization/descriptors/DeserializedContainerSource;)Lorg/jetbrains/kotlin/ir/declarations/IrSimpleFunction; - public synthetic fun createFunctionWithLateBinding (IILorg/jetbrains/kotlin/ir/declarations/IrDeclarationOrigin;Lorg/jetbrains/kotlin/name/Name;Lorg/jetbrains/kotlin/descriptors/DescriptorVisibility;Lorg/jetbrains/kotlin/descriptors/Modality;Lorg/jetbrains/kotlin/ir/types/IrType;ZZZZZZZ)Lorg/jetbrains/kotlin/ir/declarations/IrSimpleFunction; - public fun createFunctionWithLateBinding (IILorg/jetbrains/kotlin/ir/declarations/IrDeclarationOrigin;Lorg/jetbrains/kotlin/name/Name;Lorg/jetbrains/kotlin/descriptors/DescriptorVisibility;ZZLorg/jetbrains/kotlin/ir/types/IrType;Lorg/jetbrains/kotlin/descriptors/Modality;ZZZZZZ)Lorg/jetbrains/kotlin/ir/declarations/IrFunctionWithLateBinding; - public synthetic fun createLocalDelegatedProperty (IILorg/jetbrains/kotlin/ir/declarations/IrDeclarationOrigin;Lorg/jetbrains/kotlin/ir/symbols/IrLocalDelegatedPropertySymbol;Lorg/jetbrains/kotlin/name/Name;Lorg/jetbrains/kotlin/ir/types/IrType;Z)Lorg/jetbrains/kotlin/ir/declarations/IrLocalDelegatedProperty; - public fun createLocalDelegatedProperty (IILorg/jetbrains/kotlin/ir/declarations/IrDeclarationOrigin;Lorg/jetbrains/kotlin/name/Name;Lorg/jetbrains/kotlin/ir/symbols/IrLocalDelegatedPropertySymbol;Lorg/jetbrains/kotlin/ir/types/IrType;Z)Lorg/jetbrains/kotlin/ir/declarations/IrLocalDelegatedProperty; - public synthetic fun createProperty (IILorg/jetbrains/kotlin/ir/declarations/IrDeclarationOrigin;Lorg/jetbrains/kotlin/ir/symbols/IrPropertySymbol;Lorg/jetbrains/kotlin/name/Name;Lorg/jetbrains/kotlin/descriptors/DescriptorVisibility;Lorg/jetbrains/kotlin/descriptors/Modality;ZZZZZZZLorg/jetbrains/kotlin/serialization/deserialization/descriptors/DeserializedContainerSource;)Lorg/jetbrains/kotlin/ir/declarations/IrProperty; - public fun createProperty (IILorg/jetbrains/kotlin/ir/declarations/IrDeclarationOrigin;Lorg/jetbrains/kotlin/name/Name;Lorg/jetbrains/kotlin/descriptors/DescriptorVisibility;Lorg/jetbrains/kotlin/descriptors/Modality;Lorg/jetbrains/kotlin/ir/symbols/IrPropertySymbol;ZZZZZLorg/jetbrains/kotlin/serialization/deserialization/descriptors/DeserializedContainerSource;ZZ)Lorg/jetbrains/kotlin/ir/declarations/IrProperty; - public synthetic fun createPropertyWithLateBinding (IILorg/jetbrains/kotlin/ir/declarations/IrDeclarationOrigin;Lorg/jetbrains/kotlin/name/Name;Lorg/jetbrains/kotlin/descriptors/DescriptorVisibility;Lorg/jetbrains/kotlin/descriptors/Modality;ZZZZZZ)Lorg/jetbrains/kotlin/ir/declarations/IrProperty; - public fun createPropertyWithLateBinding (IILorg/jetbrains/kotlin/ir/declarations/IrDeclarationOrigin;Lorg/jetbrains/kotlin/name/Name;Lorg/jetbrains/kotlin/descriptors/DescriptorVisibility;Lorg/jetbrains/kotlin/descriptors/Modality;ZZZZZZZ)Lorg/jetbrains/kotlin/ir/declarations/IrPropertyWithLateBinding; - public fun createSimpleFunction (IILorg/jetbrains/kotlin/ir/declarations/IrDeclarationOrigin;Lorg/jetbrains/kotlin/name/Name;Lorg/jetbrains/kotlin/descriptors/DescriptorVisibility;ZZLorg/jetbrains/kotlin/ir/types/IrType;Lorg/jetbrains/kotlin/descriptors/Modality;Lorg/jetbrains/kotlin/ir/symbols/IrSimpleFunctionSymbol;ZZZZZLorg/jetbrains/kotlin/serialization/deserialization/descriptors/DeserializedContainerSource;Z)Lorg/jetbrains/kotlin/ir/declarations/IrSimpleFunction; - public fun createSimpleType (Lorg/jetbrains/kotlin/types/model/TypeConstructorMarker;Ljava/util/List;ZZLjava/util/List;)Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker; + public fun createErrorType (Ljava/lang/String;Lorg/jetbrains/kotlin/types/model/RigidTypeMarker;)Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker; + public fun createFlexibleType (Lorg/jetbrains/kotlin/types/model/RigidTypeMarker;Lorg/jetbrains/kotlin/types/model/RigidTypeMarker;)Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker; + public fun createSimpleType (Lorg/jetbrains/kotlin/types/model/TypeConstructorMarker;Ljava/util/List;ZZLjava/util/List;)Lorg/jetbrains/kotlin/ir/types/IrSimpleType; + public synthetic fun createSimpleType (Lorg/jetbrains/kotlin/types/model/TypeConstructorMarker;Ljava/util/List;ZZLjava/util/List;)Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker; public fun createStarProjection (Lorg/jetbrains/kotlin/types/model/TypeParameterMarker;)Lorg/jetbrains/kotlin/ir/types/impl/IrStarProjectionImpl; public synthetic fun createStarProjection (Lorg/jetbrains/kotlin/types/model/TypeParameterMarker;)Lorg/jetbrains/kotlin/types/model/TypeArgumentMarker; - public fun createTypeAlias (IILorg/jetbrains/kotlin/ir/declarations/IrDeclarationOrigin;Lorg/jetbrains/kotlin/name/Name;Lorg/jetbrains/kotlin/descriptors/DescriptorVisibility;Lorg/jetbrains/kotlin/ir/symbols/IrTypeAliasSymbol;ZLorg/jetbrains/kotlin/ir/types/IrType;)Lorg/jetbrains/kotlin/ir/declarations/IrTypeAlias; - public synthetic fun createTypeAlias (IILorg/jetbrains/kotlin/ir/symbols/IrTypeAliasSymbol;Lorg/jetbrains/kotlin/name/Name;Lorg/jetbrains/kotlin/descriptors/DescriptorVisibility;Lorg/jetbrains/kotlin/ir/types/IrType;ZLorg/jetbrains/kotlin/ir/declarations/IrDeclarationOrigin;)Lorg/jetbrains/kotlin/ir/declarations/IrTypeAlias; public fun createTypeArgument (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;Lorg/jetbrains/kotlin/types/model/TypeVariance;)Lorg/jetbrains/kotlin/types/model/TypeArgumentMarker; - public synthetic fun createTypeParameter (IILorg/jetbrains/kotlin/ir/declarations/IrDeclarationOrigin;Lorg/jetbrains/kotlin/ir/symbols/IrTypeParameterSymbol;Lorg/jetbrains/kotlin/name/Name;IZLorg/jetbrains/kotlin/types/Variance;)Lorg/jetbrains/kotlin/ir/declarations/IrTypeParameter; - public fun createTypeParameter (IILorg/jetbrains/kotlin/ir/declarations/IrDeclarationOrigin;Lorg/jetbrains/kotlin/name/Name;Lorg/jetbrains/kotlin/ir/symbols/IrTypeParameterSymbol;Lorg/jetbrains/kotlin/types/Variance;IZ)Lorg/jetbrains/kotlin/ir/declarations/IrTypeParameter; public fun createUninferredType (Lorg/jetbrains/kotlin/types/model/TypeConstructorMarker;)Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker; - public synthetic fun createValueParameter (IILorg/jetbrains/kotlin/ir/declarations/IrDeclarationOrigin;Lorg/jetbrains/kotlin/ir/symbols/IrValueParameterSymbol;Lorg/jetbrains/kotlin/name/Name;ILorg/jetbrains/kotlin/ir/types/IrType;Lorg/jetbrains/kotlin/ir/types/IrType;ZZZZ)Lorg/jetbrains/kotlin/ir/declarations/IrValueParameter; - public fun createValueParameter (IILorg/jetbrains/kotlin/ir/declarations/IrDeclarationOrigin;Lorg/jetbrains/kotlin/name/Name;Lorg/jetbrains/kotlin/ir/types/IrType;ZLorg/jetbrains/kotlin/ir/symbols/IrValueParameterSymbol;ILorg/jetbrains/kotlin/ir/types/IrType;ZZZ)Lorg/jetbrains/kotlin/ir/declarations/IrValueParameter; public fun enterScope (Lorg/jetbrains/kotlin/ir/declarations/IrDeclaration;)V public fun enterScope (Lorg/jetbrains/kotlin/ir/symbols/IrSymbol;)V - public fun fastCorrespondingSupertypes (Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker;Lorg/jetbrains/kotlin/types/model/TypeConstructorMarker;)Ljava/util/List; - public fun findCommonIntegerLiteralTypesSuperType (Ljava/util/List;)Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker; + public fun fastCorrespondingSupertypes (Lorg/jetbrains/kotlin/types/model/RigidTypeMarker;Lorg/jetbrains/kotlin/types/model/TypeConstructorMarker;)Ljava/util/List; + public fun findCommonIntegerLiteralTypesSuperType (Ljava/util/List;)Lorg/jetbrains/kotlin/ir/types/IrSimpleType; + public synthetic fun findCommonIntegerLiteralTypesSuperType (Ljava/util/List;)Lorg/jetbrains/kotlin/types/model/RigidTypeMarker; public fun get (Lorg/jetbrains/kotlin/types/model/TypeArgumentListMarker;I)Lorg/jetbrains/kotlin/types/model/TypeArgumentMarker; public fun getAnnotationFirstArgumentValue (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;Lorg/jetbrains/kotlin/name/FqName;)Ljava/lang/Object; public fun getArgument (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;I)Lorg/jetbrains/kotlin/types/model/TypeArgumentMarker; - public fun getArgumentOrNull (Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker;I)Lorg/jetbrains/kotlin/types/model/TypeArgumentMarker; + public fun getArgumentOrNull (Lorg/jetbrains/kotlin/types/model/RigidTypeMarker;I)Lorg/jetbrains/kotlin/types/model/TypeArgumentMarker; public fun getArguments (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Ljava/util/List; public fun getAttributes (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Ljava/util/List; public fun getClassFqNameUnsafe (Lorg/jetbrains/kotlin/types/model/TypeConstructorMarker;)Lorg/jetbrains/kotlin/name/FqNameUnsafe; public final fun getCompilerContext ()Larrow/meta/phases/CompilerContext; - public fun getCustomAttributes (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Ljava/util/List; public fun getDescriptorExtension ()Lorg/jetbrains/kotlin/ir/util/ReferenceSymbolTableExtension; public fun getIrBuiltIns ()Lorg/jetbrains/kotlin/ir/IrBuiltIns; public final fun getModuleFragment ()Lorg/jetbrains/kotlin/ir/declarations/IrModuleFragment; @@ -785,10 +765,8 @@ public final class arrow/meta/phases/codegen/ir/IrUtils : org/jetbrains/kotlin/i public fun getPrimitiveArrayType (Lorg/jetbrains/kotlin/types/model/TypeConstructorMarker;)Lorg/jetbrains/kotlin/builtins/PrimitiveType; public fun getPrimitiveType (Lorg/jetbrains/kotlin/types/model/TypeConstructorMarker;)Lorg/jetbrains/kotlin/builtins/PrimitiveType; public fun getRepresentativeUpperBound (Lorg/jetbrains/kotlin/types/model/TypeParameterMarker;)Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker; - public fun getStageController ()Lorg/jetbrains/kotlin/ir/declarations/StageController; public fun getSubstitutedUnderlyingType (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker; - public fun getType (Lorg/jetbrains/kotlin/types/model/TypeArgumentMarker;)Lorg/jetbrains/kotlin/ir/types/IrType; - public synthetic fun getType (Lorg/jetbrains/kotlin/types/model/TypeArgumentMarker;)Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker; + public fun getType (Lorg/jetbrains/kotlin/types/model/TypeArgumentMarker;)Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker; public fun getTypeConstructor (Lorg/jetbrains/kotlin/types/model/TypeParameterMarker;)Lorg/jetbrains/kotlin/ir/symbols/IrTypeParameterSymbol; public synthetic fun getTypeConstructor (Lorg/jetbrains/kotlin/types/model/TypeParameterMarker;)Lorg/jetbrains/kotlin/types/model/TypeConstructorMarker; public fun getTypeParameter (Lorg/jetbrains/kotlin/types/model/TypeVariableTypeConstructorMarker;)Lorg/jetbrains/kotlin/types/model/TypeParameterMarker; @@ -801,45 +779,45 @@ public final class arrow/meta/phases/codegen/ir/IrUtils : org/jetbrains/kotlin/i public fun getVariance (Lorg/jetbrains/kotlin/types/model/TypeArgumentMarker;)Lorg/jetbrains/kotlin/types/model/TypeVariance; public fun getVariance (Lorg/jetbrains/kotlin/types/model/TypeParameterMarker;)Lorg/jetbrains/kotlin/types/model/TypeVariance; public fun hasAnnotation (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;Lorg/jetbrains/kotlin/name/FqName;)Z - public fun hasCustomAttributes (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Z public fun hasFlexibleNullability (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Z public fun hasRecursiveBounds (Lorg/jetbrains/kotlin/types/model/TypeParameterMarker;Lorg/jetbrains/kotlin/types/model/TypeConstructorMarker;)Z - public fun identicalArguments (Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker;Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker;)Z - public fun intersectTypes (Ljava/util/List;)Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker; - public fun intersectTypes (Ljava/util/List;)Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker; + public fun identicalArguments (Lorg/jetbrains/kotlin/types/model/RigidTypeMarker;Lorg/jetbrains/kotlin/types/model/RigidTypeMarker;)Z + public fun intersectTypes (Ljava/util/Collection;)Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker; + public fun intersectTypes (Ljava/util/Collection;)Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker; public final fun irCall (Lorg/jetbrains/kotlin/descriptors/CallableDescriptor;)Lorg/jetbrains/kotlin/ir/expressions/IrExpression; public final fun irConstructorCall (Lorg/jetbrains/kotlin/descriptors/ClassDescriptor;)Lorg/jetbrains/kotlin/ir/expressions/IrConstructorCall; public final fun irGetterCall (Lorg/jetbrains/kotlin/descriptors/PropertyDescriptor;)Lorg/jetbrains/kotlin/ir/expressions/IrCall; public fun isAnonymous (Lorg/jetbrains/kotlin/types/model/TypeConstructorMarker;)Z public fun isAnyConstructor (Lorg/jetbrains/kotlin/types/model/TypeConstructorMarker;)Z + public fun isArrayConstructor (Lorg/jetbrains/kotlin/types/model/TypeConstructorMarker;)Z public fun isArrayOrNullableArray (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Z public fun isCapturedDynamic (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Z public fun isCapturedType (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Z - public fun isClassType (Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker;)Z + public fun isClassType (Lorg/jetbrains/kotlin/types/model/RigidTypeMarker;)Z public fun isClassTypeConstructor (Lorg/jetbrains/kotlin/types/model/TypeConstructorMarker;)Z public fun isCommonFinalClassConstructor (Lorg/jetbrains/kotlin/types/model/TypeConstructorMarker;)Z - public fun isDefinitelyClassTypeConstructor (Lorg/jetbrains/kotlin/types/model/TypeConstructorMarker;)Z public fun isDefinitelyNotNullType (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Z + public fun isDefinitelyNotNullType (Lorg/jetbrains/kotlin/types/model/RigidTypeMarker;)Z public fun isDenotable (Lorg/jetbrains/kotlin/types/model/TypeConstructorMarker;)Z public fun isDynamic (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Z public fun isError (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Z public fun isError (Lorg/jetbrains/kotlin/types/model/TypeConstructorMarker;)Z - public fun isExtensionFunction (Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker;)Z + public fun isExtensionFunction (Lorg/jetbrains/kotlin/types/model/RigidTypeMarker;)Z public fun isFinalClassOrEnumEntryOrAnnotationClassConstructor (Lorg/jetbrains/kotlin/types/model/TypeConstructorMarker;)Z public fun isFlexible (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Z public fun isFlexibleNothing (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Z + public fun isFlexibleWithDifferentTypeConstructors (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Z public fun isInlineClass (Lorg/jetbrains/kotlin/types/model/TypeConstructorMarker;)Z public fun isInnerClass (Lorg/jetbrains/kotlin/types/model/TypeConstructorMarker;)Z public fun isIntegerConstantOperatorTypeConstructor (Lorg/jetbrains/kotlin/types/model/TypeConstructorMarker;)Z public fun isIntegerLiteralConstantTypeConstructor (Lorg/jetbrains/kotlin/types/model/TypeConstructorMarker;)Z - public fun isIntegerLiteralType (Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker;)Z + public fun isIntegerLiteralType (Lorg/jetbrains/kotlin/types/model/RigidTypeMarker;)Z public fun isIntegerLiteralTypeConstructor (Lorg/jetbrains/kotlin/types/model/TypeConstructorMarker;)Z public fun isInterface (Lorg/jetbrains/kotlin/types/model/TypeConstructorMarker;)Z public fun isInterfaceOrAnnotationClass (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Z public fun isIntersection (Lorg/jetbrains/kotlin/types/model/TypeConstructorMarker;)Z public fun isLocalType (Lorg/jetbrains/kotlin/types/model/TypeConstructorMarker;)Z public fun isMarkedNullable (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Z - public fun isMarkedNullable (Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker;)Z public fun isMultiFieldValueClass (Lorg/jetbrains/kotlin/types/model/TypeConstructorMarker;)Z public fun isNotNullTypeParameter (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Z public fun isNothing (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Z @@ -848,16 +826,17 @@ public final class arrow/meta/phases/codegen/ir/IrUtils : org/jetbrains/kotlin/i public fun isNullableNothing (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Z public fun isNullableType (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Z public fun isOldCapturedType (Lorg/jetbrains/kotlin/types/model/CapturedTypeMarker;)Z + public fun isPrimitiveType (Lorg/jetbrains/kotlin/types/model/RigidTypeMarker;)Z public fun isPrimitiveType (Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker;)Z public fun isProjectionNotNull (Lorg/jetbrains/kotlin/types/model/CapturedTypeMarker;)Z public fun isRawType (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Z public fun isReified (Lorg/jetbrains/kotlin/types/model/TypeParameterMarker;)Z - public fun isSimpleType (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Z - public fun isSingleClassifierType (Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker;)Z + public fun isRigidType (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Z + public fun isSingleClassifierType (Lorg/jetbrains/kotlin/types/model/RigidTypeMarker;)Z public fun isStarProjection (Lorg/jetbrains/kotlin/types/model/TypeArgumentMarker;)Z - public fun isStubType (Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker;)Z - public fun isStubTypeForBuilderInference (Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker;)Z - public fun isStubTypeForVariableInSubtyping (Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker;)Z + public fun isStubType (Lorg/jetbrains/kotlin/types/model/RigidTypeMarker;)Z + public fun isStubTypeForBuilderInference (Lorg/jetbrains/kotlin/types/model/RigidTypeMarker;)Z + public fun isStubTypeForVariableInSubtyping (Lorg/jetbrains/kotlin/types/model/RigidTypeMarker;)Z public fun isTypeParameterTypeConstructor (Lorg/jetbrains/kotlin/types/model/TypeConstructorMarker;)Z public fun isTypeVariableType (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Z public fun isUnderKotlinPackage (Lorg/jetbrains/kotlin/types/model/TypeConstructorMarker;)Z @@ -865,12 +844,17 @@ public final class arrow/meta/phases/codegen/ir/IrUtils : org/jetbrains/kotlin/i public fun iterator (Lorg/jetbrains/kotlin/types/model/TypeArgumentListMarker;)Ljava/util/Iterator; public fun leaveScope (Lorg/jetbrains/kotlin/ir/declarations/IrDeclaration;)V public fun leaveScope (Lorg/jetbrains/kotlin/ir/symbols/IrSymbol;)V - public fun lowerBound (Lorg/jetbrains/kotlin/types/model/FlexibleTypeMarker;)Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker; - public fun lowerBoundIfFlexible (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker; + public fun lowerBound (Lorg/jetbrains/kotlin/types/model/FlexibleTypeMarker;)Lorg/jetbrains/kotlin/ir/types/IrSimpleType; + public synthetic fun lowerBound (Lorg/jetbrains/kotlin/types/model/FlexibleTypeMarker;)Lorg/jetbrains/kotlin/types/model/RigidTypeMarker; + public fun lowerBoundIfFlexible (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Lorg/jetbrains/kotlin/types/model/RigidTypeMarker; + public fun lowerBoundIfFlexible (Lorg/jetbrains/kotlin/types/model/RigidTypeMarker;)Lorg/jetbrains/kotlin/types/model/RigidTypeMarker; public fun lowerType (Lorg/jetbrains/kotlin/types/model/CapturedTypeMarker;)Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker; + public fun makeDefinitelyNotNullOrNotNull (Lorg/jetbrains/kotlin/types/model/DefinitelyNotNullTypeMarker;)Lorg/jetbrains/kotlin/types/model/DefinitelyNotNullTypeMarker; public fun makeDefinitelyNotNullOrNotNull (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker; + public fun makeDefinitelyNotNullOrNotNull (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;Z)Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker; + public synthetic fun makeDefinitelyNotNullOrNotNull (Lorg/jetbrains/kotlin/types/model/RigidTypeMarker;)Lorg/jetbrains/kotlin/types/model/RigidTypeMarker; + public fun makeDefinitelyNotNullOrNotNull (Lorg/jetbrains/kotlin/types/model/RigidTypeMarker;)Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker; public fun makeNullable (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker; - public fun makeSimpleTypeDefinitelyNotNullOrNotNull (Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker;)Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker; public fun newTypeCheckerState (ZZ)Lorg/jetbrains/kotlin/types/TypeCheckerState; public fun nothingType ()Lorg/jetbrains/kotlin/ir/types/IrSimpleType; public synthetic fun nothingType ()Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker; @@ -879,10 +863,11 @@ public final class arrow/meta/phases/codegen/ir/IrUtils : org/jetbrains/kotlin/i public fun nullableNothingType ()Lorg/jetbrains/kotlin/ir/types/IrSimpleType; public synthetic fun nullableNothingType ()Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker; public fun original (Lorg/jetbrains/kotlin/types/model/DefinitelyNotNullTypeMarker;)Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker; + public fun originalIfDefinitelyNotNullable (Lorg/jetbrains/kotlin/types/model/RigidTypeMarker;)Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker; public fun originalIfDefinitelyNotNullable (Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker;)Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker; public fun parametersCount (Lorg/jetbrains/kotlin/types/model/TypeConstructorMarker;)I - public synthetic fun possibleIntegerTypes (Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker;)Ljava/util/Collection; - public fun possibleIntegerTypes (Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker;)Ljava/util/Set; + public synthetic fun possibleIntegerTypes (Lorg/jetbrains/kotlin/types/model/RigidTypeMarker;)Ljava/util/Collection; + public fun possibleIntegerTypes (Lorg/jetbrains/kotlin/types/model/RigidTypeMarker;)Ljava/util/Set; public fun projection (Lorg/jetbrains/kotlin/types/model/CapturedTypeConstructorMarker;)Lorg/jetbrains/kotlin/types/model/TypeArgumentMarker; public fun referenceClass (Lorg/jetbrains/kotlin/ir/util/IdSignature;)Lorg/jetbrains/kotlin/ir/symbols/IrClassSymbol; public fun referenceConstructor (Lorg/jetbrains/kotlin/ir/util/IdSignature;)Lorg/jetbrains/kotlin/ir/symbols/IrConstructorSymbol; @@ -897,25 +882,29 @@ public final class arrow/meta/phases/codegen/ir/IrUtils : org/jetbrains/kotlin/i public fun safeSubstitute (Lorg/jetbrains/kotlin/types/model/TypeSubstitutorMarker;Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker; public fun size (Lorg/jetbrains/kotlin/types/model/TypeArgumentListMarker;)I public final fun substitutedIrTypes (Lorg/jetbrains/kotlin/descriptors/CallableDescriptor;Lorg/jetbrains/kotlin/resolve/calls/inference/components/NewTypeSubstitutorByConstructorMap;)Ljava/util/List; - public fun substitutionSupertypePolicy (Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker;)Lorg/jetbrains/kotlin/types/TypeCheckerState$SupertypesPolicy; + public fun substitutionSupertypePolicy (Lorg/jetbrains/kotlin/types/model/RigidTypeMarker;)Lorg/jetbrains/kotlin/types/TypeCheckerState$SupertypesPolicy; public fun supertypes (Lorg/jetbrains/kotlin/types/model/TypeConstructorMarker;)Ljava/util/Collection; + public fun supportsImprovedVarianceInCst ()Z public fun toErrorType (Lorg/jetbrains/kotlin/types/model/TypeConstructorMarker;)Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker; public final fun toIrType (Lorg/jetbrains/kotlin/types/KotlinType;)Lorg/jetbrains/kotlin/ir/types/IrType; public final fun transform (Lorg/jetbrains/kotlin/ir/declarations/IrFunction;Ljava/lang/Object;Lkotlin/jvm/functions/Function2;)Lorg/jetbrains/kotlin/ir/IrStatement; public static synthetic fun transform$default (Larrow/meta/phases/codegen/ir/IrUtils;Lorg/jetbrains/kotlin/ir/declarations/IrFunction;Ljava/lang/Object;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lorg/jetbrains/kotlin/ir/IrStatement; public fun typeConstructor (Lorg/jetbrains/kotlin/types/model/CapturedTypeMarker;)Lorg/jetbrains/kotlin/types/model/CapturedTypeConstructorMarker; public fun typeConstructor (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Lorg/jetbrains/kotlin/types/model/TypeConstructorMarker; - public fun typeConstructor (Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker;)Lorg/jetbrains/kotlin/types/model/TypeConstructorMarker; + public fun typeConstructor (Lorg/jetbrains/kotlin/types/model/RigidTypeMarker;)Lorg/jetbrains/kotlin/types/model/TypeConstructorMarker; public fun typeDepth (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)I - public fun typeDepth (Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker;)I + public fun typeDepth (Lorg/jetbrains/kotlin/types/model/RigidTypeMarker;)I public fun typeSubstitutorByTypeConstructor (Ljava/util/Map;)Lorg/jetbrains/kotlin/types/model/TypeSubstitutorMarker; public fun unionTypeAttributes (Ljava/util/List;)Ljava/util/List; public fun unwrapStubTypeVariableConstructor (Lorg/jetbrains/kotlin/types/model/TypeConstructorMarker;)Lorg/jetbrains/kotlin/types/model/TypeConstructorMarker; - public fun upperBound (Lorg/jetbrains/kotlin/types/model/FlexibleTypeMarker;)Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker; + public fun upperBound (Lorg/jetbrains/kotlin/types/model/FlexibleTypeMarker;)Lorg/jetbrains/kotlin/ir/types/IrSimpleType; + public synthetic fun upperBound (Lorg/jetbrains/kotlin/types/model/FlexibleTypeMarker;)Lorg/jetbrains/kotlin/types/model/RigidTypeMarker; public fun upperBoundCount (Lorg/jetbrains/kotlin/types/model/TypeParameterMarker;)I - public fun upperBoundIfFlexible (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker; + public fun upperBoundIfFlexible (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;)Lorg/jetbrains/kotlin/types/model/RigidTypeMarker; + public fun upperBoundIfFlexible (Lorg/jetbrains/kotlin/types/model/RigidTypeMarker;)Lorg/jetbrains/kotlin/types/model/RigidTypeMarker; public fun withNullability (Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker;Z)Lorg/jetbrains/kotlin/types/model/KotlinTypeMarker; - public fun withNullability (Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker;Z)Lorg/jetbrains/kotlin/types/model/SimpleTypeMarker; + public fun withNullability (Lorg/jetbrains/kotlin/types/model/RigidTypeMarker;Z)Lorg/jetbrains/kotlin/ir/types/IrSimpleType; + public synthetic fun withNullability (Lorg/jetbrains/kotlin/types/model/RigidTypeMarker;Z)Lorg/jetbrains/kotlin/types/model/RigidTypeMarker; } public final class arrow/meta/phases/codegen/ir/IrUtilsKt { diff --git a/libs/arrow-meta/src/main/kotlin/arrow/meta/Meta.kt b/libs/arrow-meta/src/main/kotlin/arrow/meta/Meta.kt index 13cdfafd3..420674b31 100644 --- a/libs/arrow-meta/src/main/kotlin/arrow/meta/Meta.kt +++ b/libs/arrow-meta/src/main/kotlin/arrow/meta/Meta.kt @@ -91,7 +91,7 @@ abstract class Meta : CompilerPluginRegistrar(), MetaPluginSyntax, InternalRegis */ abstract override fun intercept(ctx: CompilerContext): List - override val supportsK2: Boolean = false + override val supportsK2: Boolean = true override fun ExtensionStorage.registerExtensions(configuration: CompilerConfiguration) { registerMetaComponents(configuration) diff --git a/libs/arrow-meta/src/main/kotlin/arrow/meta/MetaCliProcessor.kt b/libs/arrow-meta/src/main/kotlin/arrow/meta/MetaCliProcessor.kt index 9a23b3022..5d80934e4 100644 --- a/libs/arrow-meta/src/main/kotlin/arrow/meta/MetaCliProcessor.kt +++ b/libs/arrow-meta/src/main/kotlin/arrow/meta/MetaCliProcessor.kt @@ -26,7 +26,7 @@ abstract class MetaCliProcessor(private val metaPluginId: String) : CommandLineP "arrow-meta-gen-src-output-dir", "Directory to locate generated sources", required = false, - allowMultipleOccurrences = false + allowMultipleOccurrences = false, ) val ARROW_META_BASE_DIR = CliOption( @@ -34,7 +34,7 @@ abstract class MetaCliProcessor(private val metaPluginId: String) : CommandLineP "arrow-meta-base-dir", "Base directory from where the plugin is run", required = false, - allowMultipleOccurrences = false + allowMultipleOccurrences = false, ) } @@ -47,7 +47,7 @@ abstract class MetaCliProcessor(private val metaPluginId: String) : CommandLineP override fun processOption( option: AbstractCliOption, value: String, - configuration: CompilerConfiguration + configuration: CompilerConfiguration, ) = when (option.optionName) { "generatedSrcOutputDir" -> diff --git a/libs/arrow-meta/src/main/kotlin/arrow/meta/dsl/analysis/AnalysisSyntax.kt b/libs/arrow-meta/src/main/kotlin/arrow/meta/dsl/analysis/AnalysisSyntax.kt index f478ff60b..d5ce71cc6 100644 --- a/libs/arrow-meta/src/main/kotlin/arrow/meta/dsl/analysis/AnalysisSyntax.kt +++ b/libs/arrow-meta/src/main/kotlin/arrow/meta/dsl/analysis/AnalysisSyntax.kt @@ -39,14 +39,14 @@ interface AnalysisSyntax { fun additionalSources( collectAdditionalSourcesAndUpdateConfiguration: CompilerContext.( - knownSources: Collection, configuration: CompilerConfiguration, project: Project + knownSources: Collection, configuration: CompilerConfiguration, project: Project, ) -> Collection ): CollectAdditionalSources = object : CollectAdditionalSources { override fun CompilerContext.collectAdditionalSourcesAndUpdateConfiguration( knownSources: Collection, configuration: CompilerConfiguration, - project: Project + project: Project, ): Collection = collectAdditionalSourcesAndUpdateConfiguration(knownSources, configuration, project) } @@ -67,16 +67,16 @@ interface AnalysisSyntax { projectContext: ProjectContext, files: Collection, bindingTrace: BindingTrace, - componentProvider: ComponentProvider + componentProvider: ComponentProvider, ) -> AnalysisResult?, analysisCompleted: CompilerContext.( project: Project, module: ModuleDescriptor, bindingTrace: BindingTrace, - files: Collection + files: Collection, ) -> AnalysisResult? = - Noop.nullable5() + Noop.nullable5(), ): AnalysisHandler = object : AnalysisHandler { override fun CompilerContext.doAnalysis( @@ -85,7 +85,7 @@ interface AnalysisSyntax { projectContext: ProjectContext, files: Collection, bindingTrace: BindingTrace, - componentProvider: ComponentProvider + componentProvider: ComponentProvider, ): AnalysisResult? { return doAnalysis(project, module, projectContext, files, bindingTrace, componentProvider) } @@ -94,14 +94,14 @@ interface AnalysisSyntax { project: Project, module: ModuleDescriptor, bindingTrace: BindingTrace, - files: Collection + files: Collection, ): AnalysisResult? = analysisCompleted(project, module, bindingTrace, files) } fun preprocessedVirtualFileFactory( createPreprocessedFile: CompilerContext.(file: VirtualFile?) -> VirtualFile?, createPreprocessedLightFile: CompilerContext.(file: LightVirtualFile?) -> LightVirtualFile? = - Noop.nullable2() + Noop.nullable2(), ): PreprocessedVirtualFileFactory = object : PreprocessedVirtualFileFactory { override fun CompilerContext.isPassThrough(): Boolean = false @@ -150,10 +150,9 @@ interface AnalysisSyntax { val mutableDiagnostics = diagnostics.getOwnDiagnostics() as ArrayList mutableDiagnostics.removeIf(f) null - } + }, ) - } - ?: ExtensionPhase.Empty + } ?: ExtensionPhase.Empty /** @see [suppressDiagnostic] including access to the [BindingTrace] */ fun suppressDiagnosticWithTrace(f: BindingTrace.(Diagnostic) -> Boolean): ExtensionPhase = @@ -170,8 +169,7 @@ interface AnalysisSyntax { val mutableDiagnostics = diagnostics.getOwnDiagnostics() as ArrayList mutableDiagnostics.removeIf { f(bindingTrace, it) } null - } + }, ) - } - ?: ExtensionPhase.Empty + } ?: ExtensionPhase.Empty } diff --git a/libs/arrow-meta/src/main/kotlin/arrow/meta/dsl/codegen/asm/AsmSyntax.kt b/libs/arrow-meta/src/main/kotlin/arrow/meta/dsl/codegen/asm/AsmSyntax.kt index 62abbc136..597cbc443 100644 --- a/libs/arrow-meta/src/main/kotlin/arrow/meta/dsl/codegen/asm/AsmSyntax.kt +++ b/libs/arrow-meta/src/main/kotlin/arrow/meta/dsl/codegen/asm/AsmSyntax.kt @@ -24,25 +24,25 @@ interface AsmSyntax { fun codegen( applyFunction: CompilerContext.( - receiver: StackValue, resolvedCall: ResolvedCall<*>, c: ExpressionCodegenExtension.Context + receiver: StackValue, resolvedCall: ResolvedCall<*>, c: ExpressionCodegenExtension.Context, ) -> StackValue?, applyProperty: CompilerContext.( - receiver: StackValue, resolvedCall: ResolvedCall<*>, c: ExpressionCodegenExtension.Context + receiver: StackValue, resolvedCall: ResolvedCall<*>, c: ExpressionCodegenExtension.Context, ) -> StackValue?, - generateClassSyntheticParts: CompilerContext.(codegen: ImplementationBodyCodegen) -> Unit + generateClassSyntheticParts: CompilerContext.(codegen: ImplementationBodyCodegen) -> Unit, ): Codegen = object : Codegen { override fun CompilerContext.applyFunction( receiver: StackValue, resolvedCall: ResolvedCall<*>, - c: ExpressionCodegenExtension.Context + c: ExpressionCodegenExtension.Context, ): StackValue? = applyFunction(receiver, resolvedCall, c) override fun CompilerContext.applyProperty( receiver: StackValue, resolvedCall: ResolvedCall<*>, - c: ExpressionCodegenExtension.Context + c: ExpressionCodegenExtension.Context, ): StackValue? = applyProperty(receiver, resolvedCall, c) override fun CompilerContext.generateClassSyntheticParts(codegen: ImplementationBodyCodegen) = diff --git a/libs/arrow-meta/src/main/kotlin/arrow/meta/dsl/codegen/ir/IrSyntax.kt b/libs/arrow-meta/src/main/kotlin/arrow/meta/dsl/codegen/ir/IrSyntax.kt index 37482f2d1..551e3469a 100644 --- a/libs/arrow-meta/src/main/kotlin/arrow/meta/dsl/codegen/ir/IrSyntax.kt +++ b/libs/arrow-meta/src/main/kotlin/arrow/meta/dsl/codegen/ir/IrSyntax.kt @@ -107,13 +107,13 @@ interface IrSyntax { ( compilerContext: CompilerContext, moduleFragment: IrModuleFragment, - pluginContext: IrPluginContext + pluginContext: IrPluginContext, ) -> Unit ): IRGeneration = object : IRGeneration { override fun CompilerContext.generate( moduleFragment: IrModuleFragment, - pluginContext: IrPluginContext + pluginContext: IrPluginContext, ) { generate(this, moduleFragment, pluginContext) } @@ -125,14 +125,14 @@ interface IrSyntax { object : IrElementTransformer { override fun visitModuleFragment( declaration: IrModuleFragment, - data: Unit + data: Unit, ): IrModuleFragment = declaration.transformChildren(this, Unit).let { f(IrUtils(pluginContext, compilerContext, moduleFragment), declaration) ?: super.visitModuleFragment(declaration, data) } }, - Unit + Unit, ) } @@ -146,7 +146,7 @@ interface IrSyntax { ?: super.visitFile(declaration, data) } }, - Unit + Unit, ) } @@ -160,7 +160,7 @@ interface IrSyntax { ?: super.visitDeclaration(declaration, data) } }, - Unit + Unit, ) } @@ -174,7 +174,7 @@ interface IrSyntax { ?: super.visitClass(declaration, data) } }, - Unit + Unit, ) } @@ -188,7 +188,7 @@ interface IrSyntax { ?: super.visitFunction(declaration, data) } }, - Unit + Unit, ) } @@ -202,7 +202,7 @@ interface IrSyntax { ?: super.visitSimpleFunction(declaration, data) } }, - Unit + Unit, ) } @@ -216,7 +216,7 @@ interface IrSyntax { ?: super.visitConstructor(declaration, data) } }, - Unit + Unit, ) } @@ -230,7 +230,7 @@ interface IrSyntax { ?: super.visitProperty(declaration, data) } }, - Unit + Unit, ) } @@ -244,7 +244,7 @@ interface IrSyntax { ?: super.visitField(declaration, data) } }, - Unit + Unit, ) } @@ -255,14 +255,14 @@ interface IrSyntax { object : IrElementTransformer { override fun visitLocalDelegatedProperty( declaration: IrLocalDelegatedProperty, - data: Unit + data: Unit, ): IrStatement = declaration.transformChildren(this, Unit).let { f(IrUtils(pluginContext, compilerContext, moduleFragment), declaration) ?: super.visitLocalDelegatedProperty(declaration, data) } }, - Unit + Unit, ) } @@ -276,7 +276,7 @@ interface IrSyntax { ?: super.visitEnumEntry(declaration, data) } }, - Unit + Unit, ) } @@ -287,14 +287,14 @@ interface IrSyntax { object : IrElementTransformer { override fun visitAnonymousInitializer( declaration: IrAnonymousInitializer, - data: Unit + data: Unit, ): IrStatement = declaration.transformChildren(this, Unit).let { f(IrUtils(pluginContext, compilerContext, moduleFragment), declaration) ?: super.visitAnonymousInitializer(declaration, data) } }, - Unit + Unit, ) } @@ -308,7 +308,7 @@ interface IrSyntax { ?: super.visitVariable(declaration, data) } }, - Unit + Unit, ) } @@ -322,7 +322,7 @@ interface IrSyntax { ?: super.visitTypeParameter(declaration, data) } }, - Unit + Unit, ) } @@ -336,7 +336,7 @@ interface IrSyntax { ?: super.visitValueParameter(declaration, data) } }, - Unit + Unit, ) } @@ -350,7 +350,7 @@ interface IrSyntax { ?: super.visitTypeAlias(declaration, data) } }, - Unit + Unit, ) } @@ -364,7 +364,7 @@ interface IrSyntax { ?: super.visitBody(body, data) } }, - Unit + Unit, ) } @@ -378,7 +378,7 @@ interface IrSyntax { ?: super.visitExpressionBody(body, data) } }, - Unit + Unit, ) } @@ -392,7 +392,7 @@ interface IrSyntax { ?: super.visitBlockBody(body, data) } }, - Unit + Unit, ) } @@ -406,7 +406,7 @@ interface IrSyntax { ?: super.visitSyntheticBody(body, data) } }, - Unit + Unit, ) } @@ -417,14 +417,14 @@ interface IrSyntax { object : IrElementTransformer { override fun visitSuspendableExpression( expression: IrSuspendableExpression, - data: Unit + data: Unit, ): IrExpression = expression.transformChildren(this, Unit).let { f(IrUtils(pluginContext, compilerContext, moduleFragment), expression) ?: super.visitSuspendableExpression(expression, data) } }, - Unit + Unit, ) } @@ -434,14 +434,14 @@ interface IrSyntax { object : IrElementTransformer { override fun visitSuspensionPoint( expression: IrSuspensionPoint, - data: Unit + data: Unit, ): IrExpression = expression.transformChildren(this, Unit).let { f(IrUtils(pluginContext, compilerContext, moduleFragment), expression) ?: super.visitSuspensionPoint(expression, data) } }, - Unit + Unit, ) } @@ -455,21 +455,21 @@ interface IrSyntax { ?: super.visitExpression(expression, data) } }, - Unit + Unit, ) } - fun Meta.irConst(f: IrUtils.(IrConst<*>) -> IrExpression?): IRGeneration = + fun Meta.irConst(f: IrUtils.(IrConst) -> IrExpression?): IRGeneration = IrGeneration { compilerContext, moduleFragment, pluginContext -> moduleFragment.transformChildren( object : IrElementTransformer { - override fun visitConst(expression: IrConst<*>, data: Unit): IrExpression = + override fun visitConst(expression: IrConst, data: Unit): IrExpression = expression.transformChildren(this, Unit).let { f(IrUtils(pluginContext, compilerContext, moduleFragment), expression) ?: super.visitConst(expression, data) } }, - Unit + Unit, ) } @@ -483,7 +483,7 @@ interface IrSyntax { ?: super.visitVararg(expression, data) } }, - Unit + Unit, ) } @@ -497,7 +497,7 @@ interface IrSyntax { ?: super.visitSpreadElement(spread, data) } }, - Unit + Unit, ) } @@ -508,14 +508,14 @@ interface IrSyntax { object : IrElementTransformer { override fun visitContainerExpression( expression: IrContainerExpression, - data: Unit + data: Unit, ): IrExpression = expression.transformChildren(this, Unit).let { f(IrUtils(pluginContext, compilerContext, moduleFragment), expression) ?: super.visitContainerExpression(expression, data) } }, - Unit + Unit, ) } @@ -529,7 +529,7 @@ interface IrSyntax { ?: super.visitBlock(expression, data) } }, - Unit + Unit, ) } @@ -543,7 +543,7 @@ interface IrSyntax { ?: super.visitComposite(expression, data) } }, - Unit + Unit, ) } @@ -554,14 +554,14 @@ interface IrSyntax { object : IrElementTransformer { override fun visitStringConcatenation( expression: IrStringConcatenation, - data: Unit + data: Unit, ): IrExpression = expression.transformChildren(this, Unit).let { f(IrUtils(pluginContext, compilerContext, moduleFragment), expression) ?: super.visitStringConcatenation(expression, data) } }, - Unit + Unit, ) } @@ -572,14 +572,14 @@ interface IrSyntax { object : IrElementTransformer { override fun visitDeclarationReference( expression: IrDeclarationReference, - data: Unit + data: Unit, ): IrExpression = expression.transformChildren(this, Unit).let { f(IrUtils(pluginContext, compilerContext, moduleFragment), expression) ?: super.visitDeclarationReference(expression, data) } }, - Unit + Unit, ) } @@ -589,14 +589,14 @@ interface IrSyntax { object : IrElementTransformer { override fun visitSingletonReference( expression: IrGetSingletonValue, - data: Unit + data: Unit, ): IrExpression = expression.transformChildren(this, Unit).let { f(IrUtils(pluginContext, compilerContext, moduleFragment), expression) ?: super.visitSingletonReference(expression, data) } }, - Unit + Unit, ) } @@ -610,7 +610,7 @@ interface IrSyntax { ?: super.visitGetObjectValue(expression, data) } }, - Unit + Unit, ) } @@ -624,7 +624,7 @@ interface IrSyntax { ?: super.visitGetEnumValue(expression, data) } }, - Unit + Unit, ) } @@ -634,14 +634,14 @@ interface IrSyntax { object : IrElementTransformer { override fun visitValueAccess( expression: IrValueAccessExpression, - data: Unit + data: Unit, ): IrExpression = expression.transformChildren(this, Unit).let { f(IrUtils(pluginContext, compilerContext, moduleFragment), expression) ?: super.visitValueAccess(expression, data) } }, - Unit + Unit, ) } @@ -655,7 +655,7 @@ interface IrSyntax { ?: super.visitGetValue(expression, data) } }, - Unit + Unit, ) } @@ -669,7 +669,7 @@ interface IrSyntax { ?: super.visitSetValue(expression, data) } }, - Unit + Unit, ) } @@ -679,14 +679,14 @@ interface IrSyntax { object : IrElementTransformer { override fun visitFieldAccess( expression: IrFieldAccessExpression, - data: Unit + data: Unit, ): IrExpression = expression.transformChildren(this, Unit).let { f(IrUtils(pluginContext, compilerContext, moduleFragment), expression) ?: super.visitFieldAccess(expression, data) } }, - Unit + Unit, ) } @@ -700,7 +700,7 @@ interface IrSyntax { ?: super.visitGetField(expression, data) } }, - Unit + Unit, ) } @@ -714,7 +714,7 @@ interface IrSyntax { ?: super.visitSetField(expression, data) } }, - Unit + Unit, ) } @@ -724,14 +724,14 @@ interface IrSyntax { object : IrElementTransformer { override fun visitMemberAccess( expression: IrMemberAccessExpression<*>, - data: Unit + data: Unit, ): IrElement = expression.transformChildren(this, Unit).let { f(IrUtils(pluginContext, compilerContext, moduleFragment), expression) ?: super.visitMemberAccess(expression, data) } }, - Unit + Unit, ) } @@ -741,14 +741,14 @@ interface IrSyntax { object : IrElementTransformer { override fun visitFunctionAccess( expression: IrFunctionAccessExpression, - data: Unit + data: Unit, ): IrElement = expression.transformChildren(this, Unit).let { f(IrUtils(pluginContext, compilerContext, moduleFragment), expression) ?: super.visitFunctionAccess(expression, data) } }, - Unit + Unit, ) } @@ -762,7 +762,7 @@ interface IrSyntax { ?: super.visitCall(expression, data) } }, - Unit + Unit, ) } @@ -776,7 +776,7 @@ interface IrSyntax { ?: super.visitConstructorCall(expression, data) } }, - Unit + Unit, ) } @@ -787,14 +787,14 @@ interface IrSyntax { object : IrElementTransformer { override fun visitDelegatingConstructorCall( expression: IrDelegatingConstructorCall, - data: Unit + data: Unit, ): IrElement = expression.transformChildren(this, Unit).let { f(IrUtils(pluginContext, compilerContext, moduleFragment), expression) ?: super.visitDelegatingConstructorCall(expression, data) } }, - Unit + Unit, ) } @@ -804,14 +804,14 @@ interface IrSyntax { object : IrElementTransformer { override fun visitEnumConstructorCall( expression: IrEnumConstructorCall, - data: Unit + data: Unit, ): IrElement = expression.transformChildren(this, Unit).let { f(IrUtils(pluginContext, compilerContext, moduleFragment), expression) ?: super.visitEnumConstructorCall(expression, data) } }, - Unit + Unit, ) } @@ -825,7 +825,7 @@ interface IrSyntax { ?: super.visitGetClass(expression, data) } }, - Unit + Unit, ) } @@ -835,14 +835,14 @@ interface IrSyntax { object : IrElementTransformer { override fun visitCallableReference( expression: IrCallableReference<*>, - data: Unit + data: Unit, ): IrElement = expression.transformChildren(this, Unit).let { f(IrUtils(pluginContext, compilerContext, moduleFragment), expression) ?: super.visitCallableReference(expression, data) } }, - Unit + Unit, ) } @@ -852,14 +852,14 @@ interface IrSyntax { object : IrElementTransformer { override fun visitFunctionReference( expression: IrFunctionReference, - data: Unit + data: Unit, ): IrElement = expression.transformChildren(this, Unit).let { f(IrUtils(pluginContext, compilerContext, moduleFragment), expression) ?: super.visitFunctionReference(expression, data) } }, - Unit + Unit, ) } @@ -869,14 +869,14 @@ interface IrSyntax { object : IrElementTransformer { override fun visitPropertyReference( expression: IrPropertyReference, - data: Unit + data: Unit, ): IrElement = expression.transformChildren(this, Unit).let { f(IrUtils(pluginContext, compilerContext, moduleFragment), expression) ?: super.visitPropertyReference(expression, data) } }, - Unit + Unit, ) } @@ -887,14 +887,14 @@ interface IrSyntax { object : IrElementTransformer { override fun visitLocalDelegatedPropertyReference( expression: IrLocalDelegatedPropertyReference, - data: Unit + data: Unit, ): IrElement = expression.transformChildren(this, Unit).let { f(IrUtils(pluginContext, compilerContext, moduleFragment), expression) ?: super.visitLocalDelegatedPropertyReference(expression, data) } }, - Unit + Unit, ) } @@ -908,7 +908,7 @@ interface IrSyntax { ?: super.visitClassReference(expression, data) } }, - Unit + Unit, ) } @@ -919,14 +919,14 @@ interface IrSyntax { object : IrElementTransformer { override fun visitInstanceInitializerCall( expression: IrInstanceInitializerCall, - data: Unit + data: Unit, ): IrExpression = expression.transformChildren(this, Unit).let { f(IrUtils(pluginContext, compilerContext, moduleFragment), expression) ?: super.visitInstanceInitializerCall(expression, data) } }, - Unit + Unit, ) } @@ -940,7 +940,7 @@ interface IrSyntax { ?: super.visitTypeOperator(expression, data) } }, - Unit + Unit, ) } @@ -954,7 +954,7 @@ interface IrSyntax { ?: super.visitWhen(expression, data) } }, - Unit + Unit, ) } @@ -968,7 +968,7 @@ interface IrSyntax { ?: super.visitBranch(branch, data) } }, - Unit + Unit, ) } @@ -982,7 +982,7 @@ interface IrSyntax { ?: super.visitElseBranch(branch, data) } }, - Unit + Unit, ) } @@ -996,7 +996,7 @@ interface IrSyntax { ?: super.visitLoop(loop, data) } }, - Unit + Unit, ) } @@ -1010,7 +1010,7 @@ interface IrSyntax { ?: super.visitWhileLoop(loop, data) } }, - Unit + Unit, ) } @@ -1024,7 +1024,7 @@ interface IrSyntax { ?: super.visitDoWhileLoop(loop, data) } }, - Unit + Unit, ) } @@ -1038,7 +1038,7 @@ interface IrSyntax { ?: super.visitTry(aTry, data) } }, - Unit + Unit, ) } @@ -1052,7 +1052,7 @@ interface IrSyntax { ?: super.visitCatch(aCatch, data) } }, - Unit + Unit, ) } @@ -1066,7 +1066,7 @@ interface IrSyntax { ?: super.visitBreakContinue(jump, data) } }, - Unit + Unit, ) } @@ -1080,7 +1080,7 @@ interface IrSyntax { ?: super.visitBreak(jump, data) } }, - Unit + Unit, ) } @@ -1094,7 +1094,7 @@ interface IrSyntax { ?: super.visitContinue(jump, data) } }, - Unit + Unit, ) } @@ -1108,7 +1108,7 @@ interface IrSyntax { ?: super.visitReturn(expression, data) } }, - Unit + Unit, ) } @@ -1122,7 +1122,7 @@ interface IrSyntax { ?: super.visitThrow(expression, data) } }, - Unit + Unit, ) } @@ -1132,14 +1132,14 @@ interface IrSyntax { object : IrElementTransformer { override fun visitDynamicExpression( expression: IrDynamicExpression, - data: Unit + data: Unit, ): IrExpression = expression.transformChildren(this, Unit).let { f(IrUtils(pluginContext, compilerContext, moduleFragment), expression) ?: super.visitDynamicExpression(expression, data) } }, - Unit + Unit, ) } @@ -1150,14 +1150,14 @@ interface IrSyntax { object : IrElementTransformer { override fun visitDynamicOperatorExpression( expression: IrDynamicOperatorExpression, - data: Unit + data: Unit, ): IrExpression = expression.transformChildren(this, Unit).let { f(IrUtils(pluginContext, compilerContext, moduleFragment), expression) ?: super.visitDynamicOperatorExpression(expression, data) } }, - Unit + Unit, ) } @@ -1168,14 +1168,14 @@ interface IrSyntax { object : IrElementTransformer { override fun visitDynamicMemberExpression( expression: IrDynamicMemberExpression, - data: Unit + data: Unit, ): IrExpression = expression.transformChildren(this, Unit).let { f(IrUtils(pluginContext, compilerContext, moduleFragment), expression) ?: super.visitDynamicMemberExpression(expression, data) } }, - Unit + Unit, ) } @@ -1185,14 +1185,14 @@ interface IrSyntax { object : IrElementTransformer { override fun visitErrorDeclaration( declaration: IrErrorDeclaration, - data: Unit + data: Unit, ): IrStatement = declaration.transformChildren(this, Unit).let { f(IrUtils(pluginContext, compilerContext, moduleFragment), declaration) ?: super.visitErrorDeclaration(declaration, data) } }, - Unit + Unit, ) } @@ -1202,14 +1202,14 @@ interface IrSyntax { object : IrElementTransformer { override fun visitErrorExpression( expression: IrErrorExpression, - data: Unit + data: Unit, ): IrExpression = expression.transformChildren(this, Unit).let { f(IrUtils(pluginContext, compilerContext, moduleFragment), expression) ?: super.visitErrorExpression(expression, data) } }, - Unit + Unit, ) } @@ -1220,14 +1220,14 @@ interface IrSyntax { object : IrElementTransformer { override fun visitErrorCallExpression( expression: IrErrorCallExpression, - data: Unit + data: Unit, ): IrExpression = expression.transformChildren(this, Unit).let { f(IrUtils(pluginContext, compilerContext, moduleFragment), expression) ?: super.visitErrorCallExpression(expression, data) } }, - Unit + Unit, ) } diff --git a/libs/arrow-meta/src/main/kotlin/arrow/meta/dsl/config/ConfigSyntax.kt b/libs/arrow-meta/src/main/kotlin/arrow/meta/dsl/config/ConfigSyntax.kt index b48fe70b9..9270ac674 100644 --- a/libs/arrow-meta/src/main/kotlin/arrow/meta/dsl/config/ConfigSyntax.kt +++ b/libs/arrow-meta/src/main/kotlin/arrow/meta/dsl/config/ConfigSyntax.kt @@ -55,28 +55,28 @@ interface ConfigSyntax { fun storageComponent( registerModuleComponents: CompilerContext.( - container: StorageComponentContainer, moduleDescriptor: ModuleDescriptor + container: StorageComponentContainer, moduleDescriptor: ModuleDescriptor, ) -> Unit, check: CompilerContext.( declaration: KtDeclaration, descriptor: DeclarationDescriptor, - context: DeclarationCheckerContext + context: DeclarationCheckerContext, ) -> Unit = - Noop.effect4 + Noop.effect4, ): arrow.meta.phases.config.StorageComponentContainer = object : arrow.meta.phases.config.StorageComponentContainer { override fun CompilerContext.check( declaration: KtDeclaration, descriptor: DeclarationDescriptor, - context: DeclarationCheckerContext + context: DeclarationCheckerContext, ) { check(declaration, descriptor, context) } override fun CompilerContext.registerModuleComponents( container: StorageComponentContainer, - moduleDescriptor: ModuleDescriptor + moduleDescriptor: ModuleDescriptor, ) { registerModuleComponents(container, moduleDescriptor) } @@ -87,7 +87,7 @@ interface ConfigSyntax { CompilerContext.( declaration: KtDeclaration, descriptor: DeclarationDescriptor, - context: DeclarationCheckerContext + context: DeclarationCheckerContext, ) -> Unit ): arrow.meta.phases.config.StorageComponentContainer = storageComponent(Noop.effect3, check) @@ -110,7 +110,7 @@ interface ConfigSyntax { CompilerContext.( resolvedCall: ResolvedCall<*>, reportOn: org.jetbrains.kotlin.com.intellij.psi.PsiElement, - context: CallCheckerContext + context: CallCheckerContext, ) -> Unit ): arrow.meta.phases.config.StorageComponentContainer = storageComponent( @@ -121,7 +121,7 @@ interface ConfigSyntax { override fun check( resolvedCall: ResolvedCall<*>, reportOn: org.jetbrains.kotlin.com.intellij.psi.PsiElement, - context: CallCheckerContext + context: CallCheckerContext, ): Unit = ctx.check(resolvedCall, reportOn, context) } ) diff --git a/libs/arrow-meta/src/main/kotlin/arrow/meta/dsl/resolve/ResolveSyntax.kt b/libs/arrow-meta/src/main/kotlin/arrow/meta/dsl/resolve/ResolveSyntax.kt index c78bacfa5..6f84e7b0c 100644 --- a/libs/arrow-meta/src/main/kotlin/arrow/meta/dsl/resolve/ResolveSyntax.kt +++ b/libs/arrow-meta/src/main/kotlin/arrow/meta/dsl/resolve/ResolveSyntax.kt @@ -49,7 +49,7 @@ interface ResolveSyntax { containingDeclaration: DeclarationDescriptor?, currentModality: Modality, bindingContext: BindingContext, - isImplicitModality: Boolean + isImplicitModality: Boolean, ) -> Modality? ): DeclarationAttributeAlterer = object : DeclarationAttributeAlterer { @@ -58,14 +58,14 @@ interface ResolveSyntax { declaration: DeclarationDescriptor?, containingDeclaration: DeclarationDescriptor?, currentModality: Modality, - isImplicitModality: Boolean + isImplicitModality: Boolean, ): Modality? = refineDeclarationModality( modifierListOwner, declaration, containingDeclaration, currentModality, - isImplicitModality + isImplicitModality, ) } @@ -83,7 +83,7 @@ interface ResolveSyntax { storageManager: StorageManager, trace: BindingTrace, moduleInfo: ModuleInfo?, - lookupTracker: LookupTracker + lookupTracker: LookupTracker, ) -> PackageFragmentProvider? ): PackageProvider = object : PackageProvider { @@ -93,7 +93,7 @@ interface ResolveSyntax { storageManager: StorageManager, trace: BindingTrace, moduleInfo: ModuleInfo?, - lookupTracker: LookupTracker + lookupTracker: LookupTracker, ): PackageFragmentProvider? = getPackageFragmentProvider( project, @@ -101,7 +101,7 @@ interface ResolveSyntax { storageManager, trace, moduleInfo, - lookupTracker + lookupTracker, ) } @@ -123,17 +123,17 @@ interface ResolveSyntax { Noop.emptyCollection2(), syntheticConstructorsForName: CompilerContext.( - contributedClassifier: ClassifierDescriptor, location: LookupLocation + contributedClassifier: ClassifierDescriptor, location: LookupLocation, ) -> Collection = Noop.emptyCollection3(), syntheticExtensionProperties: CompilerContext.( - receiverTypes: Collection, location: LookupLocation + receiverTypes: Collection, location: LookupLocation, ) -> Collection = Noop.emptyCollection3(), syntheticExtensionPropertiesForName: CompilerContext.( - receiverTypes: Collection, name: Name, location: LookupLocation + receiverTypes: Collection, name: Name, location: LookupLocation, ) -> Collection = Noop.emptyCollection4(), syntheticMemberFunctions: @@ -141,7 +141,7 @@ interface ResolveSyntax { Noop.emptyCollection2(), syntheticMemberFunctionsForName: CompilerContext.( - receiverTypes: Collection, name: Name, location: LookupLocation + receiverTypes: Collection, name: Name, location: LookupLocation, ) -> Collection = Noop.emptyCollection4(), syntheticStaticFunctions: @@ -151,9 +151,9 @@ interface ResolveSyntax { Noop.emptyCollection2(), syntheticStaticFunctionsForName: CompilerContext.( - contributedFunctions: Collection, location: LookupLocation + contributedFunctions: Collection, location: LookupLocation, ) -> Collection = - Noop.emptyCollection3() + Noop.emptyCollection3(), ): ExtensionPhase = object : SyntheticScopeProvider { override fun CompilerContext.syntheticConstructor( @@ -166,19 +166,19 @@ interface ResolveSyntax { override fun CompilerContext.syntheticConstructors( contributedClassifier: ClassifierDescriptor, - location: LookupLocation + location: LookupLocation, ): Collection = syntheticConstructorsForName(contributedClassifier, location) override fun CompilerContext.syntheticExtensionProperties( receiverTypes: Collection, - location: LookupLocation + location: LookupLocation, ): Collection = syntheticExtensionProperties(receiverTypes, location) override fun CompilerContext.syntheticExtensionProperties( receiverTypes: Collection, name: Name, - location: LookupLocation + location: LookupLocation, ): Collection = syntheticExtensionPropertiesForName(receiverTypes, name, location) @@ -189,7 +189,7 @@ interface ResolveSyntax { override fun CompilerContext.syntheticMemberFunctions( receiverTypes: Collection, name: Name, - location: LookupLocation + location: LookupLocation, ): Collection = syntheticMemberFunctionsForName(receiverTypes, name, location) @@ -199,7 +199,7 @@ interface ResolveSyntax { override fun CompilerContext.syntheticStaticFunctions( contributedFunctions: Collection, - location: LookupLocation + location: LookupLocation, ): Collection = syntheticStaticFunctionsForName(contributedFunctions, location) } @@ -215,7 +215,7 @@ interface ResolveSyntax { fun syntheticResolver( addSyntheticSupertypes: CompilerContext.( - thisDescriptor: ClassDescriptor, supertypes: MutableList + thisDescriptor: ClassDescriptor, supertypes: MutableList, ) -> Unit = Noop.effect3, /** @@ -230,7 +230,7 @@ interface ResolveSyntax { name: Name, ctx: LazyClassContext, declarationProvider: PackageMemberDeclarationProvider, - result: MutableSet + result: MutableSet, ) -> Unit = Noop.effect6, generateSyntheticClasses: @@ -239,7 +239,7 @@ interface ResolveSyntax { name: Name, ctx: LazyClassContext, declarationProvider: ClassMemberDeclarationProvider, - result: MutableSet + result: MutableSet, ) -> Unit = Noop.effect6, generateSyntheticMethods: @@ -248,7 +248,7 @@ interface ResolveSyntax { name: Name, bindingContext: BindingContext, fromSupertypes: List, - result: MutableCollection + result: MutableCollection, ) -> Unit = Noop.effect6, generateSyntheticProperties: @@ -257,14 +257,14 @@ interface ResolveSyntax { name: Name, bindingContext: BindingContext, fromSupertypes: ArrayList, - result: MutableSet + result: MutableSet, ) -> Unit = Noop.effect6, generateSyntheticSecondaryConstructors: CompilerContext.( thisDescriptor: ClassDescriptor, bindingContext: BindingContext, - result: MutableCollection + result: MutableCollection, ) -> Unit = Noop.effect4, getSyntheticCompanionObjectNameIfNeeded: @@ -273,12 +273,12 @@ interface ResolveSyntax { getSyntheticFunctionNames: CompilerContext.(thisDescriptor: ClassDescriptor) -> List? = Noop.nullable2(), getSyntheticNestedClassNames: CompilerContext.(thisDescriptor: ClassDescriptor) -> List? = - Noop.nullable2() + Noop.nullable2(), ): SyntheticResolver = object : SyntheticResolver { override fun CompilerContext.addSyntheticSupertypes( thisDescriptor: ClassDescriptor, - supertypes: MutableList + supertypes: MutableList, ) { addSyntheticSupertypes(thisDescriptor, supertypes) } @@ -288,7 +288,7 @@ interface ResolveSyntax { name: Name, ctx: LazyClassContext, declarationProvider: ClassMemberDeclarationProvider, - result: MutableSet + result: MutableSet, ) { generateSyntheticClasses(thisDescriptor, name, ctx, declarationProvider, result) } @@ -298,7 +298,7 @@ interface ResolveSyntax { name: Name, ctx: LazyClassContext, declarationProvider: PackageMemberDeclarationProvider, - result: MutableSet + result: MutableSet, ) { generatePackageSyntheticClasses(thisDescriptor, name, ctx, declarationProvider, result) } @@ -308,7 +308,7 @@ interface ResolveSyntax { name: Name, bindingContext: BindingContext, fromSupertypes: List, - result: MutableCollection + result: MutableCollection, ) { generateSyntheticMethods(thisDescriptor, name, bindingContext, fromSupertypes, result) } @@ -318,7 +318,7 @@ interface ResolveSyntax { name: Name, bindingContext: BindingContext, fromSupertypes: ArrayList, - result: MutableSet + result: MutableSet, ) { generateSyntheticProperties(thisDescriptor, name, bindingContext, fromSupertypes, result) } @@ -338,7 +338,7 @@ interface ResolveSyntax { override fun CompilerContext.generateSyntheticSecondaryConstructors( thisDescriptor: ClassDescriptor, bindingContext: BindingContext, - result: MutableCollection + result: MutableCollection, ): Unit = generateSyntheticSecondaryConstructors(thisDescriptor, bindingContext, result) } } diff --git a/libs/arrow-meta/src/main/kotlin/arrow/meta/internal/Noop.kt b/libs/arrow-meta/src/main/kotlin/arrow/meta/internal/Noop.kt index f78a5522b..86538ef42 100644 --- a/libs/arrow-meta/src/main/kotlin/arrow/meta/internal/Noop.kt +++ b/libs/arrow-meta/src/main/kotlin/arrow/meta/internal/Noop.kt @@ -8,32 +8,50 @@ object Noop { val effect4: (Any?, Any?, Any?, Any?) -> Unit = { _, _, _, _ -> Unit } val effect5: (Any?, Any?, Any?, Any?, Any?) -> Unit = { _, _, _, _, _ -> Unit } val effect6: (Any?, Any?, Any?, Any?, Any?, Any?) -> Unit = { _, _, _, _, _, _ -> Unit } + fun nullable1(): (Any?) -> A? = { null } + fun nullable2(): (Any?, Any?) -> A? = { _, _ -> null } + fun nullable3(): (Any?, Any?, Any?) -> A? = { _, _, _ -> null } + fun nullable4(): (Any?, Any?, Any?, Any?) -> A? = { _, _, _, _ -> null } + fun nullable5(): (Any?, Any?, Any?, Any?, Any?) -> A? = { _, _, _, _, _ -> null } + fun nullable6(): (Any?, Any?, Any?, Any?, Any?, Any?) -> A? = { _, _, _, _, _, _ -> null } + fun nullable7(): (Any?, Any?, Any?, Any?, Any?, Any?, Any?) -> A? = { _, _, _, _, _, _, _ -> null } + fun emptyCollection1(): (Any?) -> Collection = { emptyList() } + fun emptyList1(): (Any?) -> List = { emptyList() } + fun emptyCollection2(): (Any?, Any?) -> Collection = { _, _ -> emptyList() } + fun emptyList2(): (Any?, Any?) -> List = { _, _ -> emptyList() } + fun emptyCollection3(): (Any?, Any?, Any?) -> Collection = { _, _, _ -> emptyList() } + fun emptyCollection4(): (Any?, Any?, Any?, Any?) -> Collection = { _, _, _, _ -> emptyList() } + fun emptyCollection5(): (Any?, Any?, Any?, Any?, Any?) -> Collection = { _, _, _, _, _ -> emptyList() } + val boolean1True: (Any?) -> Boolean = { _ -> true } val boolean1False: (Any?) -> Boolean = { _ -> false } val boolean2True: (Any?, Any?) -> Boolean = { _, _ -> true } val boolean2False: (Any?, Any?) -> Boolean = { _, _ -> false } val boolean3True: (Any?, Any?, Any?) -> Boolean = { _, _, _ -> true } + fun string1(): (A) -> String = { _ -> "" } + fun string2(): (A, B) -> String = { _, _ -> "" } + fun string3(): (A, B, C) -> String = { _, _, _ -> "" } } diff --git a/libs/arrow-meta/src/main/kotlin/arrow/meta/internal/Utils.kt b/libs/arrow-meta/src/main/kotlin/arrow/meta/internal/Utils.kt index 2dd3be009..0e2f9551a 100644 --- a/libs/arrow-meta/src/main/kotlin/arrow/meta/internal/Utils.kt +++ b/libs/arrow-meta/src/main/kotlin/arrow/meta/internal/Utils.kt @@ -18,7 +18,7 @@ fun , T> Iterable.filterNotNullTo(destination: C inline fun > Iterable.mapNotNullTo( destination: C, - transform: (T) -> R? + transform: (T) -> R?, ): C { forEach { element -> transform(element)?.let { destination.add(it) } } return destination @@ -30,7 +30,7 @@ inline fun Iterable.mapNotNull(transform: (T) -> R?): List { inline fun > Map.mapNotNullTo( destination: C, - transform: (Map.Entry) -> R? + transform: (Map.Entry) -> R?, ): C { forEach { element -> transform(element)?.let { destination.add(it) } } return destination @@ -43,7 +43,7 @@ inline fun Map.mapNotNull(transform: (Map.Entry) -> R? data class SealedSubclass( val simpleName: Name, val fqName: FqName?, - val typeVariables: List + val typeVariables: List, ) fun KtClass.sealedSubclasses(): List = @@ -58,7 +58,7 @@ fun List.sealedVariants(superKt: KtClass): List = SealedSubclass( simpleName = it.nameAsSafeName, fqName = it.fqName, - typeVariables = if (it is KtClass) it.renderTypeParameters else emptyList() + typeVariables = if (it is KtClass) it.renderTypeParameters else emptyList(), ) } diff --git a/libs/arrow-meta/src/main/kotlin/arrow/meta/internal/registry/InternalRegistry.kt b/libs/arrow-meta/src/main/kotlin/arrow/meta/internal/registry/InternalRegistry.kt index 26c65a02b..73ddbcb70 100644 --- a/libs/arrow-meta/src/main/kotlin/arrow/meta/internal/registry/InternalRegistry.kt +++ b/libs/arrow-meta/src/main/kotlin/arrow/meta/internal/registry/InternalRegistry.kt @@ -32,7 +32,6 @@ import org.jetbrains.kotlin.backend.common.extensions.IrGenerationExtension import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext import org.jetbrains.kotlin.backend.jvm.extensions.ClassGenerator import org.jetbrains.kotlin.backend.jvm.extensions.ClassGeneratorExtension -import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity import org.jetbrains.kotlin.cli.common.messages.MessageCollector import org.jetbrains.kotlin.codegen.ClassBuilderFactory @@ -45,6 +44,7 @@ import org.jetbrains.kotlin.com.intellij.openapi.vfs.VirtualFile import org.jetbrains.kotlin.com.intellij.testFramework.LightVirtualFile import org.jetbrains.kotlin.compiler.plugin.CompilerPluginRegistrar import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi +import org.jetbrains.kotlin.config.CommonConfigurationKeys import org.jetbrains.kotlin.config.CompilerConfiguration import org.jetbrains.kotlin.container.ComponentProvider import org.jetbrains.kotlin.container.useInstance @@ -113,7 +113,7 @@ interface InternalRegistry : ConfigSyntax { projectContext: ProjectContext, files: Collection, bindingTrace: BindingTrace, - componentProvider: ComponentProvider + componentProvider: ComponentProvider, ): AnalysisResult? { ctx.module = module ctx.componentProvider = componentProvider @@ -124,7 +124,7 @@ interface InternalRegistry : ConfigSyntax { project: Project, module: ModuleDescriptor, bindingTrace: BindingTrace, - files: Collection + files: Collection, ): AnalysisResult? { ctx.module = module return super.analysisCompleted(project, module, bindingTrace, files) @@ -136,7 +136,7 @@ interface InternalRegistry : ConfigSyntax { fun CompilerPluginRegistrar.ExtensionStorage.registerProjectComponents( project: MockProject, - configuration: CompilerConfiguration + configuration: CompilerConfiguration, ) { ide { println("registerProjectComponents!!!! CALLED in IDEA!!!! something is wrong.") } registerMetaComponents(configuration) @@ -144,7 +144,7 @@ interface InternalRegistry : ConfigSyntax { fun CompilerPluginRegistrar.ExtensionStorage.registerMetaComponents( configuration: CompilerConfiguration, - context: CompilerContext? = null + context: CompilerContext? = null, ) { cli { registerSyntheticScopeProviderIfNeeded() } val ctx: CompilerContext = @@ -152,7 +152,7 @@ interface InternalRegistry : ConfigSyntax { context } else { val messageCollector: MessageCollector? = cli { - configuration.get(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY, MessageCollector.NONE) + configuration.get(CommonConfigurationKeys.MESSAGE_COLLECTOR_KEY, MessageCollector.NONE) } CompilerContext(configuration, messageCollector) } @@ -192,7 +192,7 @@ interface InternalRegistry : ConfigSyntax { else -> ctx.messageCollector?.report( CompilerMessageSeverity.ERROR, - "Unsupported extension phase: $this" + "Unsupported extension phase: $this", ) } } @@ -222,7 +222,7 @@ interface InternalRegistry : ConfigSyntax { fun CompilerPluginRegistrar.ExtensionStorage.registerExtraImports( phase: ExtraImports, - ctx: CompilerContext + ctx: CompilerContext, ) { ExtraImportsProviderExtension.registerExtension( object : ExtraImportsProviderExtension { @@ -234,7 +234,7 @@ interface InternalRegistry : ConfigSyntax { fun CompilerPluginRegistrar.ExtensionStorage.registerPreprocessedVirtualFileFactory( phase: PreprocessedVirtualFileFactory, - ctx: CompilerContext + ctx: CompilerContext, ) { PreprocessedVirtualFileFactoryExtension.registerExtension( object : PreprocessedVirtualFileFactoryExtension { @@ -251,13 +251,13 @@ interface InternalRegistry : ConfigSyntax { fun CompilerPluginRegistrar.ExtensionStorage.registerSyntheticScopeProvider( phase: SyntheticScopeProvider, - ctx: CompilerContext + ctx: CompilerContext, ) { SyntheticScopeProviderExtension.registerExtension( object : SyntheticScopeProviderExtension { override fun getScopes( moduleDescriptor: ModuleDescriptor, - javaSyntheticPropertiesScope: JavaSyntheticPropertiesScope + javaSyntheticPropertiesScope: JavaSyntheticPropertiesScope, ): List = phase.run { listOf( @@ -273,20 +273,20 @@ interface InternalRegistry : ConfigSyntax { override fun getSyntheticConstructors( contributedClassifier: ClassifierDescriptor, - location: LookupLocation + location: LookupLocation, ): Collection = phase.run { ctx.syntheticConstructors(contributedClassifier, location) } override fun getSyntheticExtensionProperties( receiverTypes: Collection, - location: LookupLocation + location: LookupLocation, ): Collection = phase.run { ctx.syntheticExtensionProperties(receiverTypes, location) } override fun getSyntheticExtensionProperties( receiverTypes: Collection, name: Name, - location: LookupLocation + location: LookupLocation, ): Collection = phase.run { ctx.syntheticExtensionProperties(receiverTypes, name, location) } @@ -298,7 +298,7 @@ interface InternalRegistry : ConfigSyntax { override fun getSyntheticMemberFunctions( receiverTypes: Collection, name: Name, - location: LookupLocation + location: LookupLocation, ): Collection = phase.run { ctx.syntheticMemberFunctions(receiverTypes, name, location) } @@ -309,7 +309,7 @@ interface InternalRegistry : ConfigSyntax { override fun getSyntheticStaticFunctions( contributedFunctions: Collection, - location: LookupLocation + location: LookupLocation, ): Collection = phase.run { ctx.syntheticStaticFunctions(contributedFunctions, location) } } @@ -321,7 +321,7 @@ interface InternalRegistry : ConfigSyntax { fun CompilerPluginRegistrar.ExtensionStorage.registerIRGeneration( phase: IRGeneration, - compilerContext: CompilerContext + compilerContext: CompilerContext, ) { IrGenerationExtension.registerExtension( object : IrGenerationExtension { @@ -334,13 +334,13 @@ interface InternalRegistry : ConfigSyntax { fun CompilerPluginRegistrar.ExtensionStorage.registerSyntheticResolver( phase: SyntheticResolver, - compilerContext: CompilerContext + compilerContext: CompilerContext, ) { SyntheticResolveExtension.registerExtension( object : SyntheticResolveExtension { override fun addSyntheticSupertypes( thisDescriptor: ClassDescriptor, - supertypes: MutableList + supertypes: MutableList, ) { phase.run { compilerContext.addSyntheticSupertypes(thisDescriptor, supertypes) } } @@ -350,7 +350,7 @@ interface InternalRegistry : ConfigSyntax { name: Name, ctx: LazyClassContext, declarationProvider: ClassMemberDeclarationProvider, - result: MutableSet + result: MutableSet, ) { phase.run { compilerContext.generateSyntheticClasses( @@ -358,7 +358,7 @@ interface InternalRegistry : ConfigSyntax { name, ctx, declarationProvider, - result + result, ) } } @@ -368,7 +368,7 @@ interface InternalRegistry : ConfigSyntax { name: Name, ctx: LazyClassContext, declarationProvider: PackageMemberDeclarationProvider, - result: MutableSet + result: MutableSet, ) { phase.run { compilerContext.generatePackageSyntheticClasses( @@ -376,7 +376,7 @@ interface InternalRegistry : ConfigSyntax { name, ctx, declarationProvider, - result + result, ) } } @@ -386,7 +386,7 @@ interface InternalRegistry : ConfigSyntax { name: Name, bindingContext: BindingContext, fromSupertypes: List, - result: MutableCollection + result: MutableCollection, ) { phase.run { compilerContext.generateSyntheticMethods( @@ -394,7 +394,7 @@ interface InternalRegistry : ConfigSyntax { name, bindingContext, fromSupertypes, - result + result, ) } } @@ -404,7 +404,7 @@ interface InternalRegistry : ConfigSyntax { name: Name, bindingContext: BindingContext, fromSupertypes: ArrayList, - result: MutableSet + result: MutableSet, ) { phase.run { compilerContext.generateSyntheticProperties( @@ -412,7 +412,7 @@ interface InternalRegistry : ConfigSyntax { name, bindingContext, fromSupertypes, - result + result, ) } } @@ -438,7 +438,7 @@ interface InternalRegistry : ConfigSyntax { fun CompilerPluginRegistrar.ExtensionStorage.packageFragmentProvider( phase: PackageProvider, - ctx: CompilerContext + ctx: CompilerContext, ) { PackageFragmentProviderExtension.registerExtension( object : PackageFragmentProviderExtension { @@ -448,7 +448,7 @@ interface InternalRegistry : ConfigSyntax { storageManager: StorageManager, trace: BindingTrace, moduleInfo: ModuleInfo?, - lookupTracker: LookupTracker + lookupTracker: LookupTracker, ): PackageFragmentProvider? { return phase.run { ctx.getPackageFragmentProvider( @@ -457,7 +457,7 @@ interface InternalRegistry : ConfigSyntax { storageManager, trace, moduleInfo, - lookupTracker + lookupTracker, ) } } @@ -467,7 +467,7 @@ interface InternalRegistry : ConfigSyntax { fun CompilerPluginRegistrar.ExtensionStorage.registerDeclarationAttributeAlterer( phase: DeclarationAttributeAlterer, - ctx: CompilerContext + ctx: CompilerContext, ) { DeclarationAttributeAltererExtension.registerExtension( object : DeclarationAttributeAltererExtension { @@ -476,7 +476,7 @@ interface InternalRegistry : ConfigSyntax { declaration: DeclarationDescriptor?, containingDeclaration: DeclarationDescriptor?, currentModality: Modality, - isImplicitModality: Boolean + isImplicitModality: Boolean, ): Modality? { return phase.run { ctx.refineDeclarationModality( @@ -484,7 +484,7 @@ interface InternalRegistry : ConfigSyntax { declaration, containingDeclaration, currentModality, - isImplicitModality + isImplicitModality, ) } } @@ -494,14 +494,14 @@ interface InternalRegistry : ConfigSyntax { fun CompilerPluginRegistrar.ExtensionStorage.registerCodegen( phase: Codegen, - ctx: CompilerContext + ctx: CompilerContext, ) { ExpressionCodegenExtension.registerExtension( object : ExpressionCodegenExtension { override fun applyFunction( receiver: StackValue, resolvedCall: ResolvedCall<*>, - c: ExpressionCodegenExtension.Context + c: ExpressionCodegenExtension.Context, ): StackValue? { return phase.run { ctx.applyFunction(receiver, resolvedCall, c) } } @@ -509,7 +509,7 @@ interface InternalRegistry : ConfigSyntax { override fun applyProperty( receiver: StackValue, resolvedCall: ResolvedCall<*>, - c: ExpressionCodegenExtension.Context + c: ExpressionCodegenExtension.Context, ): StackValue? { return phase.run { ctx.applyProperty(receiver, resolvedCall, c) } } @@ -523,14 +523,14 @@ interface InternalRegistry : ConfigSyntax { fun CompilerPluginRegistrar.ExtensionStorage.registerStorageComponentContainer( phase: StorageComponentContainer, - ctx: CompilerContext + ctx: CompilerContext, ) { StorageComponentContainerContributor.registerExtension(DelegatingContributor(phase, ctx)) } fun CompilerPluginRegistrar.ExtensionStorage.registerCollectAdditionalSources( phase: CollectAdditionalSources, - ctx: CompilerContext + ctx: CompilerContext, ) { cli { CollectAdditionalSourcesExtension.registerExtension( @@ -538,13 +538,13 @@ interface InternalRegistry : ConfigSyntax { override fun collectAdditionalSourcesAndUpdateConfiguration( knownSources: Collection, configuration: CompilerConfiguration, - project: Project + project: Project, ): Collection = phase.run { ctx.collectAdditionalSourcesAndUpdateConfiguration( knownSources, configuration, - project + project, ) } } @@ -554,7 +554,7 @@ interface InternalRegistry : ConfigSyntax { fun CompilerPluginRegistrar.ExtensionStorage.registerAnalysisHandler( phase: AnalysisHandler, - ctx: CompilerContext + ctx: CompilerContext, ) { phase.pushAnalysisPhase() cli { @@ -564,7 +564,7 @@ interface InternalRegistry : ConfigSyntax { project: Project, module: ModuleDescriptor, bindingTrace: BindingTrace, - files: Collection + files: Collection, ): AnalysisResult? = phase.run { popAnalysisPhase() @@ -578,7 +578,7 @@ interface InternalRegistry : ConfigSyntax { bindingTrace.bindingContext, module, emptyList(), - emptyList() + emptyList(), ) } else -> null @@ -591,7 +591,7 @@ interface InternalRegistry : ConfigSyntax { projectContext: ProjectContext, files: Collection, bindingTrace: BindingTrace, - componentProvider: ComponentProvider + componentProvider: ComponentProvider, ): AnalysisResult? { return phase.run { ctx.doAnalysis( @@ -600,7 +600,7 @@ interface InternalRegistry : ConfigSyntax { projectContext, files, bindingTrace, - componentProvider + componentProvider, ) } } @@ -611,13 +611,13 @@ interface InternalRegistry : ConfigSyntax { fun CompilerPluginRegistrar.ExtensionStorage.registerClassGenerator( phase: ClassGeneration, - ctx: CompilerContext + ctx: CompilerContext, ) { ClassGeneratorExtension.registerExtension( object : ClassGeneratorExtension { override fun generateClass( generator: ClassGenerator, - declaration: IrClass? + declaration: IrClass?, ): ClassGenerator = phase.run { ctx.interceptClassGenerator(generator, declaration) } } ) @@ -625,7 +625,7 @@ interface InternalRegistry : ConfigSyntax { fun CompilerPluginRegistrar.ExtensionStorage.registerClassBuilder( phase: ClassBuilder, - ctx: CompilerContext + ctx: CompilerContext, ) { @Suppress("DEPRECATION_ERROR") org.jetbrains.kotlin.codegen.extensions.ClassBuilderInterceptorExtension.registerExtension( @@ -635,7 +635,7 @@ interface InternalRegistry : ConfigSyntax { override fun interceptClassBuilderFactory( interceptedFactory: ClassBuilderFactory, bindingContext: BindingContext, - diagnostics: DiagnosticSink + diagnostics: DiagnosticSink, ): ClassBuilderFactory = phase.run { ctx.interceptClassBuilder(interceptedFactory, bindingContext, diagnostics) } } @@ -644,7 +644,7 @@ interface InternalRegistry : ConfigSyntax { fun CompilerPluginRegistrar.ExtensionStorage.registerCompilerConfiguration( phase: Config, - ctx: CompilerContext + ctx: CompilerContext, ) { CompilerConfigurationExtension.registerExtension( object : CompilerConfigurationExtension { @@ -661,7 +661,7 @@ interface InternalRegistry : ConfigSyntax { override fun registerModuleComponents( container: org.jetbrains.kotlin.container.StorageComponentContainer, platform: TargetPlatform, - moduleDescriptor: ModuleDescriptor + moduleDescriptor: ModuleDescriptor, ) { phase.run { ctx.registerModuleComponents(container, moduleDescriptor) } container.useInstance( @@ -669,7 +669,7 @@ interface InternalRegistry : ConfigSyntax { override fun check( declaration: KtDeclaration, descriptor: DeclarationDescriptor, - context: DeclarationCheckerContext + context: DeclarationCheckerContext, ): Unit = phase.run { ctx.check(declaration, descriptor, context) } } ) @@ -679,6 +679,6 @@ interface InternalRegistry : ConfigSyntax { fun compilerContextService(): StorageComponentContainer = storageComponent( registerModuleComponents = { container, _ -> container.useInstance(this) }, - check = { _, _, _ -> } + check = { _, _, _ -> }, ) } diff --git a/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/CompilerContext.kt b/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/CompilerContext.kt index fe58556e6..2e5d8a0d5 100644 --- a/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/CompilerContext.kt +++ b/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/CompilerContext.kt @@ -18,8 +18,9 @@ open class CompilerContext( val configuration: CompilerConfiguration?, // open val project: Project, val messageCollector: MessageCollector? = null, -// val ktPsiElementFactory: KtPsiFactory = KtPsiFactory(project, false), -// val eval: (String) -> Any? = { KotlinJsr223JvmLocalScriptEngineFactory().scriptEngine.eval(it) } + // val ktPsiElementFactory: KtPsiFactory = KtPsiFactory(project, false), + // val eval: (String) -> Any? = { KotlinJsr223JvmLocalScriptEngineFactory().scriptEngine.eval(it) + // } ) { private var md: ModuleDescriptor? = null private var cp: ComponentProvider? = null @@ -56,7 +57,7 @@ open class CompilerContext( fun CompilerContext.evaluateDependsOn( noRewindablePhase: () -> T?, - rewindablePhase: (Boolean) -> T? + rewindablePhase: (Boolean) -> T?, ): T? { if (!analysisPhaseCanBeRewind.get()) return noRewindablePhase() return rewindablePhase(analysisPhaseWasRewind.get()) @@ -65,7 +66,7 @@ fun CompilerContext.evaluateDependsOn( fun CompilerContext.evaluateDependsOnRewindableAnalysisPhase(evaluation: () -> T?): T? = evaluateDependsOn( noRewindablePhase = evaluation, - rewindablePhase = { wasRewind -> if (wasRewind) evaluation() else null } + rewindablePhase = { wasRewind -> if (wasRewind) evaluation() else null }, ) inline fun KtElement.findInAnalysedDescriptors( diff --git a/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/analysis/AnalysisContext.kt b/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/analysis/AnalysisContext.kt index 1226d6aa9..72e37978e 100644 --- a/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/analysis/AnalysisContext.kt +++ b/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/analysis/AnalysisContext.kt @@ -15,10 +15,13 @@ internal object AnalysisContext { private val pluginAnalysisExtensionQueue: Queue = LinkedList() fun AnalysisHandler.pushAnalysisPhase(): Boolean = pluginAnalysisExtensionQueue.offer(0) + fun AnalysisHandler.popAnalysisPhase(): Unit { if (pluginAnalysisExtensionQueue.isNotEmpty()) pluginAnalysisExtensionQueue.remove() } + fun AnalysisHandler.willRewind(rewind: Boolean): Unit = willRewind.set(rewind) + fun AnalysisHandler.canRewind(): Boolean = willRewind.get() && pluginAnalysisExtensionQueue.isEmpty() } diff --git a/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/analysis/AnalysisHandler.kt b/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/analysis/AnalysisHandler.kt index d64469ae3..7e02d973b 100644 --- a/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/analysis/AnalysisHandler.kt +++ b/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/analysis/AnalysisHandler.kt @@ -21,13 +21,13 @@ interface AnalysisHandler : ExtensionPhase { projectContext: ProjectContext, files: Collection, bindingTrace: BindingTrace, - componentProvider: ComponentProvider + componentProvider: ComponentProvider, ): AnalysisResult? fun CompilerContext.analysisCompleted( project: Project, module: ModuleDescriptor, bindingTrace: BindingTrace, - files: Collection + files: Collection, ): AnalysisResult? } diff --git a/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/analysis/CollectAdditionalSources.kt b/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/analysis/CollectAdditionalSources.kt index e0399d73a..43c205a4e 100644 --- a/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/analysis/CollectAdditionalSources.kt +++ b/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/analysis/CollectAdditionalSources.kt @@ -14,6 +14,6 @@ interface CollectAdditionalSources : ExtensionPhase { fun CompilerContext.collectAdditionalSourcesAndUpdateConfiguration( knownSources: Collection, configuration: CompilerConfiguration, - project: Project + project: Project, ): Collection } diff --git a/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/analysis/KtUtils.kt b/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/analysis/KtUtils.kt index cc7ecf23f..5b3320126 100644 --- a/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/analysis/KtUtils.kt +++ b/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/analysis/KtUtils.kt @@ -101,6 +101,7 @@ fun PsiElement.sequence(on: Class): List = traverseFilter interface Eq { // from arrow fun A.eqv(other: A): Boolean + fun A.neqv(other: A): Boolean = !eqv(other) companion object { @@ -153,7 +154,7 @@ fun resolveFunctionTypeEq(): Eq = Eq { t1, t2 -> */ fun C.intersect( eq: Eq, - types: KotlinBuiltIns.() -> List + types: KotlinBuiltIns.() -> List, ): List = eq.run { returnType?.let { result: KotlinType -> builtIns.types().filter { it.eqv(result) } } @@ -171,7 +172,7 @@ fun C.intersect( fun D.intersect( eq: Eq, list: List, - other: KotlinBuiltIns.() -> List + other: KotlinBuiltIns.() -> List, ): List = eq.run { val set = list.toMutableList() diff --git a/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/analysis/MetaFileViewProvider.kt b/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/analysis/MetaFileViewProvider.kt index 700ce2cb1..e3939dc23 100644 --- a/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/analysis/MetaFileViewProvider.kt +++ b/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/analysis/MetaFileViewProvider.kt @@ -12,7 +12,7 @@ import org.jetbrains.kotlin.com.intellij.psi.SingleRootFileViewProvider class MetaFileViewProvider( psiManager: PsiManager, virtualFile: VirtualFile, - val transformation: (Document?) -> Document? + val transformation: (Document?) -> Document?, ) : SingleRootFileViewProvider(psiManager, virtualFile) { override fun getDocument(): Document? = transformation(super.getDocument()) } diff --git a/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/analysis/PreprocessedVirtualFileFactory.kt b/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/analysis/PreprocessedVirtualFileFactory.kt index 355cccd0a..ab6655c40 100644 --- a/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/analysis/PreprocessedVirtualFileFactory.kt +++ b/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/analysis/PreprocessedVirtualFileFactory.kt @@ -11,6 +11,8 @@ import org.jetbrains.kotlin.com.intellij.testFramework.LightVirtualFile */ interface PreprocessedVirtualFileFactory : ExtensionPhase { fun CompilerContext.isPassThrough(): Boolean + fun CompilerContext.createPreprocessedFile(file: VirtualFile?): VirtualFile? + fun CompilerContext.createPreprocessedLightFile(file: LightVirtualFile?): LightVirtualFile? } diff --git a/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/codegen/asm/ClassBuilder.kt b/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/codegen/asm/ClassBuilder.kt index 9261608d8..fb5225aa1 100644 --- a/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/codegen/asm/ClassBuilder.kt +++ b/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/codegen/asm/ClassBuilder.kt @@ -14,6 +14,6 @@ interface ClassBuilder : ExtensionPhase { fun CompilerContext.interceptClassBuilder( interceptedFactory: ClassBuilderFactory, bindingContext: BindingContext, - diagnostics: DiagnosticSink + diagnostics: DiagnosticSink, ): ClassBuilderFactory } diff --git a/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/codegen/asm/ClassGeneration.kt b/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/codegen/asm/ClassGeneration.kt index b0e71f56a..67c969329 100644 --- a/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/codegen/asm/ClassGeneration.kt +++ b/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/codegen/asm/ClassGeneration.kt @@ -14,6 +14,6 @@ interface ClassGeneration : ExtensionPhase { @OptIn(ObsoleteDescriptorBasedAPI::class) fun CompilerContext.interceptClassGenerator( generator: ClassGenerator, - declaration: IrClass? + declaration: IrClass?, ): ClassGenerator } diff --git a/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/codegen/asm/Codegen.kt b/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/codegen/asm/Codegen.kt index 550bfd668..1e53fa1b1 100644 --- a/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/codegen/asm/Codegen.kt +++ b/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/codegen/asm/Codegen.kt @@ -15,13 +15,13 @@ interface Codegen : ExtensionPhase { fun CompilerContext.applyFunction( receiver: StackValue, resolvedCall: ResolvedCall<*>, - c: ExpressionCodegenExtension.Context + c: ExpressionCodegenExtension.Context, ): StackValue? fun CompilerContext.applyProperty( receiver: StackValue, resolvedCall: ResolvedCall<*>, - c: ExpressionCodegenExtension.Context + c: ExpressionCodegenExtension.Context, ): StackValue? fun CompilerContext.generateClassSyntheticParts(codegen: ImplementationBodyCodegen): Unit diff --git a/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/codegen/ir/IrUtils.kt b/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/codegen/ir/IrUtils.kt index e450851e0..6c68f4208 100644 --- a/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/codegen/ir/IrUtils.kt +++ b/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/codegen/ir/IrUtils.kt @@ -1,4 +1,4 @@ -@file:OptIn(ObsoleteDescriptorBasedAPI::class) +@file:OptIn(ObsoleteDescriptorBasedAPI::class, UnsafeDuringIrConstructionAPI::class) package arrow.meta.phases.codegen.ir @@ -15,7 +15,6 @@ import org.jetbrains.kotlin.ir.IrStatement import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET import org.jetbrains.kotlin.ir.declarations.IrConstructor -import org.jetbrains.kotlin.ir.declarations.IrFactory import org.jetbrains.kotlin.ir.declarations.IrFunction import org.jetbrains.kotlin.ir.declarations.IrModuleFragment import org.jetbrains.kotlin.ir.declarations.IrSimpleFunction @@ -26,10 +25,9 @@ import org.jetbrains.kotlin.ir.expressions.IrCall import org.jetbrains.kotlin.ir.expressions.IrConstructorCall import org.jetbrains.kotlin.ir.expressions.IrExpression import org.jetbrains.kotlin.ir.expressions.IrMemberAccessExpression -import org.jetbrains.kotlin.ir.expressions.impl.IrCallImpl -import org.jetbrains.kotlin.ir.expressions.impl.IrConstructorCallImpl -import org.jetbrains.kotlin.ir.expressions.impl.IrGetObjectValueImpl +import org.jetbrains.kotlin.ir.expressions.impl.* import org.jetbrains.kotlin.ir.symbols.IrSimpleFunctionSymbol +import org.jetbrains.kotlin.ir.symbols.UnsafeDuringIrConstructionAPI import org.jetbrains.kotlin.ir.types.IrType import org.jetbrains.kotlin.ir.types.IrTypeSystemContext import org.jetbrains.kotlin.ir.types.IrTypeSystemContextImpl @@ -52,17 +50,16 @@ import org.jetbrains.kotlin.types.KotlinType class IrUtils( val pluginContext: IrPluginContext, val compilerContext: CompilerContext, - val moduleFragment: IrModuleFragment + val moduleFragment: IrModuleFragment, ) : ReferenceSymbolTable by pluginContext.symbols.externalSymbolTable, - IrTypeSystemContext by IrTypeSystemContextImpl(pluginContext.irBuiltIns), - IrFactory by pluginContext.irFactory { + IrTypeSystemContext by IrTypeSystemContextImpl(pluginContext.irBuiltIns) { val typeTranslator: TypeTranslator = TypeTranslatorImpl( symbolTable = pluginContext.symbols.externalSymbolTable, languageVersionSettings = pluginContext.languageVersionSettings, - moduleDescriptor = moduleFragment.descriptor + moduleDescriptor = moduleFragment.descriptor, ) fun KotlinType.toIrType(): IrType = typeTranslator.translateType(this) @@ -75,39 +72,47 @@ class IrUtils( pluginContext.symbols.externalSymbolTable.descriptorExtension.referenceField(this) irField.owner.correspondingPropertySymbol?.owner?.getter?.symbol?.let { irSimpleFunctionSymbol -> - IrCallImpl( + IrCallImplWithShape( startOffset = UNDEFINED_OFFSET, endOffset = UNDEFINED_OFFSET, type = irSimpleFunctionSymbol.owner.returnType, symbol = irSimpleFunctionSymbol, typeArgumentsCount = irSimpleFunctionSymbol.owner.typeParameters.size, - valueArgumentsCount = irSimpleFunctionSymbol.owner.valueParameters.size + valueArgumentsCount = irSimpleFunctionSymbol.owner.valueParameters.size, + contextParameterCount = irSimpleFunctionSymbol.owner.contextReceiverParametersCount, + hasDispatchReceiver = irSimpleFunctionSymbol.owner.dispatchReceiverParameter != null, + hasExtensionReceiver = irSimpleFunctionSymbol.owner.extensionReceiverParameter != null, ) - } - ?: TODO("Unsupported irCall for $this") + } ?: TODO("Unsupported irCall for $this") } is ClassConstructorDescriptor -> { val irSymbol = pluginContext.symbols.externalSymbolTable.descriptorExtension.referenceConstructor(this) - IrConstructorCallImpl( + IrConstructorCallImplWithShape( startOffset = UNDEFINED_OFFSET, endOffset = UNDEFINED_OFFSET, type = irSymbol.owner.returnType, symbol = irSymbol, typeArgumentsCount = irSymbol.owner.typeParameters.size, valueArgumentsCount = irSymbol.owner.valueParameters.size, - constructorTypeArgumentsCount = irSymbol.owner.typeParameters.size + constructorTypeArgumentsCount = irSymbol.owner.typeParameters.size, + contextParameterCount = irSymbol.owner.contextReceiverParametersCount, + hasDispatchReceiver = irSymbol.owner.dispatchReceiverParameter != null, + hasExtensionReceiver = irSymbol.owner.extensionReceiverParameter != null, ) } is FunctionDescriptor -> { val irSymbol = pluginContext.symbols.externalSymbolTable.referenceFunction(this) - IrCallImpl( + IrCallImplWithShape( startOffset = UNDEFINED_OFFSET, endOffset = UNDEFINED_OFFSET, type = irSymbol.owner.returnType, symbol = irSymbol as IrSimpleFunctionSymbol, typeArgumentsCount = irSymbol.owner.typeParameters.size, - valueArgumentsCount = irSymbol.owner.valueParameters.size + valueArgumentsCount = irSymbol.owner.valueParameters.size, + contextParameterCount = irSymbol.owner.contextReceiverParametersCount, + hasDispatchReceiver = irSymbol.owner.dispatchReceiverParameter != null, + hasExtensionReceiver = irSymbol.owner.extensionReceiverParameter != null, ) } is FakeCallableDescriptorForObject -> { @@ -119,7 +124,7 @@ class IrUtils( startOffset = UNDEFINED_OFFSET, endOffset = UNDEFINED_OFFSET, type = irSymbol.owner.defaultType, - symbol = irSymbol + symbol = irSymbol, ) } else -> { @@ -133,13 +138,16 @@ class IrUtils( val irField = pluginContext.symbols.externalSymbolTable.descriptorExtension.referenceField(this) return irField.owner.correspondingPropertySymbol?.owner?.getter?.symbol?.let { irSimpleFunctionSymbol -> - IrCallImpl( + IrCallImplWithShape( startOffset = UNDEFINED_OFFSET, endOffset = UNDEFINED_OFFSET, type = irSimpleFunctionSymbol.owner.returnType, symbol = irSimpleFunctionSymbol, typeArgumentsCount = irSimpleFunctionSymbol.owner.typeParameters.size, - valueArgumentsCount = irSimpleFunctionSymbol.owner.valueParameters.size + valueArgumentsCount = irSimpleFunctionSymbol.owner.valueParameters.size, + contextParameterCount = irSimpleFunctionSymbol.owner.contextReceiverParametersCount, + hasDispatchReceiver = irSimpleFunctionSymbol.owner.dispatchReceiverParameter != null, + hasExtensionReceiver = irSimpleFunctionSymbol.owner.extensionReceiverParameter != null, ) } } @@ -147,14 +155,17 @@ class IrUtils( fun ClassDescriptor.irConstructorCall(): IrConstructorCall? { val irClass = this.classId?.let { pluginContext.referenceClass(it) } return irClass!!.constructors.firstOrNull()?.let { irConstructorSymbol -> - IrConstructorCallImpl( + IrConstructorCallImplWithShape( startOffset = UNDEFINED_OFFSET, endOffset = UNDEFINED_OFFSET, type = irConstructorSymbol.owner.returnType, symbol = irConstructorSymbol, typeArgumentsCount = irConstructorSymbol.owner.typeParameters.size, valueArgumentsCount = irConstructorSymbol.owner.valueParameters.size, - constructorTypeArgumentsCount = declaredTypeParameters.size + constructorTypeArgumentsCount = declaredTypeParameters.size, + contextParameterCount = irConstructorSymbol.owner.contextReceiverParametersCount, + hasDispatchReceiver = irConstructorSymbol.owner.dispatchReceiverParameter != null, + hasExtensionReceiver = irConstructorSymbol.owner.extensionReceiverParameter != null, ) } } @@ -178,14 +189,14 @@ class IrUtils( return super.visitFunction(declaration, data) } }, - data + data, ) as IrStatement } inline fun IrElement.filterMap( crossinline filter: (E) -> Boolean, - crossinline map: (E) -> B + crossinline map: (E) -> B, ): List { val els = arrayListOf() val visitor = @@ -247,6 +258,6 @@ private fun IrSimpleFunction.substitutedValueParameters( ?: typeParameters .firstOrNull { typeParam -> typeParam.defaultType == type } ?.let { typeParam -> call.getTypeArgument(typeParam.index) } - ?: type // Could not resolve the substituted KotlinType + ?: type // Could not resolve the substituted KotlinType ) } diff --git a/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/config/StorageComponentContainer.kt b/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/config/StorageComponentContainer.kt index 7b8e51770..1f59020a0 100644 --- a/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/config/StorageComponentContainer.kt +++ b/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/config/StorageComponentContainer.kt @@ -14,12 +14,12 @@ import org.jetbrains.kotlin.resolve.checkers.DeclarationCheckerContext interface StorageComponentContainer : ExtensionPhase { fun CompilerContext.registerModuleComponents( container: org.jetbrains.kotlin.container.StorageComponentContainer, - moduleDescriptor: ModuleDescriptor + moduleDescriptor: ModuleDescriptor, ): Unit fun CompilerContext.check( declaration: KtDeclaration, descriptor: DeclarationDescriptor, - context: DeclarationCheckerContext + context: DeclarationCheckerContext, ): Unit } diff --git a/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/resolve/DeclarationAttributeAlterer.kt b/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/resolve/DeclarationAttributeAlterer.kt index 7b2596e4a..3e03cac75 100644 --- a/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/resolve/DeclarationAttributeAlterer.kt +++ b/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/resolve/DeclarationAttributeAlterer.kt @@ -16,6 +16,6 @@ interface DeclarationAttributeAlterer : ExtensionPhase { declaration: DeclarationDescriptor?, containingDeclaration: DeclarationDescriptor?, currentModality: Modality, - isImplicitModality: Boolean + isImplicitModality: Boolean, ): Modality? } diff --git a/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/resolve/PackageProvider.kt b/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/resolve/PackageProvider.kt index a6b2af7ad..265b00145 100644 --- a/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/resolve/PackageProvider.kt +++ b/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/resolve/PackageProvider.kt @@ -21,6 +21,6 @@ interface PackageProvider : ExtensionPhase { storageManager: StorageManager, trace: BindingTrace, moduleInfo: ModuleInfo?, - lookupTracker: LookupTracker + lookupTracker: LookupTracker, ): PackageFragmentProvider? } diff --git a/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/resolve/TypeUtils.kt b/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/resolve/TypeUtils.kt index bd67a7978..4a2285d99 100644 --- a/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/resolve/TypeUtils.kt +++ b/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/resolve/TypeUtils.kt @@ -36,6 +36,6 @@ fun KotlinType.intersection(vararg other: KotlinType): KotlinType { constructor, emptyList(), false, - constructor.createScopeForKotlinType() + constructor.createScopeForKotlinType(), ) } diff --git a/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/resolve/synthetics/SyntheticResolver.kt b/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/resolve/synthetics/SyntheticResolver.kt index ab52d1978..f70d99c28 100644 --- a/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/resolve/synthetics/SyntheticResolver.kt +++ b/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/resolve/synthetics/SyntheticResolver.kt @@ -21,7 +21,7 @@ import org.jetbrains.kotlin.types.KotlinType interface SyntheticResolver : ExtensionPhase { fun CompilerContext.addSyntheticSupertypes( thisDescriptor: ClassDescriptor, - supertypes: MutableList + supertypes: MutableList, ): Unit fun CompilerContext.generateSyntheticClasses( @@ -29,7 +29,7 @@ interface SyntheticResolver : ExtensionPhase { name: Name, ctx: LazyClassContext, declarationProvider: ClassMemberDeclarationProvider, - result: MutableSet + result: MutableSet, ): Unit fun CompilerContext.generatePackageSyntheticClasses( @@ -37,7 +37,7 @@ interface SyntheticResolver : ExtensionPhase { name: Name, ctx: LazyClassContext, declarationProvider: PackageMemberDeclarationProvider, - result: MutableSet + result: MutableSet, ): Unit fun CompilerContext.generateSyntheticMethods( @@ -45,7 +45,7 @@ interface SyntheticResolver : ExtensionPhase { name: Name, bindingContext: BindingContext, fromSupertypes: List, - result: MutableCollection + result: MutableCollection, ): Unit fun CompilerContext.generateSyntheticProperties( @@ -53,7 +53,7 @@ interface SyntheticResolver : ExtensionPhase { name: Name, bindingContext: BindingContext, fromSupertypes: ArrayList, - result: MutableSet + result: MutableSet, ): Unit fun CompilerContext.getSyntheticCompanionObjectNameIfNeeded( @@ -67,6 +67,6 @@ interface SyntheticResolver : ExtensionPhase { fun CompilerContext.generateSyntheticSecondaryConstructors( thisDescriptor: ClassDescriptor, bindingContext: BindingContext, - result: MutableCollection + result: MutableCollection, ): Unit } diff --git a/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/resolve/synthetics/SyntheticScopeProvider.kt b/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/resolve/synthetics/SyntheticScopeProvider.kt index b279fc7cd..b22a13071 100644 --- a/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/resolve/synthetics/SyntheticScopeProvider.kt +++ b/libs/arrow-meta/src/main/kotlin/arrow/meta/phases/resolve/synthetics/SyntheticScopeProvider.kt @@ -19,35 +19,43 @@ interface SyntheticScopeProvider : ExtensionPhase { fun CompilerContext.syntheticConstructor( constructor: ConstructorDescriptor ): ConstructorDescriptor? + fun CompilerContext.syntheticConstructors( classifierDescriptors: Collection ): Collection + fun CompilerContext.syntheticConstructors( contributedClassifier: ClassifierDescriptor, - location: LookupLocation + location: LookupLocation, ): Collection + fun CompilerContext.syntheticExtensionProperties( receiverTypes: Collection, - location: LookupLocation + location: LookupLocation, ): Collection + fun CompilerContext.syntheticExtensionProperties( receiverTypes: Collection, name: Name, - location: LookupLocation + location: LookupLocation, ): Collection + fun CompilerContext.syntheticMemberFunctions( receiverTypes: Collection ): Collection + fun CompilerContext.syntheticMemberFunctions( receiverTypes: Collection, name: Name, - location: LookupLocation + location: LookupLocation, ): Collection + fun CompilerContext.syntheticStaticFunctions( functionDescriptors: Collection ): Collection + fun CompilerContext.syntheticStaticFunctions( contributedFunctions: Collection, - location: LookupLocation + location: LookupLocation, ): Collection } diff --git a/libs/arrow-meta/src/test/kotlin/arrow/meta/ir/plugin/IrSyntaxPlugin.kt b/libs/arrow-meta/src/test/kotlin/arrow/meta/ir/plugin/IrSyntaxPlugin.kt index c108da23d..828e88d4d 100644 --- a/libs/arrow-meta/src/test/kotlin/arrow/meta/ir/plugin/IrSyntaxPlugin.kt +++ b/libs/arrow-meta/src/test/kotlin/arrow/meta/ir/plugin/IrSyntaxPlugin.kt @@ -159,7 +159,7 @@ open class IrSyntaxPlugin : Meta() { irDynamicMemberExpression(irVisit(IrDynamicMemberExpression::class.java)), irErrorDeclaration(irVisit(IrErrorDeclaration::class.java)), irErrorExpression(irVisit(IrErrorExpression::class.java)), - irErrorCallExpression(irVisit(IrErrorCallExpression::class.java)) + irErrorCallExpression(irVisit(IrErrorCallExpression::class.java)), ) } ) diff --git a/libs/arrow-meta/src/test/kotlin/arrow/meta/ir/syntax/IrSyntaxTest.kt b/libs/arrow-meta/src/test/kotlin/arrow/meta/ir/syntax/IrSyntaxTest.kt index d7256dc2b..df1376c21 100644 --- a/libs/arrow-meta/src/test/kotlin/arrow/meta/ir/syntax/IrSyntaxTest.kt +++ b/libs/arrow-meta/src/test/kotlin/arrow/meta/ir/syntax/IrSyntaxTest.kt @@ -193,7 +193,7 @@ class IrSyntaxTest { } } """ - .trimIndent() + .trimIndent(), ) } } @@ -205,6 +205,6 @@ private fun testIrVisit(elements: List>, src: Strin CompilerTest( config = { metaDependencies + addMetaPlugins(IrSyntaxPlugin()) }, code = { src.source }, - assert = { allOf(elements.map { element -> failsWith { it.contains(visits(element)) } }) } + assert = { allOf(elements.map { element -> failsWith { it.contains(visits(element)) } }) }, ) ) diff --git a/libs/gradle-plugin-commons/src/main/kotlin/arrow/meta/plugin/gradle/ArrowMetaGradlePlugin.kt b/libs/gradle-plugin-commons/src/main/kotlin/arrow/meta/plugin/gradle/ArrowMetaGradlePlugin.kt index c2bc441f1..c380b1154 100644 --- a/libs/gradle-plugin-commons/src/main/kotlin/arrow/meta/plugin/gradle/ArrowMetaGradlePlugin.kt +++ b/libs/gradle-plugin-commons/src/main/kotlin/arrow/meta/plugin/gradle/ArrowMetaGradlePlugin.kt @@ -83,12 +83,12 @@ public interface ArrowMetaGradlePlugin : KotlinCompilerPluginSupportPlugin { SubpluginOption( key = "generatedSrcOutputDir", value = - "${extension.generatedSrcOutputDir.get()}/${kotlinCompilation.defaultSourceSet.name}/kotlin" + "${extension.generatedSrcOutputDir.get()}/${kotlinCompilation.defaultSourceSet.name}/kotlin", ), SubpluginOption( key = "baseDir", - value = kotlinCompilation.target.project.rootProject.rootDir.path - ) + value = kotlinCompilation.target.project.rootProject.rootDir.path, + ), ) } } diff --git a/libs/meta-test/src/main/kotlin/arrow/meta/plugin/testing/Compilation.kt b/libs/meta-test/src/main/kotlin/arrow/meta/plugin/testing/Compilation.kt index c07f61b4d..ca3463d44 100644 --- a/libs/meta-test/src/main/kotlin/arrow/meta/plugin/testing/Compilation.kt +++ b/libs/meta-test/src/main/kotlin/arrow/meta/plugin/testing/Compilation.kt @@ -29,7 +29,7 @@ internal fun compile(data: CompilationData): CompilationResult { return createKotlinCompilation(data) .apply { sources = compilation.sources + compilation.kspGeneratedSourceFiles - symbolProcessorProviders = emptyList() + symbolProcessorProviders = mutableListOf() } .compile() } @@ -59,7 +59,7 @@ private fun createKotlinCompilation(data: CompilationData) = } kotlincArguments = data.arguments commandLineProcessors = data.commandLineProcessors - symbolProcessorProviders = data.symbolProcessors + symbolProcessorProviders = data.symbolProcessors.toMutableList() pluginOptions = data.pluginOptions.map { PluginOption(it.pluginId, it.key, it.value) } } @@ -70,7 +70,7 @@ private val KotlinCompilation.kspGeneratedSourceFiles: List .resolve("kotlin") .walk() .filter { it.isFile } - .map { SourceFile.fromPath(it.absoluteFile) } + .map { SourceFile.new(it.absoluteFile.name, it.absoluteFile.readText()) } .toList() private fun obtainTarget(data: CompilationData): String = diff --git a/libs/meta-test/src/main/kotlin/arrow/meta/plugin/testing/CompilationAssertions.kt b/libs/meta-test/src/main/kotlin/arrow/meta/plugin/testing/CompilationAssertions.kt index aa28bd86b..28b2128bf 100644 --- a/libs/meta-test/src/main/kotlin/arrow/meta/plugin/testing/CompilationAssertions.kt +++ b/libs/meta-test/src/main/kotlin/arrow/meta/plugin/testing/CompilationAssertions.kt @@ -113,7 +113,7 @@ private val interpreter: (CompilerTest) -> Unit = { compilationResult, singleAssert.source, singleAssert.output, - singleAssert.onError + singleAssert.onError, ) else -> TODO() } @@ -164,7 +164,7 @@ private fun assertEvalsTo( compilationResult: CompilationResult, source: Code.Source, output: Any?, - onError: (Throwable) -> Any? + onError: (Throwable) -> Any?, ) { assertCompiles(compilationResult) val className = source.filename.replace(".kt", "Kt") @@ -235,7 +235,7 @@ private fun eval( className: String, expression: String, classesDirectory: File, - onError: (Throwable) -> Any? + onError: (Throwable) -> Any?, ): Any? { val classLoader = URLClassLoader(arrayOf(classesDirectory.toURI().toURL())) val fullClassName = getFullClassName(classesDirectory, className) diff --git a/libs/meta-test/src/main/kotlin/arrow/meta/plugin/testing/CompilationData.kt b/libs/meta-test/src/main/kotlin/arrow/meta/plugin/testing/CompilationData.kt index a32fb36b2..94c33ddd2 100644 --- a/libs/meta-test/src/main/kotlin/arrow/meta/plugin/testing/CompilationData.kt +++ b/libs/meta-test/src/main/kotlin/arrow/meta/plugin/testing/CompilationData.kt @@ -19,7 +19,7 @@ internal data class CompilationData( val commandLineProcessors: List = emptyList(), val symbolProcessors: List = emptyList(), val pluginOptions: List = emptyList(), - val targetVersion: String? = null + val targetVersion: String? = null, ) { operator fun plus(other: CompilationData): CompilationData = @@ -32,7 +32,7 @@ internal data class CompilationData( commandLineProcessors = commandLineProcessors + other.commandLineProcessors, symbolProcessors = symbolProcessors + other.symbolProcessors, pluginOptions = pluginOptions + other.pluginOptions, - targetVersion = targetVersion ?: other.targetVersion + targetVersion = targetVersion ?: other.targetVersion, ) companion object { diff --git a/libs/meta-test/src/main/kotlin/arrow/meta/plugin/testing/CompilerTestDSL.kt b/libs/meta-test/src/main/kotlin/arrow/meta/plugin/testing/CompilerTestDSL.kt index 2ca8ac3fc..5c3fa5a9b 100644 --- a/libs/meta-test/src/main/kotlin/arrow/meta/plugin/testing/CompilerTestDSL.kt +++ b/libs/meta-test/src/main/kotlin/arrow/meta/plugin/testing/CompilerTestDSL.kt @@ -17,7 +17,7 @@ data class CompilerPlugin( val name: String, /** List of necessary dependencies to use that plugin during the compilation. */ - val dependencies: List + val dependencies: List, ) internal typealias CompilerTestInterpreter = (CompilerTest) -> Unit @@ -46,7 +46,7 @@ data class CompilerTest( * * @see [AssertSyntax] */ - val assert: Companion.() -> Assert + val assert: Companion.() -> Assert, ) { internal fun run(interpret: CompilerTestInterpreter): Unit = interpret(this) @@ -115,16 +115,24 @@ interface ConfigSyntax { /** Represents the different types of [Config] which will be managed. */ sealed class Config { internal data class AddCompilerPlugins(val plugins: List) : Config() + internal data class AddMetaPlugins(val plugins: List) : Config() + internal data class AddDependencies(val dependencies: List) : Config() + internal data class AddArguments(val arguments: List) : Config() + internal data class AddCommandLineProcessors( val commandLineProcessors: List ) : Config() + internal data class AddPluginOptions(val pluginOptions: List) : Config() + internal data class AddSymbolProcessors(val symbolProcessors: List) : Config() + internal data class Many(val configs: List) : Config() + internal object Empty : Config() internal companion object : ConfigSyntax { @@ -153,7 +161,7 @@ sealed class Code { /** Necessary filename to identify different code snippets. */ val filename: String = DEFAULT_FILENAME, /** Content of code snippet. */ - val text: String + val text: String, ) : Code() /** It's possible to provide one or several sources to be compiled */ @@ -212,7 +220,7 @@ interface AssertSyntax { */ fun Code.Source.evalsTo( value: Any?, - onError: (Throwable) -> Any? = { throw it } + onError: (Throwable) -> Any? = { throw it }, ): Assert.SingleAssert = Assert.EvalsTo(this, value, onError) /** Returns a Source object from a String. */ @@ -234,17 +242,22 @@ interface AssertSyntax { sealed class Assert { abstract class SingleAssert : Assert() + internal data class Many(val asserts: List) : Assert() internal data class EvalsTo( val source: Code.Source, val output: Any?, - val onError: (Throwable) -> Any? + val onError: (Throwable) -> Any?, ) : SingleAssert() + internal data class FailsWith(val f: (String) -> Boolean) : SingleAssert() + internal data class CompilesWith(val f: (String) -> Boolean) : SingleAssert() + internal sealed class CompilationResult : SingleAssert() { object Compiles : CompilationResult() + object Fails : CompilationResult() } diff --git a/libs/meta-test/src/test/kotlin/arrow/meta/plugin/testing/ExampleCommandLineProcessor.kt b/libs/meta-test/src/test/kotlin/arrow/meta/plugin/testing/ExampleCommandLineProcessor.kt index e04e7dea1..d244ca450 100644 --- a/libs/meta-test/src/test/kotlin/arrow/meta/plugin/testing/ExampleCommandLineProcessor.kt +++ b/libs/meta-test/src/test/kotlin/arrow/meta/plugin/testing/ExampleCommandLineProcessor.kt @@ -14,7 +14,7 @@ class ExampleCommandLineProcessor : CommandLineProcessor { "", description = "example", required = false, - allowMultipleOccurrences = false + allowMultipleOccurrences = false, ) } diff --git a/libs/meta-test/src/test/kotlin/arrow/meta/plugin/testing/ExampleTest.kt b/libs/meta-test/src/test/kotlin/arrow/meta/plugin/testing/ExampleTest.kt index 0eef89d42..07e390991 100755 --- a/libs/meta-test/src/test/kotlin/arrow/meta/plugin/testing/ExampleTest.kt +++ b/libs/meta-test/src/test/kotlin/arrow/meta/plugin/testing/ExampleTest.kt @@ -19,7 +19,7 @@ class ExampleTest { """ .source }, - assert = { compiles } + assert = { compiles }, ) ) } @@ -36,7 +36,7 @@ class ExampleTest { """ .source }, - assert = { "hello()".source.evalsTo("Hello world!") } + assert = { "hello()".source.evalsTo("Hello world!") }, ) ) } @@ -55,7 +55,7 @@ class ExampleTest { """ .source }, - assert = { "hello()".source.evalsTo("Hello world!") } + assert = { "hello()".source.evalsTo("Hello world!") }, ) ) } @@ -71,7 +71,7 @@ class ExampleTest { """ .source }, - assert = { fails } + assert = { fails }, ) ) } @@ -87,7 +87,7 @@ class ExampleTest { """ .source }, - assert = { failsWith { it.contains("Expecting a top level declaration") } } + assert = { failsWith { it.contains("Expecting a top level declaration") } }, ) ) } @@ -104,7 +104,7 @@ class ExampleTest { """ .source }, - assert = { "x".source.evalsTo("Hello world!") } + assert = { "x".source.evalsTo("Hello world!") }, ) ) } @@ -122,7 +122,7 @@ class ExampleTest { """ .source }, - assert = { "x".source.evalsTo("Hello world!") } + assert = { "x".source.evalsTo("Hello world!") }, ) ) } @@ -140,7 +140,7 @@ class ExampleTest { | | val x: String = "hello world!" | - """ + """, ), Source( filename = "UpperCase.kt", @@ -149,16 +149,16 @@ class ExampleTest { | | val y: String = "HELLO WORLD!" | - """ - ) + """, + ), ) }, assert = { allOf( Source(filename = "LowerCaseKt", text = "x").evalsTo("hello world!"), - Source(filename = "UpperCaseKt", text = "y").evalsTo("HELLO WORLD!") + Source(filename = "UpperCaseKt", text = "y").evalsTo("HELLO WORLD!"), ) - } + }, ) ) } @@ -180,10 +180,10 @@ class ExampleTest { | val y: String = "HELLO WORLD!" | """ - .source + .source, ) }, - assert = { compiles } + assert = { compiles }, ) ) } @@ -201,7 +201,7 @@ class ExampleTest { """ .source }, - assert = { compiles } + assert = { compiles }, ) ) } @@ -217,9 +217,9 @@ class ExampleTest { PluginOption( ExampleCommandLineProcessor().pluginId, ExampleCommandLineProcessor.CLI_OPTION.optionName, - "value" + "value", ) - ) + ), ) }, code = { @@ -230,7 +230,7 @@ class ExampleTest { """ .source }, - assert = { compiles } + assert = { compiles }, ) ) } @@ -252,7 +252,7 @@ class ExampleTest { failsWith { it.contains("Unsupported plugin option") && it.contains("plugin.id:key=value") } - } + }, ) ) } @@ -266,7 +266,7 @@ class ExampleTest { addCommandLineProcessors(ExampleCommandLineProcessor()), addPluginOptions( PluginOption(ExampleCommandLineProcessor().pluginId, "wrongKey", "value") - ) + ), ) }, code = { @@ -282,7 +282,7 @@ class ExampleTest { it.contains("Unsupported plugin option") && it.contains("${ExampleCommandLineProcessor().pluginId}:wrongKey=value") } - } + }, ) ) }