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

Ouverte
#810 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
48/100
Type d'issue
Bug
Clarté
À clarifier
Activité
Calme
Stack technique
kotlin
Domaine
cli

Piste de recherche

Commencez par l’entrée de la trace de pile dans KotlinAnnotatedMethods.kt:316 et reproduisez la déclaration de commande avec Kotlin 2.3.20 et 2.4.0, en la comparant à Kotlin 2.3.10. La tâche est terminée lorsque la commande suspend avec le paramètre @Flag s’exécute sans le NoSuchFieldError.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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

Langage dominant
Java
Étoiles
546
Forks
61
Métriques de merge des PR
Aucune PR mergée en 30 j

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de Incendo/cloud

Toutes les issues de Incendo/cloud

Issues similaires

Plus d'issues Java

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.