mirror of
https://github.com/apple/pkl.git
synced 2026-01-11 14:20:35 +01:00
[PR #793] [MERGED] codegen-kotlin: Generate toString() methods consistent with data classes #739
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/apple/pkl/pull/793
Author: @odenix
Created: 11/8/2024
Status: ✅ Merged
Merged: 11/14/2024
Merged by: @bioball
Base:
main← Head:kotlin-tostring📝 Commits (3)
9cee7cccodegen-kotlin: Generate toString() methods consistent with data classes197c68eRename KotlinCodegenOptions to KotlinCodeGeneratorOptions2a43194Incorporate review feedback📊 Changes
6 files changed (+86 additions, -279 deletions)
View changed files
📝
pkl-codegen-kotlin/src/main/kotlin/org/pkl/codegen/kotlin/CliKotlinCodeGeneratorOptions.kt(+2 -2)📝
pkl-codegen-kotlin/src/main/kotlin/org/pkl/codegen/kotlin/KotlinCodeGenerator.kt(+25 -91)📝
pkl-codegen-kotlin/src/test/kotlin/org/pkl/codegen/kotlin/KotlinCodeGeneratorTest.kt(+51 -64)📝
pkl-codegen-kotlin/src/test/resources/org/pkl/codegen/kotlin/Inheritance.kotlin(+4 -45)📝
pkl-codegen-kotlin/src/test/resources/org/pkl/codegen/kotlin/Kdoc.kotlin(+1 -23)📝
pkl-codegen-kotlin/src/test/resources/org/pkl/codegen/kotlin/PropertyTypes.kotlin(+3 -54)📄 Description
Note to reviewers: The second commit is a rename refactoring.
codegen-kotlin: Generate toString() methods consistent with data classes
Motivation:
codegen-kotlin generates a mix of data classes and regular classes.
For regular classes, toString() methods are also generated.
However, the output of generated toString() methods
differs from the output of default toString() methods of data classes.
Changes:
Generate toString() methods that produce the same output
as default toString() methods of data classes.
Result:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.