@@ -31,7 +31,7 @@ abstract class ElementType extends Privacy with CommentReferable, Nameable {
3131 f.element.kind == ElementKind .DYNAMIC ||
3232 f.element.kind == ElementKind .NEVER ) {
3333 if (f is FunctionType ) {
34- if (f.aliasElement != null ) {
34+ if (f.alias ? .element != null ) {
3535 return AliasedFunctionTypeElementType (
3636 f, library, packageGraph, returnedFrom);
3737 }
@@ -44,14 +44,14 @@ abstract class ElementType extends Privacy with CommentReferable, Nameable {
4444 // In that case it is an actual type alias of some kind (generic
4545 // or otherwise. Here however aliasElement signals that this is a
4646 // type referring to an alias.
47- if (f is ! TypeAliasElement && f.aliasElement != null ) {
47+ if (f is ! TypeAliasElement && f.alias ? .element != null ) {
4848 return AliasedElementType (
4949 f, library, packageGraph, element, returnedFrom);
5050 }
5151 assert (f is ParameterizedType || f is TypeParameterType );
5252 // TODO(jcollins-g): strip out all the cruft that's accumulated
5353 // here for non-generic type aliases.
54- var isGenericTypeAlias = f.aliasElement != null && f is ! InterfaceType ;
54+ var isGenericTypeAlias = f.alias ? .element != null && f is ! InterfaceType ;
5555 if (f is FunctionType ) {
5656 assert (f is ParameterizedType );
5757 // This is an indication we have an extremely out of date analyzer....
@@ -188,8 +188,8 @@ class AliasedFunctionTypeElementType extends FunctionTypeElementType
188188 AliasedFunctionTypeElementType (FunctionType f, Library library,
189189 PackageGraph packageGraph, ElementType returnedFrom)
190190 : super (f, library, packageGraph, returnedFrom) {
191- assert (type.aliasElement != null );
192- assert (type.aliasArguments != null );
191+ assert (type.alias ? .element != null );
192+ assert (type.alias ? .typeArguments != null );
193193 }
194194
195195 @override
@@ -220,18 +220,18 @@ class ParameterizedElementType extends DefinedElementType with Rendered {
220220/// A [ElementType] whose underlying type was referrred to by a type alias.
221221mixin Aliased implements ElementType {
222222 @override
223- String get name => type.aliasElement .name;
223+ String get name => type.alias.element .name;
224224
225225 @override
226226 bool get isTypedef => true ;
227227
228228 ModelElement _aliasElement;
229229 ModelElement get aliasElement => _aliasElement ?? =
230- ModelElement .fromElement (type.aliasElement , packageGraph);
230+ ModelElement .fromElement (type.alias.element , packageGraph);
231231
232232 Iterable <ElementType > _aliasArguments;
233233 Iterable <ElementType > get aliasArguments =>
234- _aliasArguments ?? = type.aliasArguments
234+ _aliasArguments ?? = type.alias.typeArguments
235235 .map ((f) => ElementType .from (f, library, packageGraph))
236236 .toList (growable: false );
237237}
@@ -240,7 +240,7 @@ class AliasedElementType extends ParameterizedElementType with Aliased {
240240 AliasedElementType (ParameterizedType type, Library library,
241241 PackageGraph packageGraph, ModelElement element, ElementType returnedFrom)
242242 : super (type, library, packageGraph, element, returnedFrom) {
243- assert (type.aliasElement != null );
243+ assert (type.alias ? .element != null );
244244 }
245245
246246 @override
@@ -429,7 +429,7 @@ class CallableElementType extends DefinedElementType with Rendered, Callable {
429429 Iterable <ElementType > _typeArguments;
430430 @override
431431 Iterable <ElementType > get typeArguments =>
432- _typeArguments ?? = (type.aliasArguments ?? [])
432+ _typeArguments ?? = (type.alias ? .typeArguments ?? [])
433433 .map ((f) => ElementType .from (f, library, packageGraph))
434434 .toList (growable: false );
435435}
0 commit comments