Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

Commit ebd56df

Browse files
committed
Update to Kotlin 1.6.0
1 parent 1f67ead commit ebd56df

File tree

6 files changed

+14
-11
lines changed

6 files changed

+14
-11
lines changed

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
kotlin("jvm") version "1.5.20" apply false
2+
kotlin("jvm") version "1.6.0" apply false
33
id("org.jetbrains.dokka") version "0.10.0" apply false
44
id("com.gradle.plugin-publish") version "0.11.0" apply false
55
id("com.github.gmazzo.buildconfig") version "2.0.2" apply false

kotlin-power-assert-plugin-native/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ plugins {
1212
dependencies {
1313
compileOnly("org.jetbrains.kotlin:kotlin-compiler")
1414

15-
kapt("com.google.auto.service:auto-service:1.0-rc6")
16-
compileOnly("com.google.auto.service:auto-service-annotations:1.0-rc6")
15+
kapt("com.google.auto.service:auto-service:1.0.1")
16+
compileOnly("com.google.auto.service:auto-service-annotations:1.0.1")
1717
}
1818

1919
tasks.named("compileKotlin") { dependsOn("syncSource") }

kotlin-power-assert-plugin/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ plugins {
1212
dependencies {
1313
compileOnly("org.jetbrains.kotlin:kotlin-compiler-embeddable")
1414

15-
kapt("com.google.auto.service:auto-service:1.0-rc6")
16-
compileOnly("com.google.auto.service:auto-service-annotations:1.0-rc6")
15+
kapt("com.google.auto.service:auto-service:1.0.1")
16+
compileOnly("com.google.auto.service:auto-service-annotations:1.0.1")
1717

1818
testImplementation(kotlin("test-junit"))
1919
testImplementation("org.jetbrains.kotlin:kotlin-compiler-embeddable")
20-
testImplementation("com.github.tschuchortdev:kotlin-compile-testing:1.2.6")
20+
testImplementation("com.github.tschuchortdev:kotlin-compile-testing:1.4.6")
2121
}
2222

2323
tasks.withType<KotlinCompile> {

kotlin-power-assert-plugin/src/main/kotlin/com/bnorm/power/PowerAssertCallTransformer.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ import org.jetbrains.kotlin.ir.types.IrSimpleType
5252
import org.jetbrains.kotlin.ir.types.IrType
5353
import org.jetbrains.kotlin.ir.types.IrTypeArgument
5454
import org.jetbrains.kotlin.ir.types.IrTypeProjection
55+
import org.jetbrains.kotlin.ir.types.IrTypeSystemContextImpl
5556
import org.jetbrains.kotlin.ir.types.classifierOrNull
5657
import org.jetbrains.kotlin.ir.types.isBoolean
5758
import org.jetbrains.kotlin.ir.types.isSubtypeOf
@@ -68,6 +69,8 @@ class PowerAssertCallTransformer(
6869
private val messageCollector: MessageCollector,
6970
private val functions: Set<FqName>
7071
) : IrElementTransformerVoidWithContext() {
72+
private val irTypeSystemContext = IrTypeSystemContextImpl(context.irBuiltIns)
73+
7174
override fun visitCall(expression: IrCall): IrExpression {
7275
val function = expression.symbol.owner
7376
val fqName = function.kotlinFqName
@@ -200,12 +203,12 @@ class PowerAssertCallTransformer(
200203
argument is IrTypeProjection && isStringSupertype(argument.type)
201204

202205
private fun isStringSupertype(type: IrType): Boolean =
203-
context.irBuiltIns.stringType.isSubtypeOf(type, context.irBuiltIns)
206+
context.irBuiltIns.stringType.isSubtypeOf(type, irTypeSystemContext)
204207

205208
private fun IrType.isAssignableTo(type: IrType): Boolean {
206-
if (isSubtypeOf(type, context.irBuiltIns)) return true
209+
if (isSubtypeOf(type, irTypeSystemContext)) return true
207210
val superTypes = (type.classifierOrNull as? IrTypeParameterSymbol)?.owner?.superTypes
208-
return superTypes != null && superTypes.all { isSubtypeOf(it, context.irBuiltIns) }
211+
return superTypes != null && superTypes.all { isSubtypeOf(it, irTypeSystemContext) }
209212
}
210213

211214
private fun MessageCollector.info(expression: IrElement, message: String) {

kotlin-power-assert-plugin/src/main/kotlin/com/bnorm/power/diagram/IrDiagram.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package com.bnorm.power.diagram
1818

1919
import com.bnorm.power.irString
20+
import org.jetbrains.kotlin.ir.IrBuiltIns
2021
import org.jetbrains.kotlin.ir.IrElement
2122
import org.jetbrains.kotlin.ir.SourceRangeInfo
2223
import org.jetbrains.kotlin.ir.builders.IrBuilderWithScope
@@ -25,7 +26,6 @@ import org.jetbrains.kotlin.ir.builders.irGet
2526
import org.jetbrains.kotlin.ir.declarations.IrFile
2627
import org.jetbrains.kotlin.ir.declarations.IrSimpleFunction
2728
import org.jetbrains.kotlin.ir.declarations.IrVariable
28-
import org.jetbrains.kotlin.ir.descriptors.IrBuiltIns
2929
import org.jetbrains.kotlin.ir.expressions.IrConst
3030
import org.jetbrains.kotlin.ir.expressions.IrConstKind
3131
import org.jetbrains.kotlin.ir.expressions.IrExpression

sample/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
kotlin("multiplatform") version "1.5.20"
2+
kotlin("multiplatform") version "1.6.0"
33
id("com.bnorm.power.kotlin-power-assert") version "0.10.0"
44
}
55

0 commit comments

Comments
 (0)