Open matanlurey opened 6 years ago
The CyclicInstantantiationError
can still happen. It's used for lazily initialized static fieds.
The AbstractClassInstantiationError
is obsolete. I think FallThroughError
is too.
Seems like a good time to introduce a deprecation policy, so we can deprecate them and remove them in Dart 3.
Not sure what you mean by "don't seem to ever be used" for the last three. I'm fairly certain that the VM is more than happy to throw those exceptions.
@bkonyi:
Not sure what you mean by "don't seem to ever be used" for the last three
Rather, users do not ever try to catch them or use them as types. They might make sense to make private and no longer export via dart:core
, as it adds additional mental overhead to navigating the API docs and auto-complete for all Dart files but doesn't seem to be particularly useful.
See also #34233.
This is not exhaustive, and probably too late for Dart2, but maybe Dart3?
FallThroughError
: I believe this is caught at compile-time now.CyclicInstantiationError
: DittoAbstractClassInstantiatonError
: DittoIn addition, these three errors don't seem to ever... be used:
IntegerDivisionByZeroException
OutOfMemoryError
StackOverflowError
It might make sense to make them private, I don't know if anyone ever tries to catch these?