Skip to content

Remove usage of object return type for getCloneParameters #898

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

Closed
pokey opened this issue Jul 28, 2022 · 1 comment
Closed

Remove usage of object return type for getCloneParameters #898

pokey opened this issue Jul 28, 2022 · 1 comment
Labels
code quality Improvements to code quality

Comments

@pokey
Copy link
Member

pokey commented Jul 28, 2022

Currently, getCloneParameters has a weak type because it needs to be used in createContinuousRangeTarget, cloneWith, and isEqual. We'd like to move these 3 consumer functions into the derived classes, and instead have them call polymorphic implementations. That way we get strong types via template specialisation while still avoiding code duplication

Note that strong typing here would have caught at least two different bugs, eg #895

@pokey pokey added the code quality Improvements to code quality label Jul 28, 2022
@AndreasArvidsson
Copy link
Member

I believe this is fixed now

protected abstract getCloneParameters(): TParameters;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality Improvements to code quality
Projects
None yet
Development

No branches or pull requests

2 participants