Merge pull request #51 from bnorm/kotlin-1.6.0

Update to Kotlin 1.6.0
This commit is contained in:
Brian Norman
2021-11-18 21:32:09 -06:00
committed by GitHub
6 changed files with 14 additions and 11 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
plugins {
kotlin("jvm") version "1.5.20" apply false
kotlin("jvm") version "1.6.0" apply false
id("org.jetbrains.dokka") version "0.10.0" apply false
id("com.gradle.plugin-publish") version "0.11.0" apply false
id("com.github.gmazzo.buildconfig") version "2.0.2" apply false
@@ -12,8 +12,8 @@ plugins {
dependencies {
compileOnly("org.jetbrains.kotlin:kotlin-compiler")
kapt("com.google.auto.service:auto-service:1.0-rc6")
compileOnly("com.google.auto.service:auto-service-annotations:1.0-rc6")
kapt("com.google.auto.service:auto-service:1.0.1")
compileOnly("com.google.auto.service:auto-service-annotations:1.0.1")
}
tasks.named("compileKotlin") { dependsOn("syncSource") }
+3 -3
View File
@@ -12,12 +12,12 @@ plugins {
dependencies {
compileOnly("org.jetbrains.kotlin:kotlin-compiler-embeddable")
kapt("com.google.auto.service:auto-service:1.0-rc6")
compileOnly("com.google.auto.service:auto-service-annotations:1.0-rc6")
kapt("com.google.auto.service:auto-service:1.0.1")
compileOnly("com.google.auto.service:auto-service-annotations:1.0.1")
testImplementation(kotlin("test-junit"))
testImplementation("org.jetbrains.kotlin:kotlin-compiler-embeddable")
testImplementation("com.github.tschuchortdev:kotlin-compile-testing:1.2.6")
testImplementation("com.github.tschuchortdev:kotlin-compile-testing:1.4.6")
}
tasks.withType<KotlinCompile> {
@@ -52,6 +52,7 @@ import org.jetbrains.kotlin.ir.types.IrSimpleType
import org.jetbrains.kotlin.ir.types.IrType
import org.jetbrains.kotlin.ir.types.IrTypeArgument
import org.jetbrains.kotlin.ir.types.IrTypeProjection
import org.jetbrains.kotlin.ir.types.IrTypeSystemContextImpl
import org.jetbrains.kotlin.ir.types.classifierOrNull
import org.jetbrains.kotlin.ir.types.isBoolean
import org.jetbrains.kotlin.ir.types.isSubtypeOf
@@ -68,6 +69,8 @@ class PowerAssertCallTransformer(
private val messageCollector: MessageCollector,
private val functions: Set<FqName>
) : IrElementTransformerVoidWithContext() {
private val irTypeSystemContext = IrTypeSystemContextImpl(context.irBuiltIns)
override fun visitCall(expression: IrCall): IrExpression {
val function = expression.symbol.owner
val fqName = function.kotlinFqName
@@ -200,12 +203,12 @@ class PowerAssertCallTransformer(
argument is IrTypeProjection && isStringSupertype(argument.type)
private fun isStringSupertype(type: IrType): Boolean =
context.irBuiltIns.stringType.isSubtypeOf(type, context.irBuiltIns)
context.irBuiltIns.stringType.isSubtypeOf(type, irTypeSystemContext)
private fun IrType.isAssignableTo(type: IrType): Boolean {
if (isSubtypeOf(type, context.irBuiltIns)) return true
if (isSubtypeOf(type, irTypeSystemContext)) return true
val superTypes = (type.classifierOrNull as? IrTypeParameterSymbol)?.owner?.superTypes
return superTypes != null && superTypes.all { isSubtypeOf(it, context.irBuiltIns) }
return superTypes != null && superTypes.all { isSubtypeOf(it, irTypeSystemContext) }
}
private fun MessageCollector.info(expression: IrElement, message: String) {
@@ -17,6 +17,7 @@
package com.bnorm.power.diagram
import com.bnorm.power.irString
import org.jetbrains.kotlin.ir.IrBuiltIns
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.SourceRangeInfo
import org.jetbrains.kotlin.ir.builders.IrBuilderWithScope
@@ -25,7 +26,6 @@ import org.jetbrains.kotlin.ir.builders.irGet
import org.jetbrains.kotlin.ir.declarations.IrFile
import org.jetbrains.kotlin.ir.declarations.IrSimpleFunction
import org.jetbrains.kotlin.ir.declarations.IrVariable
import org.jetbrains.kotlin.ir.descriptors.IrBuiltIns
import org.jetbrains.kotlin.ir.expressions.IrConst
import org.jetbrains.kotlin.ir.expressions.IrConstKind
import org.jetbrains.kotlin.ir.expressions.IrExpression
+1 -1
View File
@@ -1,5 +1,5 @@
plugins {
kotlin("multiplatform") version "1.5.20"
kotlin("multiplatform") version "1.6.0"
id("com.bnorm.power.kotlin-power-assert") version "0.10.0"
}