Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[K2] Java synthetic properties in Kotlin inheritor class shown with open modifier #3669

Open
atyrin opened this issue Jul 4, 2024 · 1 comment
Labels
bug language: Java Issue/PR related to the Java language feature/analysis/docs topic: K2 Issues / PRs that are related to the K2 migration. See #2888

Comments

@atyrin
Copy link
Contributor

atyrin commented Jul 4, 2024

Create a Java class with a field with getter/setter that will be represented in Kotlin as one property.

public class JavaParent {
    private String foo;

    public String getFoo() {
        return foo;
    }

    public void setFoo(String foo) {
        this.foo = foo;
    }
}

Create a Kotlin class that will inherit the Java class

class Child: JavaParent()

For K1 Kotlin classes will looks like (no open modifier for foo):
image

For K2 it shown the modifier:
image

  1. The open doesn't have any effect in the final class ([NON_FINAL_MEMBER_IN_FINAL_CLASS])
  2. If we will make Child an open class then anyway we cannot override it in a child class of Child. ([NOTHING_TO_OVERRIDE])
  • Dokka version: 2.0.0
@atyrin atyrin added bug topic: K2 Issues / PRs that are related to the K2 migration. See #2888 labels Jul 4, 2024
@vmishenev
Copy link
Member

Related issue: #3611

@vmishenev vmishenev added the language: Java Issue/PR related to the Java language feature/analysis/docs label Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug language: Java Issue/PR related to the Java language feature/analysis/docs topic: K2 Issues / PRs that are related to the K2 migration. See #2888
Projects
None yet
Development

No branches or pull requests

2 participants