Skip to content

Drop IComparable<T> constraint for range extensions - #571

Merged
austindrenski merged 1 commit into
npgsql:devfrom
austindrenski:patch-range-ext
Aug 8, 2018
Merged

austindrenski merged 1 commit into
npgsql:devfrom
austindrenski:patch-range-ext

Conversation

@austindrenski

Copy link
Copy Markdown
Contributor

- Patch for 570.
- `NpgsqlRange<T>` doesn't implement `IComparable<T>`.
@roji

roji commented Aug 8, 2018

Copy link
Copy Markdown
Member

Looks good, but I'm not sure how this relates/fixes #570 which is about introducing new nullable constructors to NpgsqlRange...

@austindrenski

Copy link
Copy Markdown
Contributor Author

@roji The initial issue pointed to a compiler error from Overlaps:

but whenever I try to use it, for example with Overlaps I get:

The type 'NodaTime.Instant?' cannot be used as type parameter 'T' in the generic type or method 'NpgsqlRangeExtensions.Overlaps(NpgsqlRange, NpgsqlRange)'. The nullable type 'NodaTime.Instant?' does not satisfy the constraint of 'System.IComparable<NodaTime.Instant?>'. Nullable types can not satisfy any interface constraints.

@austindrenski
austindrenski merged commit d2f8671 into npgsql:dev Aug 8, 2018
@austindrenski
austindrenski deleted the patch-range-ext branch August 8, 2018 11:53
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.

3 participants