Skip to content

Public copy() with private constructor deprecated in Kotlin #1044

@Robotgiggle

Description

@Robotgiggle

Minecraft version

1.20.1

Hex Casting version

PR #1043

Issue description

The new version of Kotlin used in the PR above gives a compilation warning whenever a data class has a public copy() method but a private constructor. In future versions of Kotlin this feature will be removed and the copy() method on data classes will always have the same visibility as the constructor.

The warnings can be suppressed using this annotation, but that doesn't fix the underlying issue. A proper fix would be to either replace all usage of the auto-generated copy() method with our own custom method, or to change the affected classes to not be data classes and then manually implement whatever auto-generated data class methods we need.

More info on the upcoming change and the deprecation process can be found on the documentation page for the annotation linked above, and also on the page for this related annotation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    📋 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions