File tree 3 files changed +158
-123
lines changed 3 files changed +158
-123
lines changed Original file line number Diff line number Diff line change @@ -450,7 +450,7 @@ abstract class DartdocOption<T> {
450
450
451
451
/// To avoid accessing early, call [add] on the option's parent before
452
452
/// looking up unless this is a [DartdocRootOption] .
453
- late final DartdocOption parent;
453
+ late final DartdocOption < dynamic > parent;
454
454
455
455
/// The [DartdocOptionRoot] containing this object.
456
456
DartdocOptionRoot get root {
@@ -516,10 +516,13 @@ abstract class DartdocOption<T> {
516
516
void addAll (Iterable <DartdocOption > options) => options.forEach (add);
517
517
518
518
/// Get the immediate child of this node named [name] .
519
- DartdocOption < dynamic > operator [](String name) {
519
+ DartdocOption operator [](String name) {
520
520
return _children[name]! ;
521
521
}
522
522
523
+ /// Get the immediate child of this node named [name] as a [DartdocOption<U>] .
524
+ DartdocOption <U > getAs <U >(String name) => _children[name] as DartdocOption <U >;
525
+
523
526
/// Apply the function [visit] to [this] and all children.
524
527
void traverse (void Function (DartdocOption option) visit) {
525
528
visit (this );
Original file line number Diff line number Diff line change @@ -100,10 +100,12 @@ class Accessor extends ModelElement implements EnclosedElement {
100
100
}
101
101
102
102
@override
103
- void warn (PackageWarning kind,
104
- {String message,
105
- Iterable <Locatable > referredFrom,
106
- Iterable <String > extendedDebug}) {
103
+ void warn (
104
+ PackageWarning kind, {
105
+ String message,
106
+ Iterable <Locatable > referredFrom = const [],
107
+ Iterable <String > extendedDebug = const [],
108
+ }) {
107
109
enclosingCombo.warn (kind,
108
110
message: message,
109
111
referredFrom: referredFrom,
You can’t perform that action at this time.
0 commit comments