Skip to content

Commit d89b771

Browse files
committed
Deprecate Interval.length
It wouldn't work with anything besides nums.
1 parent ea6d4f0 commit d89b771

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* Fixed comparison for intervals with other comparables, such as DateTime
55
* Made IntervalTree default constructor, add(), and remove() throw an
66
ArgumentError when passing an invalid interval iterable
7+
* Deprecated Interval.length that would only work with nums
78

89
## [0.2.0+2] - 2020-04-27
910

lib/interval_tree.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ class Interval extends Comparable<Interval> {
102102
dynamic get end => _end;
103103

104104
/// Returns the length of this interval.
105+
@deprecated
105106
dynamic get length => _end - _start;
106107

107108
/// Returns `true` if this interval contains the [other] interval.

0 commit comments

Comments
 (0)