Skip to content

Commit c5c6b91

Browse files
committed
Update sample for KT-53993 with Kotlin v1.9.21
1 parent 3be5484 commit c5c6b91

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

buildSrc/src/main/kotlin/IProject.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ object IProject : ProjectDetail() {
99
const val DESCRIPTION = "Generate platform-compatible functions for Kotlin suspend functions"
1010
const val HOMEPAGE = "https://github.com/ForteScarlet/kotlin-suspend-transform-compiler-plugin"
1111

12-
override val version: Version = version(0, 5, 1) - version("local-test-2")
12+
override val version: Version = version(0, 5, 1) - version("local-test-3")
1313

1414
override val homepage: String get() = HOMEPAGE
1515

compiler/suspend-transform-plugin/src/main/kotlin/love/forte/plugin/suspendtrans/utils/IrFunctionUtils.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ fun IrPluginContext.createSuspendLambdaFunctionWithCoroutineScope(
165165
see https://youtrack.jetbrains.com/issue/KT-53993/IR-kotlin.NotImplementedError-An-operation-is-not-implemented-IrClassImpl-is-not-supported-yet-here#focus=Comments-27-8622204.0-0
166166
*/
167167

168-
isFun = true
169-
//isInner = true
168+
// isFun = true
169+
isInner = true
170170
visibility = DescriptorVisibilities.LOCAL
171171
}.apply clazz@{
172172
this.parent = parent

suspend-transform-plugin-sample-js/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ buildscript {
1111
mavenCentral()
1212
}
1313
dependencies {
14-
classpath("love.forte.plugin.suspend-transform:suspend-transform-plugin-gradle:0.5.1-local-test-2")
14+
classpath("love.forte.plugin.suspend-transform:suspend-transform-plugin-gradle:0.5.1-local-test-3")
1515
}
1616
}
1717

suspend-transform-plugin-sample-js/src/main/kotlin/Main.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
import kotlinx.coroutines.CoroutineScope
2-
import kotlinx.coroutines.await
32
import kotlinx.coroutines.delay
43
import kotlinx.coroutines.promise
54
import kotlin.coroutines.EmptyCoroutineContext
65
import kotlin.js.Promise
76

87
suspend fun main() {
9-
runInAsync(block = SuspendFun()).await()
8+
// runInAsync(block = SuspendFun()).await()
9+
println(ForteScarlet().stringToInt("1"))
10+
println(ForteScarlet().stringToIntAsync("1"))
1011
}
1112

1213
private val scope = CoroutineScope(EmptyCoroutineContext)
1314

1415
fun <T> runInAsync(block: suspend () -> T): Promise<T> {
15-
return scope.promise { block() }
16+
val b1 = block::invoke
17+
return scope.promise { b1() }
1618
}
1719

1820
class SuspendFun : (suspend () -> String) {

0 commit comments

Comments
 (0)