Skip to content

kotlin-metadata class properties are always sorted alphabetically rather than in order of declaration #965

Open
@dimsuz

Description

Having this class

data class Person(
  val firstName: String,
  val lastName: String,
  val age: String,
  val address: String,
  val phoneNumbers: List<String>,
  val friends: Map<String, String>
)

and calling

Person::class.toImmutableKmClass().properties.map { it.name }

produces:

[address, age, firstName, friends, lastName, phoneNumbers]

Is it possible to iterate them in order of declaration?
Not sure if this is a kotlin-metadata or kotlinpoet issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions