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

Declare ObjectRepository's template as covariant #292

Merged
merged 1 commit into from
May 3, 2022

Conversation

derrabus
Copy link
Member

@derrabus derrabus commented May 2, 2022

The ObjectRepository interface is documented as generic with a template variable T. Since T is only used in return types, we can safely assume that any piece of code that expects an ObjectRepository<ParentClass> can safely operate on an ObjectRepository<ChildClass> (given ChildClass extends ParentClass of course).

This is why I'd like to declare the template variable as covariant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Static Analysis
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants