Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate TypeSpec.expectClassBuilder() and TypeSpec.valueClassBuilder() #1589

Merged
merged 5 commits into from
Jun 8, 2023

Conversation

drawers
Copy link
Contributor

@drawers drawers commented Jun 4, 2023

Closes #1385

ReplaceWith("TypeSpec.classBuilder(name).addModifiers(KModifier.VALUE)"),
)
@JvmStatic
public fun valueClassBuilder(name: String): Builder = Builder(Kind.CLASS, name, VALUE)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This function wasn't mentioned explicitly in the issue comments for #1385 but I assume the intention is to reduce the API surface so I deprecated it too.

Copy link
Collaborator

@Egorand Egorand left a comment

Choose a reason for hiding this comment

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

Thanks!

Builder(Kind.CLASS, name, EXPECT)
@Deprecated(
"Use classBuilder() instead. This function will be removed in KotlinPoet 2.0",
ReplaceWith("TypeSpec.classBuilder(name).addModifiers(KModifier.EXPECT)"),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice!

@Egorand Egorand merged commit 7a77bdf into square:master Jun 8, 2023
@drawers drawers deleted the enhancement/1385-deprecate branch July 2, 2023 03:14
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.

No TypeSpec.expectObjectBuilder
2 participants