Skip to content

Add support for ObjCEnum.EntryName#5683

Open
stefanhaustein wants to merge 1 commit intoJetBrains:masterfrom
stefanhaustein:master
Open

Add support for ObjCEnum.EntryName#5683
stefanhaustein wants to merge 1 commit intoJetBrains:masterfrom
stefanhaustein:master

Conversation

@stefanhaustein
Copy link
Contributor

Allowing NSEnum-specific names, simplifying compatibility when porting code to Kotlin

This is a refinement for https://youtrack.jetbrains.com/issue/KT-48068/

  • Renaming via ObjCName requires escaping of the enum entry name, leading to unnecessarily escaped names for the fully qualified enum literal name
  • There are cases where we need specific names for the literals that are different from the objc entry object names

Copy link
Contributor

@SvyatoslavScherbina SvyatoslavScherbina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything else LGTM.
Please also squash the commits and write a commit message following the guideline: https://github.com/JetBrains/kotlin/blob/master/docs/code_authoring_and_core_review.md#commit-messages-and-yt-tickets

@kotlin-safe-merge
Copy link

kotlin-safe-merge bot commented Feb 19, 2026

Code Owners

Rule Owners Approval
/​kotlin-​native/​runtime/​src/​main/​kotlin/​ @DmitryNekrasov, kotlin-native, @fzhinkin, @ilya-g, @qwwdfsad
/​libraries/​stdlib/​ @DmitryNekrasov, @fzhinkin, @ilya-g, @qwwdfsad
/​libraries/​tools/​binary-​compatibility-​validator/​ kotlin-libraries
/​native/​, /​native/​objcexport-​header-​generator/​impl/​analysis-​api/​, /​native/​objcexport-​header-​generator/​ kotlin-native

@SvyatoslavScherbina
Copy link
Contributor

/test-public

@SvyatoslavScherbina
Copy link
Contributor

You also need to run the "Test: public API binary compatibility validator w/Native, overwrite results" run configuration from IDEA, or

./gradlew :tools:binary-compatibility-validator:cleanTest :tools:binary-compatibility-validator:test --tests '*' -Poverwrite.output=true -Pkotlin.native.enabled=true

in the terminal.

@stefanhaustein
Copy link
Contributor Author

Everything else LGTM. Please also squash the commits and write a commit message following the guideline: https://github.com/JetBrains/kotlin/blob/master/docs/code_authoring_and_core_review.md#commit-messages-and-yt-tickets

Do you have a recommendation / pointer for the best way to squash / how you typically do this?

  • Github documentation only points at selecting this as a merge option
  • I have tried git rebase -i HEAD~6, but it gave me a list of hundreds of commits. I tried to nope out but I am slightly concerned I might have put my client into a bad state

Copy link
Contributor

@SvyatoslavScherbina SvyatoslavScherbina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything else LGTM. Please also squash the commits and write a commit message following the guideline: https://github.com/JetBrains/kotlin/blob/master/docs/code_authoring_and_core_review.md#commit-messages-and-yt-tickets

Do you have a recommendation / pointer for the best way to squash / how you typically do this?

With git rebase -i.

  • I have tried git rebase -i HEAD~6, but it gave me a list of hundreds of commits. I tried to nope out but I am slightly concerned I might have put my client into a bad state

I guess it happened because you merged from the upstream instead of rebasing to it.
To remove merge commits, you can rebase to the upstream.

@SvyatoslavScherbina
Copy link
Contributor

/test-public

…y of the (translated) names for the regular enum transpilation.

The entry names are supplied via @ObjCEnum.EntryName.
This amends [KT-48068], simplifying migrations where compatibility needs to be ensure for legacy code ported to kotlin.
@stefanhaustein
Copy link
Contributor Author

Everything else LGTM. Please also squash the commits and write a commit message following the guideline: https://github.com/JetBrains/kotlin/blob/master/docs/code_authoring_and_core_review.md#commit-messages-and-yt-tickets

This should be done now

Copy link
Contributor

@SvyatoslavScherbina SvyatoslavScherbina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/test-public

@SvyatoslavScherbina
Copy link
Contributor

/test-public

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants