@@ -240,13 +240,13 @@ abstract class ModelElement implements Comparable {
240240
241241 ElementType get modelType => _modelType;
242242
243- /// Returns the [ModelElement ] that encloses this.
244- ModelElement get enclosingElement {
243+ /// Returns the [ClassElement ] that encloses this.
244+ Class get enclosingClass {
245245 // A class's enclosing element is a library, and there isn't a
246246 // modelelement for a library.
247247 if (element.enclosingElement != null &&
248248 element.enclosingElement is ClassElement ) {
249- return new ModelElement .from (element.enclosingElement, library);
249+ return new ModelElement .from (element.enclosingElement, library) as Class ;
250250 } else {
251251 return null ;
252252 }
@@ -259,10 +259,13 @@ abstract class ModelElement implements Comparable {
259259 if (! package.isDocumented (this .element)) {
260260 return htmlEscape (name);
261261 }
262+
262263 if (name.startsWith ('_' )) {
263264 return htmlEscape (name);
264265 }
265- Class c = enclosingElement;
266+
267+ // this smells like it's in the wrong place
268+ Class c = enclosingClass;
266269 if (c != null && c.name.startsWith ('_' )) {
267270 return '${c .name }.${htmlEscape (name )}' ;
268271 }
@@ -444,7 +447,7 @@ class Package {
444447 } else {
445448 el = element;
446449 }
447- debugger (when : element.name == 'NAME_SINGLEUNDERSCORE ' );
450+ // debugger(when: element.name == 'NAME_WITH_TWO_UNDERSCORES ');
448451 return _libraries.firstWhere ((lib) => lib.hasInNamespace (el),
449452 orElse: () => null );
450453 }
@@ -1392,7 +1395,7 @@ class Constructor extends ModelElement {
13921395 @override
13931396 String get name {
13941397 String constructorName = element.name;
1395- Class c = enclosingElement ;
1398+ Class c = enclosingClass ;
13961399 if (constructorName.isEmpty) {
13971400 return c.name;
13981401 } else {
0 commit comments