@@ -202,7 +202,8 @@ abstract class ModelElement extends Canonicalization
202202 e is ParameterElement ||
203203 e is TypeParameterElement ||
204204 e is GenericFunctionTypeElementImpl ||
205- e.kind == ElementKind .DYNAMIC );
205+ e.kind == ElementKind .DYNAMIC ||
206+ e.kind == ElementKind .NEVER );
206207
207208 Member originalMember;
208209 // TODO(jcollins-g): Refactor object model to instantiate 'ModelMembers'
@@ -215,13 +216,17 @@ abstract class ModelElement extends Canonicalization
215216 Tuple3 (e, library, enclosingContainer);
216217 ModelElement newModelElement;
217218 if (e.kind != ElementKind .DYNAMIC &&
219+ e.kind != ElementKind .NEVER &&
218220 packageGraph.allConstructedModelElements.containsKey (key)) {
219221 newModelElement = packageGraph.allConstructedModelElements[key];
220222 assert (newModelElement.element is ! MultiplyInheritedExecutableElement );
221223 } else {
222224 if (e.kind == ElementKind .DYNAMIC ) {
223225 newModelElement = Dynamic (e, packageGraph);
224226 }
227+ if (e.kind == ElementKind .NEVER ) {
228+ newModelElement = NeverType (e, packageGraph);
229+ }
225230 if (e is MultiplyInheritedExecutableElement ) {
226231 newModelElement = resolveMultiplyInheritedElement (
227232 e, library, packageGraph, enclosingContainer);
@@ -1120,6 +1125,7 @@ abstract class ModelElement extends Canonicalization
11201125 // element associated with a ModelElement or there's an analysis bug.
11211126 assert (name.isNotEmpty ||
11221127 this .element? .kind == ElementKind .DYNAMIC ||
1128+ this .element? .kind == ElementKind .NEVER ||
11231129 this is ModelFunction );
11241130
11251131 if (href == null ) {
0 commit comments