@@ -73,31 +73,33 @@ ModelElement resolveMultiplyInheritedElement(
73
73
}
74
74
75
75
/// This class is the foundation of Dartdoc's model for source code.
76
+ ///
76
77
/// All ModelElements are contained within a [PackageGraph] , and laid out in a
77
78
/// structure that mirrors the availability of identifiers in the various
78
- /// namespaces within that package. For example, multiple [Class] objects
79
- /// for a particular identifier ([ModelElement.element] ) may show up in
80
- /// different [Library] s as the identifier is reexported.
79
+ /// namespaces within that package. For example, multiple [Class] objects for a
80
+ /// particular identifier ([ModelElement.element] ) may show up in different
81
+ /// [Library] s as the identifier is reexported.
81
82
///
82
83
/// However, ModelElements have an additional concept vital to generating
83
84
/// documentation: canonicalization.
84
85
///
85
86
/// A ModelElement is canonical if it is the element in the namespace where that
86
- /// element 'comes from' in the public interface to this [PackageGraph] . That often
87
- /// means the [ModelElement.library] is contained in [PackageGraph.libraries] , but
88
- /// there are many exceptions and ambiguities the code tries to address here.
87
+ /// element 'comes from' in the public interface to this [PackageGraph] . That
88
+ /// often means the [ModelElement.library] is contained in
89
+ /// [PackageGraph.libraries] , but there are many exceptions and ambiguities the
90
+ /// code tries to address here.
89
91
///
90
92
/// Non-canonical elements should refer to their canonical counterparts, making
91
- /// it easy to calculate links via [ModelElement.href] without having to
92
- /// know in a particular namespace which elements are canonical or not.
93
- /// A number of [PackageGraph] methods, such as [PackageGraph.findCanonicalModelElementFor]
93
+ /// it easy to calculate links via [ModelElement.href] without having to know in
94
+ /// a particular namespace which elements are canonical or not. A number of
95
+ /// [PackageGraph] methods, such as [PackageGraph.findCanonicalModelElementFor]
94
96
/// can help with this.
95
97
///
96
98
/// When documenting, Dartdoc should only write out files corresponding to
97
99
/// canonical instances of ModelElement ([ModelElement.isCanonical] ). This
98
100
/// helps prevent subtle bugs as generated output for a non-canonical
99
- /// ModelElement will reference itself as part of the "wrong" [Library]
100
- /// from the public interface perspective.
101
+ /// ModelElement will reference itself as part of the "wrong" [Library] from the
102
+ /// public interface perspective.
101
103
abstract class ModelElement extends Canonicalization
102
104
with
103
105
CommentReferable ,
@@ -628,8 +630,9 @@ abstract class ModelElement extends Canonicalization
628
630
if ((this as Inheritable ).isInherited &&
629
631
_canonicalLibrary == null &&
630
632
packageGraph.publicLibraries.contains (library)) {
631
- // In the event we've inherited a field from an object that isn't directly reexported,
632
- // we may need to pretend we are canonical for this.
633
+ // In the event we've inherited a field from an object that isn't
634
+ // directly reexported, we may need to pretend we are canonical for
635
+ // this.
633
636
_canonicalLibrary = library;
634
637
}
635
638
}
@@ -939,8 +942,8 @@ abstract class ModelElement extends Canonicalization
939
942
940
943
List <Parameter > _allParameters;
941
944
942
- // TODO(jcollins-g): This is in the wrong place. Move parts to GetterSetterCombo,
943
- // elsewhere as appropriate?
945
+ // TODO(jcollins-g): This is in the wrong place. Move parts to
946
+ // [GetterSetterCombo], elsewhere as appropriate?
944
947
List <Parameter > get allParameters {
945
948
if (_allParameters == null ) {
946
949
var recursedParameters = < Parameter > {};
@@ -977,7 +980,8 @@ abstract class ModelElement extends Canonicalization
977
980
978
981
List <Parameter > get parameters {
979
982
if (! isCallable) {
980
- throw StateError ('$element cannot have parameters' );
983
+ throw StateError (
984
+ '$element (${element .runtimeType }) cannot have parameters' );
981
985
}
982
986
983
987
if (_parameters == null ) {
0 commit comments