Skip to content
This repository was archived by the owner on Nov 9, 2026. It is now read-only.
This repository was archived by the owner on Nov 9, 2026. It is now read-only.

Kotlin @JvmField internal fields not being removed #954

Closed

Description

@jpobst

Context: https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/jvm/src/scheduling/Tasks.kt

When binding org.jetbrains.kotlinx.kotlinx-coroutines-core-jvm, the following Kotlin-internal fields are not being marked as private in the Java API.

  • /api/package[@name='kotlinx.coroutines.scheduling']/class[@name='TasksKt']/field[@name='BlockingContext']
  • /api/package[@name='kotlinx.coroutines.scheduling']/class[@name='TasksKt']/field[@name='NonBlockingContext']

This causes an issue because their type is a Kotlin-internal interface which is being removed from the Java API.

Activity

  1. added
    bug
    generator
    on Feb 22, 2022
  2. added this to the 7.0.0 milestone on May 12, 2022
  3. jpobst commented on Jul 5, 2022

    @jpobst
    ContributorAuthor

    Internal fields actually are correctly marked as private by Kotlin and thus we do not bind them:

    internal val city: String = "London"

    The issue here is that these internal fields are marked with @JvmField. This instructs Kotlin to make them public so they can be called by Java.

    @JvmField internal val city: String = "London"

    We are not checking for internal in the Kotlin field metadata.

  4. changed the title [-]Kotlin internal fields not being removed[/-] [+]Kotlin @JvmField internal fields not being removed[/+] on Jul 5, 2022
  5. locked and limited conversation to collaborators on Apr 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggenerator

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions