Currently, we're allowing Compare with T being any kind of class.
Should we introduce an IDiffResult interface with from which the classes we support as convertible from DiffSafeHandle? Then Diff.Compare<T> would be T : IDiffResult.
This would improve a few aspects:
- No more runtime issues like this
- Type-safe and semantic completion support! I always had to check the sources for the types I can get.
- Customizable from user-side.
- No need to manually maintain the list (which is also outdated) in the exception message and the transformation list.
I know this would bring an implication that DiffSafeHandle would become public, or we can expose a proxy class with methods which interface the native methods.
Currently, we're allowing Compare with T being any kind of class.
Should we introduce an
IDiffResultinterface with from which the classes we support as convertible fromDiffSafeHandle? ThenDiff.Compare<T>would beT : IDiffResult.This would improve a few aspects:
I know this would bring an implication that
DiffSafeHandlewould become public, or we can expose a proxy class with methods which interface the native methods.