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

Add type restrictions to methods in Adapter::Base #437

Closed
wants to merge 1 commit into from
Closed

Add type restrictions to methods in Adapter::Base #437

wants to merge 1 commit into from

Conversation

SlayerShadow
Copy link

Currently there are errors in adapters when compiling against Crystal built from master:

  • Error: abstract def Granite::Adapter::Base#clear(table_name) must be implemented by Granite::Adapter::Pg
  • Error: abstract def Granite::Adapter::Base#insert(table_name, fields, params, lastval) must be implemented by Granite::Adapter::Pg
  • Error: abstract def Granite::Adapter::Base#update(table_name, primary_name, fields, params) must be implemented by Granite::Adapter::Pg
  • Error: abstract def Granite::Adapter::Base#delete(table_name, primary_name, value) must be implemented by Granite::Adapter::Pg

For other adapters there are the same errors.

This PR fixes the problem. Because of subclasses already define all these methods with type restrictions, there should not be breaking changes.

Tested against:

Crystal 0.36.0-dev [7e0fdb0] (2021-01-18)

LLVM: 11.0.0
Default target: x86_64-unknown-linux-musl

(crystal-lang/crystal@7e0fdb0a)

Copy link
Member

@robacarp robacarp left a comment

Choose a reason for hiding this comment

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

thanks @SlayerShadow

@SlayerShadow
Copy link
Author

Never mind - that's already in master.

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.

None yet

2 participants