I don't think it makes sense to extend the classes that are affected by this PR. It would make more sense to create custom sealed classes, for example, for Err types, e.g.:
sealed class CustomError {
// ..
}
final class Possibility1 extends CustomError {
// ..
}
final class Possibility2 extends CustomError {
// ..
}
Result <int, CustomError> myFn() {
// ..
}
Also, this greatly improves pattern matching. Consider the following non-final class:
class ExampleClass {}
Before this PR the IDE does not highlight potentially unmatchable types, due to Dart's implicit interfaces. For example, there could be a class that extends ExampleClass and implements Option:
First of all, great package!
I don't think it makes sense to extend the classes that are affected by this PR. It would make more sense to create custom sealed classes, for example, for
Err
types, e.g.:Also, this greatly improves pattern matching. Consider the following non-final class:
Before this PR the IDE does not highlight potentially unmatchable types, due to Dart's implicit interfaces. For example, there could be a class that extends
ExampleClass
and implementsOption
:After this PR: