sdk
sdk copied to clipboard
Update `StackOverflowError.stackTrace` documentation
The current StackOverflowError.stackTrace
documentation reads:
The stack trace at the point where this error was first thrown.
Classes which extend Error will automatically have a stack trace filled in the first time they are thrown by a throw expression.
In fact, this property is always null
for this class. See https://github.com/dart-lang/sdk/issues/28179
Looks like this documentation is a simply copy/paste from Error.stackTrace
. Need to update it and reflect the fact that for the class StackOverflowError
this property is always null
.
P.S. "Classes which extend Error
will automatically have a stack trace filled...". Dart API has no classes which extend Error
, only bunch of classes which implements Error
That's the wonder of inherited documentation. It's correct for Error
itself, but subclasses that don't extend Error
may want to change documentation.
The Dart API do have classes extending Error
: AssertionError
, ArgumentError
, IndexError
, NoSuchMethodError
, RangeError
, StateError
, TypeError
and UnimplementedError
at least. (Every error defined in errors.dart
except for StackOverflowError
and OutOfMemoryError
.)
The Dart API do have classes extending Error
Ups, sorry. I read the documentation and it contains list of 'implementers' only and doesn't have list of 'Known subclasses' like Java API does. It misleaded me.
This is probably the only place where it matters whether a class extends or implements a supertype, so it's unsurprising that DartDoc doesn't make the distinction.