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

feat(java): use covariant types for collection elements #1884

Merged
merged 9 commits into from
Aug 21, 2020

Conversation

RomainMuller
Copy link
Contributor

Re-introducing feature reverted in #1675

Using covariant expressions instead of just the type name enables a
better experience when using libraries such as Guava to build up
collections (List or Map) to use with the libraries. In particular,
collections of any are particularly annoying to use without covariant
typing because they'd force the user to manually specify generic
parameters in their code that add nothing to the safety of the program.

Fixes #1517


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

Using covariant expressions instead of just the type name enables a
better experience when using libraries such as Guava to build up
collections (`List` or `Map`) to use with the libraries. In particular,
collections of `any` are particularly annoying to use without covariant
typing because they'd force the user to manually specify generic
parameters in their code that add nothing to the safety of the program.

Fixes #1517
@RomainMuller RomainMuller requested a review from NetaNir August 13, 2020 13:43
@RomainMuller RomainMuller self-assigned this Aug 13, 2020
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Aug 13, 2020
@RomainMuller RomainMuller added this to the August Release milestone Aug 19, 2020
@mergify
Copy link
Contributor

mergify bot commented Aug 20, 2020

Thank you for contributing! ❤️ I will now look into making sure the PR is up-to-date, then proceed to try and merge it!

@mergify mergify bot added the pr/ready-to-merge This PR is ready to be merged. label Aug 20, 2020
@mergify
Copy link
Contributor

mergify bot commented Aug 20, 2020

Merging (with squash)...

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-Blkkw9bQFn8A
  • Commit ID: 493b051
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify
Copy link
Contributor

mergify bot commented Aug 21, 2020

Merging (with squash)...

@RomainMuller RomainMuller merged commit be2c7e2 into master Aug 21, 2020
@RomainMuller RomainMuller deleted the rmuller/java-covariant-maps branch August 21, 2020 12:01
@mergify mergify bot removed the pr/ready-to-merge This PR is ready to be merged. label Aug 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Java: please emit covariant Map types
3 participants