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

Make SmithyIntegrations available from CodegenContext #1237

Merged
merged 2 commits into from
Jun 24, 2022

Conversation

gosar
Copy link
Contributor

@gosar gosar commented May 25, 2022

This PR has 2 commits.

The 1st commit, only made SmithyIntegrations available from CreateContextDirective, so subclasses
of CodegenContext can access it. But it likely can be made part of parent CodegenContext interface.

The 2nd commit, made it part of CodegenContext interface. This requires another generic parameter to be added in multiple places. Avoided adding generic parameter to CodegenContext by defining the method as List<? extends SmithyIntegration<S, W, ?>> integrations(); where subclasses can return more specific List<MyIntegration> integrations();

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

For now, only made it available from CreateContextDirective, so subclasses
CodegenContext can access it. But it likely can be made part of parent
CodegenContext interface.
@gosar gosar force-pushed the directed-codegen branch from abd1a81 to 1f34688 Compare June 2, 2022 23:19
@gosar gosar changed the title Make SmithyIntegrations available to create CodegenContext Make SmithyIntegrations available from CodegenContext Jun 2, 2022
@gosar gosar force-pushed the directed-codegen branch from 1f34688 to c01ff47 Compare June 3, 2022 20:28
@gosar gosar force-pushed the directed-codegen branch from c01ff47 to 1f34688 Compare June 18, 2022 08:41
@gosar gosar marked this pull request as ready for review June 18, 2022 09:05
@gosar gosar requested a review from a team as a code owner June 18, 2022 09:05
@gosar gosar requested a review from mtdowling June 18, 2022 09:05
*/
public interface DirectedCodegen<C extends CodegenContext<S, ?>, S> {
public interface DirectedCodegen<C extends CodegenContext<S, ?, I>, S, I extends SmithyIntegration<S, ?, ?>> {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm, this can be I extends SmithyIntegration<S, ?, C>> since C is defined here too

@gosar gosar force-pushed the directed-codegen branch from 1f34688 to 67f7ae9 Compare June 24, 2022 20:44
@gosar gosar merged commit d8c3fb1 into smithy-lang:main Jun 24, 2022
@gosar gosar deleted the directed-codegen branch June 27, 2022 23:47
@gosar gosar restored the directed-codegen branch June 28, 2022 07:30
@gosar gosar deleted the directed-codegen branch July 2, 2022 07:34
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