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

Fix CodeWriter backwards compatibility #1123

Merged
merged 1 commit into from
Mar 10, 2022

Conversation

adamthom-amzn
Copy link
Contributor

Description of changes:
Adding a parent of CodeWriter that changed the return type of its methods, even
though those returned objects were always in practice the same type as they had
been before, broke binary backwards compatibility for consumers of CodeWriter.

This forks CodeWriter back to its previous state, mostly, and adds a new
default extension of AbstractCodeWriter called TypedCodeWriter. Current
consumers of CodeWriter will continue to work, and have access to some new
features, such as the C formatter (though their Consumer will receive an
AbstractCodeWriter, not CodeWriter), and will keep onSectionPrepend and
onSectionAppend, but not have access to typed sections.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@adamthom-amzn adamthom-amzn requested a review from a team as a code owner March 9, 2022 01:28
@adamthom-amzn adamthom-amzn changed the title Fork CodeWriter to preserve backwards compatibility Fix CodeWriter backwards compatibility Mar 9, 2022
@adamthom-amzn adamthom-amzn requested review from mtdowling and a team March 9, 2022 22:03
@adamthom-amzn adamthom-amzn force-pushed the fork-codewriter branch 2 times, most recently from 3ed4fb3 to a418430 Compare March 10, 2022 01:02
Adding a parent of CodeWriter that changed the return type of its methods, even
though those returned objects were always in practice the same type as they had
been before, broke binary backwards compatibility for consumers of CodeWriter.

This returns CodeWriter back to its previous state, mostly, and adds a new
default extension of AbstractCodeWriter called SimpleCodeWriter. Current
consumers of CodeWriter will continue to work, and have access to some new
features.
@adamthom-amzn adamthom-amzn merged commit a89ed09 into smithy-lang:main Mar 10, 2022
@adamthom-amzn adamthom-amzn deleted the fork-codewriter branch March 10, 2022 01:13
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