Skip to content

readonly field in companion object with @JvmField doesn't in outer class in javadoc even with kotlin-as-java #2086

@anatawa12

Description

@anatawa12

Describe the bug
A clear and concise description of what the bug is

With this class, the field should exist in Class with public static final but exists in Class.Companion with getClass() function.

class Class {
  companion object {
    /** Doc */
    @JvmField
    val field = "value"
  }
}

Expected behaviour
A clear and concise description of what you expected to happen

field should exist in Class with public static final.

Screenshots
If applicable, add screenshots to help explain your problem

image
image

To Reproduce
Steps to reproduce the behavior, ideally with an example project

Dokka configuration
Configuration of dokka used to reproduce the bug

tasks.withType(AbstractDokkaLeafTask::class).all {
    moduleName.set("class-ast tree")
    dependencies {
        plugins("org.jetbrains.dokka:kotlin-as-java-plugin:1.5.0")
    }
    dokkaSourceSets["main"].includes.from("kdoc.md")
}

Installation

  • Operating system: macOS
  • Build tool: Gradle v7.1
  • Dokka version: 1.5.0

Additional context
Add any other context about the problem here

Are you willing to provide a PR?
Providing a PR can drastically speed up the process of fixing this bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugplugin: kotlin-as-javaAn issue/PR related to Dokka's kotlin-as-java plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions