Skip to content

Migrate NamedValue .copy visibility according to future Kotlin 2.5 requirement - #2014

Merged
koperagen merged 1 commit into
masterfrom
namedvalue-fix
Jul 31, 2026
Merged

Migrate NamedValue .copy visibility according to future Kotlin 2.5 requirement#2014
koperagen merged 1 commit into
masterfrom
namedvalue-fix

Conversation

@koperagen

Copy link
Copy Markdown
Collaborator

As things now: private constructor with implicitly public constructor, this code will become error in 2.5 release.
Looks like we deed to decide what ABI we want for it
I propose changing visibility to internal for constructor and for .copy because we use it in implementation, but it doesn't make much sense to have it in public API

@koperagen koperagen added this to the 1.0 milestone Jul 30, 2026
@koperagen koperagen self-assigned this Jul 30, 2026
@koperagen koperagen added the API If it touches our API label Jul 30, 2026
@koperagen koperagen changed the title Migrate NamedValue .copy visibility according to future 2.5 requirement Migrate NamedValue .copy visibility according to future Kotlin 2.5 requirement Jul 30, 2026
@Jolanrensen

Jolanrensen commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

For context: https://youtrack.jetbrains.com/issue/KTLC-22/LC-Change-default-visibility-of-generated-copy-method-to-match-primary-constructor-visibility

@ConsistentCopyVisibility can be seen as an early opt-in to the behavior where the copy method gets the same visibility as the primary constructor. So, internal after these changes.

@koperagen
koperagen merged commit 99df59b into master Jul 31, 2026
5 of 6 checks passed
@Jolanrensen
Jolanrensen deleted the namedvalue-fix branch July 31, 2026 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API If it touches our API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants