cursorless icon indicating copy to clipboard operation
cursorless copied to clipboard

Remove usage of `object` return type for `getCloneParameters`

Open pokey opened this issue 3 years ago • 0 comments

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 https://github.com/cursorless-dev/cursorless/pull/895

pokey avatar Jul 28 '22 09:07 pokey