Skip to content
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

Fixed Dart compilation issue. #77

Merged
merged 1 commit into from
Oct 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rollbar_common/lib/src/data/breadcrumb_record.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class BreadcrumbRecord implements Persistable<UUID> {
@override
int compareTo(other) {
if (other is! BreadcrumbRecord) {
throw ArgumentError('Cannot compare between different types.', other);
throw ArgumentError('Cannot compare between different types.', 'other');
}

return timestamp.compareTo(other.timestamp);
Expand Down
4 changes: 2 additions & 2 deletions rollbar_common/lib/src/data/payload_record.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ class PayloadRecord implements Persistable<UUID> {
///
/// The [other] argument must be a value that is comparable to this object.
@override
int compareTo(other) {
int compareTo(Persistable<UUID> other) {
if (other is! PayloadRecord) {
throw ArgumentError('Cannot compare between different types.', other);
throw ArgumentError('Cannot compare between different types.', 'other');
}

return timestamp.compareTo(other.timestamp);
Expand Down
6 changes: 4 additions & 2 deletions rollbar_common/lib/src/persistable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ extension DatatypeSqlType on Datatype {
/// [Persistable] types leverage serialization to store and recover
/// `(key, value)` pairs through [Serializable.fromMap] and [toMap].
abstract class Persistable<T extends Object>
implements Serializable, Comparable, Identifiable<T> {
implements Serializable, Comparable<Persistable<T>>, Identifiable<T> {
static const _map = <Type, PersistableFor>{
Persistable: PersistableFor(),
PayloadRecord: PersistablePayloadRecord(),
Expand All @@ -35,13 +35,15 @@ abstract class Persistable<T extends Object>

/// A List of all persistable keys and their associated [Datatype]s in
/// this [Persistable].
///
/// Issue: https://github.com/dart-lang/language/issues/356
// static Map<String, Datatype> get persistingKeyTypes;
}

/// Dart's type system is too rudimentary and still doesn't support
/// abstract static interfaces.
///
/// This is a workaround that allows us to express generic [Serializable]
/// This is a workaround that allows us to express generic [Persistable]
/// types.
///
/// More info: https://github.com/dart-lang/language/issues/356
Expand Down