cloud-kotlin-coroutines-annotations fails on Kotlin 2.4.0 with @Flag param

Đang mở
#810 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Ít trao đổi
Công nghệ
kotlin
Lĩnh vực
cli

Hướng nghiên cứu

Bắt đầu với mục nhập stack trace tại KotlinAnnotatedMethods.kt:316 và tái hiện phần khai báo lệnh bằng Kotlin 2.3.20 và 2.4.0, so sánh với Kotlin 2.3.10. Hoàn tất khi lệnh suspend có tham số @Flag thực thi mà không gặp NoSuchFieldError.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

This happens on executing the command:

java.lang.NoSuchFieldError: Class kotlin.reflect.KParameter$Kind does not have member field 'kotlin.reflect.KParameter$Kind CONTEXT'
        at kotlin.reflect.jvm.internal.ReflectKCallableKt.computeAbsentArguments(ReflectKCallable.kt:96) ~[?:?]
        at kotlin.reflect.jvm.internal.ReflectKCallableImpl$_absentArguments$1.invoke(ReflectKCallableImpl.kt:13) ~[?:?]
        at kotlin.reflect.jvm.internal.ReflectKCallableImpl$_absentArguments$1.invoke(ReflectKCallableImpl.kt:13) ~[?:?]
        at kotlin.reflect.jvm.internal.ReflectProperties$LazySoftVal.invoke(ReflectProperties.java:70) ~[?:?]
        at kotlin.reflect.jvm.internal.ReflectKCallableImpl.getAbsentArguments(ReflectKCallableImpl.kt:15) ~[?:?]
        at kotlin.reflect.jvm.internal.ReflectKCallableKt.callDefaultMethod(ReflectKCallable.kt:133) ~[?:?]
        at kotlin.reflect.jvm.internal.ReflectKCallableImpl.default$callBy(ReflectKCallableImpl.kt:70) ~[?:?]
        at kotlin.reflect.jvm.internal.ReflectKCallableImpl.callBy(ReflectKCallableImpl.kt:10) ~[?:?]
        at kotlin.reflect.full.KCallables.callSuspendBy(KCallables.kt:79) ~[?:?]
        at org.incendo.cloud.kotlin.coroutines.annotations.KotlinAnnotatedMethodsKt$executeSuspendFunction$3.invokeSuspend(KotlinAnnotatedMethods.kt:316) ~[?:?]
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) ~[?:?]
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100) ~[?:?]
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:586) ~[?:?]
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:829) ~[?:?]
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:717) ~[?:?]
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:704) ~[?:?]

Command declaration:

@Command("vnetwork trafficMonitor enable")
@ShortPerm("trafficMonitor")
fun enable(sender: User, @Flag("unit") unit: Unit = Unit.BIT) {
}

Kotlin compiler options:

    kotlin {
        compilerOptions {
            jvmTarget.value(JvmTarget.fromTarget(javaVer.toString())) // JavaVersion.VERSION_11
            // Remove Intrinsics checks
            freeCompilerArgs.add("-Xno-call-assertions")
            freeCompilerArgs.add("-Xno-receiver-assertions")
            freeCompilerArgs.add("-Xno-param-assertions")
            freeCompilerArgs.add("-java-parameters") // Fix cloud-annotations
        }
    }

This occurs on Kotlin 2.3.20 too, not a bug on Kotlin 2.3.10

Ngôn ngữ chính
Java
Star
546
Fork
61
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Incendo/cloud

Tất cả issue của Incendo/cloud

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.