dokka icon indicating copy to clipboard operation
dokka copied to clipboard

[K2] Properties inherited from Java fields/synthetic properties with types that can be nullable shown as nullable

Open atyrin opened this issue 1 year ago • 1 comments

// Java:
public class Parent {
    public String parentField;
}

// Kotlin:
class Child: Parent()

In K1 the parentField on Child page shown as a String image

In K2 in it String? image

Probably it is a good practice to consider Java code as nullable, but formally it is not a correct type.

NB: on Parent page Dokka shows a non-nullable type String

  • Dokka version: 2.0.0

atyrin avatar Jul 05 '24 15:07 atyrin

Although types from Java are flexible-nullable in Kotlin, Dokka does not support such types—String! (at least for Documentable). Currently, the nullable String? seems to be a more accurate way to present these types than just String in K1.

vmishenev avatar Aug 23 '24 15:08 vmishenev